使用ng-repeat时,Javascript无效

时间:2015-04-23 05:10:01

标签: javascript angularjs

我是AngularJs的新手并在网站上工作。 我正在从页面中的Rest服务中检索数据,我能够使用ng-repeat显示数据。但问题是我在页面中有一个正常的javascript功能元素。当我包含angularjs(ng-repeat)时,它无法正常工作。建议我继续努力。

1 个答案:

答案 0 :(得分:0)

Well nowhere up above do we see anything about ng-repeat, however I can tell you its probably got to do with the fact that you're binding your click event on dom ready, and then angular is changing your elements which nullifies the click listener. If you're using ng-repeat, you should be using ng-click as the handler for those events within your controller. Angular takes care of binding the handler specified using ng-click at the proper time when the element exists in the dom. jQuery really has no place in this if you are trying to use angular.