Closed homx closed 7 years ago
Can you put it specifically? I am not sure i got your points.
An example would be better
`class SearchController {
/*@ngInject*/
constructor($scope) {
this.$scope = $scope;
this._init_();
this._destroy_();
}
_init_() {
}
_destroy_() {
this.$scope.$on('$destroy', function() {});
}
}
export default SearchController;`
The above is my controller, I need a $ timeout controller, ask how injection
It's easy to achieve, just like shown at HomeController.js#L12
Specify it in the constructor
, as following:
/*@ngInject*/
constructor($scope, $timeout) {
this.$scope = $scope;
this.$timeout = $timeout;
this._init_();
this._destroy_();
}
This feature is provided by ng-annotate
, if you see more read
Hello, I now use the framework, now encountered some problems, I would like to inject a function in the controller, such as: $ timeout or hotkeys, but can not be achieved, please indicate, thank you!