javascript - Is it possible to call methods across controllers in Angular?
扔个三星炸死你
扔个三星炸死你 2017-06-22 11:53:16
0
3
783

I want to use the controller in the page js to call a method in a controller in the bus js. Is this possible? $rootscope is not allowed to be added, and public js is not allowed to be changed. It is said that it is not allowed to be moved in the framework. .

扔个三星炸死你
扔个三星炸死你

reply all(3)
三叔

The core of angular is service, but there is no need for service. Write common methods in the service and then call them via dependency injection.

伊谢尔伦

You can talk about your specific functional scenario. There must be something wrong with the method you use.

黄舟

You can register a service, write the method you want in it, and then inject the service into the controller and you can call it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template