0
大多数HTML定义,像这样的NG-点击功能:如何仅在js文件中定义ng-click函数?
<span type="button" id='test' ng-click="dosth()"></span>
和定义控制器的功能,很多是这样的:
$scope.dosth = function() {};
,但如果我们没有添加的功能在HTML中,我们就可以在js文件中定义一个jQuery点击功能,如:
<span type="button" id='test'></span>
$('#test').click(function() { do sth ... });
所以我们可以定义一个角度NG单击functioin只在一个js文件?
请参见本教程https://docs.angularjs.org/tutorial/step_10 – Vadim 2014-11-24 15:47:45
,看到这个答案的http://计算器。 COM /问题/ 14994391 /思维功能于angularjs-IF-I-有-A-jQuery的背景/ 15012542#15012542 – 2014-11-24 15:50:41
@Vadim对不起,我不能访问次数的网站。你能解释一下吗? – 2014-11-24 15:57:44