var app = angular.module("MyApp", []);
app.controller("mainController", function ($scope) {
$scope.chkChanged = function(){
if(!$scope.a) return;
if($scope.mymodel){
delete $scope.a.select;
} else {
delete $scope.a.text;
}
};
});
The difference is not that big and actually like this you keep one watch out of the digest cycle :)