自定义指令compile在使用时,要如何在postLink中绑定事件呢?
compile:function(tElement,tAttrs,transclude){
return {
post:function postLink(scope,iEle,iAttrs,controller){
iEle.on('click',function(){
alert(1);
}
}
}
在运行时,弹出: iEle.on is not a function,这个错误是什么原因造成的呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...