AngularJS controller $scope reserved keyword? -
i newbie angular, came across this fiddle explains how nested controller works. when rename $scope else $abc , doesn't work, mean $scope reserved keyword in angularjs?
function carcontroller($scope) { $scope.name = 'car'; $scope.type = 'car'; } function bmwcontroller($scope) { $scope.name = 'bmw'; } function bmwmotorcyclecontroller($scope) { $scope.name = 'bmwmotorade'; $scope.type = 'motorcycle'; }
effectively, yes. it's not reserved word in sense e.g. if
, while
angularjs gives meaning. in example angular parses string representation of function , uses named parameters determine "inject" function when calls it.
in case you're injecting $scope
service.
Comments
Post a Comment