Answer the question
In order to leave comments, you need to log in
What is DI used for?
What's the difference between
.controller('someCtrl', function($scope,mainService) {
mainService.method().....
})
.controller('someCtrl', function($scope) {
var myInjector = angular.injector(['app']);
var service = myInjector.get('mainService');
service.method()...
})
Answer the question
In order to leave comments, you need to log in
In what can be obtained through the injector service of another application
UPD: You can request the service through $injector from the line
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question