$watch not working on variable from other controller?

前端 未结 3 505
鱼传尺愫
鱼传尺愫 2021-01-14 16:20

I have one controller which displays a checklist, and stores the selection in an array.

My other controller runs an $http.get on the array from the firs

3条回答
  •  我在风中等你
    2021-01-14 16:58

    In such cases, I recommend using a service for data manipulation and messages to keep the controllers and UI in sync.

    Take a look here: AngularJS multiple uses of Controller and rootScope

提交回复
热议问题