AngularJS : Basic $watch not working

后端 未结 3 1513
鱼传尺愫
鱼传尺愫 2020-12-15 06:13

I\'m attempting to set up a watch in AngularJS and I\'m clearly doing something wrong, but I can\'t quite figure it out. The watch is firing on the immediate page load, but

3条回答
  •  心在旅途
    2020-12-15 07:10

    It can also happen because the div is not registered with the controller. Add a controller to your div as follows and your watch should work:

    
    

提交回复
热议问题