angularjs - Calling angular services globally -
I have a set of services that represent a backend logic, which is called by different angle controllers.
During the development, however, from the browser JavaScript Console, I want to call these services directly to check these services directly in isolation. How can this be done?
There
app.service ('service1', function () {this.sayHello = function () {return "Hello"};});
Now with Javascript Console,
app. CoatingToSet service ('service1'). SayHello ()
?
You can get the injector for the module and get the service from:
(angular insulator) (['ng', 'muep']). ('Service 1'). SayHello ()
Comments
Post a Comment