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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -