How to share data between controllers in angular app in the right way

前端 未结 3 554
悲哀的现实
悲哀的现实 2021-01-14 10:26

Well, seems that this is not the first question about this subject, but...

I know that we can use service or events for this, but there are many posts on the interne

3条回答
  •  走了就别回头了
    2021-01-14 10:35

    Check out my post here about using services to share data between controllers: http://erikaugust.com/thoughts/angularjs-use-the-service-not-the-controller/?ws=so

    There's a link to a JSFiddle example at the bottom of the blog post that will help.

提交回复
热议问题