Call Angular Function with Jquery

前端 未结 7 1826
遇见更好的自我
遇见更好的自我 2020-12-04 21:59

How to call angular function when data in text box? here is my code

html




        
相关标签:
7条回答
  • 2020-12-04 22:39

    for accessing scope element of the controller

    angular.element(document.getElementById('controllerId')).scope().scope_variable_array.push(item);
    

    for accessing controller function

    angular.element(document.getElementById('controllerId')).scope().function_name();
    

    controllerId : tag id where the ng-controller is defined in HTML

    0 讨论(0)
提交回复
热议问题