You should pass the property name (what you refer to as "model") as a string parameter.
Then you can access it using the object[key]
syntax.
$scope.checkBoxValueChanged = function(propName) {
if($scope[propName] === 'AA') {
$scope[propName] = 'BB';
} else {
$scope[propName] = 'AA';
}
};
BTW, in JS, scope.model
is equivalent to scope['model']
, so the dot syntax won't work as you want it to.