javascript - AngularJS - Purpose of Writing $scope Before function($scope) -
I started learning AngularJS by looking at some examples in Google, but it was not explained. So far, I went through some examples where they
myApp.controller ('MainCtrl', function ($ scope) {$ scope.text = 'hello, corner radical;;}) ;
But some other blogs include '$ scope' before those tasks ($ scope)
myApp.controller ('MainCtrl' , ['$ Scope', function ($ scope) {$ scope.text = 'hello, cornal radical.';}]);
Is there any difference? Not just the scope of the dollar, similarly to other dependencies.
Comments
Post a Comment