How to trigger ng-change from jquery?

后端 未结 2 1622
不知归路
不知归路 2020-12-13 19:38

I have a select tag as follows:


and I\'m using a jQueryUI c

2条回答
  •  情歌与酒
    2020-12-13 19:47

    Ugh - this is terrible practice - but you can use angular.element and get the scope from an element that resides within the target controller.

    Example:

    Javascript:

    var scope = angular.element("#test").scope();
    scope.doSomething();
    

    Your scope variable now has access to all the methods defined on the myApp controller.

提交回复
热议问题