ngParty / ng-metadata

Angular 2 decorators and utils for Angular 1.x
https://hotell.gitbooks.io/ng-metadata/content/
MIT License
355 stars 46 forks source link

any way to access $scope in component? #215

Closed kuxiongxiong closed 7 years ago

kuxiongxiong commented 7 years ago

in my legacy angular 1.X project ,in some directives it has some logic like $scope.$apply() how to handle this,any way to access $scope in component level?

aciccarello commented 7 years ago

Yes, you can use the @Inject parameter decorator in the constructor. consructor(@Inject('$scope') $scope) {...}