$watch not being triggered on array change

后端 未结 4 1784
北荒
北荒 2020-12-08 00:29

I\'m trying to figure out why my $watch isn\'t being triggered. This is a snippet from the relevant controller:

$scope.$watch(\'tasks\', functi         


        
4条回答
  •  离开以前
    2020-12-08 01:16

    I would recommend trying

    $scope.$watch('tasks | json', ...)
    

    That will catch all changes to the tasks array, as it compares the serialized array as a string.

提交回复
热议问题