Why does ng-click not work in case-1, but does in case-3?

后端 未结 5 2133
误落风尘
误落风尘 2020-12-29 20:16

There is clearly something fundamental im not yet understanding.

Im trying to make user of the Modal module in Angular Ui.Bootstrap but im finding that my clicks are

5条回答
  •  无人及你
    2020-12-29 20:58

    ng-click is meant for use with either a function in the current scope (so for example $scope.alert = window.alert would solve the problem of not being able to alert there) or an angular expression. it looks like angular does not allow you to use global scope methods in there (it might be looking them up in the current $scope, from which they are missing).

提交回复
热议问题