Angularjs: 'controller as syntax' and $watch

前端 未结 10 1590
抹茶落季
抹茶落季 2020-11-28 18:52

How to subscribe on property change when using controller as syntax?

controller(\'TestCtrl\', function ($         


        
10条回答
  •  清歌不尽
    2020-11-28 19:45

    You can use $onChanges angular component lifecycle.

    see documentation here: https://docs.angularjs.org/guide/component under Component-based application section

提交回复
热议问题