Different between $scope and scope?
Loading
Different between $scope and scope?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajesh GamiPosted Nov 15, 2022, 1:52 PM
The case when you do
$scopein controller the Dependency Injection injects scope based on matching the variable name$scope, in this case usingscopeas name would not work.For case of directive the injection is position based so you can name your variable
aorbor any thing. The directive order for link function is(scope, iElement, iAttrs, controller)so first element is always scope object.
Brahma Prakash ShuklaPosted Nov 13, 2022, 2:37 PM
The $ in "$scope" indicates that the scope value is being injected into the current context. $scope is a service provided by $scopeProvider . You can inject it into controllers, directives or other services using Angular's built-in dependency injector: module.
Rajanikant HawaldarPosted Nov 13, 2022, 9:10 AM
https://www.c-sharpcorner.com/article/difference-between-scope-and-rootscope-in-angularjs/