Can angularJS modules communicate with each other?
三叔
三叔 2017-06-22 11:53:20
0
2
913

There are two ng-app app1 and app2. Can parameters be passed between them?

三叔
三叔

reply all(2)
仅有的幸福

Provide an idea to directly bind a global variable or data structure, and then both apps can access it, which can realize the value transfer function,

三叔

You definitely have this problem, and there are many ways to solve it. The idea is as follows:
1. Use the service of the module to provide public services, and both modules reference the service at the same time
2. Use the module factory, the same as above
3. In addition, define an app3, so that both of your apps depend on this app3 (I really can’t think of it One of the methods)
4. Use the event delivery method $emit (the second method that is really unexpected)

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