Communication between controllers in Angular

后端 未结 3 1514
栀梦
栀梦 2021-02-03 12:28

I\'m familiar with the following methods to implement communication between controllers.

Are there others? Are there better approaches / best practices?


3条回答
  •  攒了一身酷
    2021-02-03 12:33

    As Samuel said, using a service to sharing data is a recommended method. The idea is that the state of the data are maintained consistently, regardless of any controller. This two articles can give you an idea of "how to" and "why": Sharing Data Between Controllers, The state of angularjs controllers.

提交回复
热议问题