我不确定是否是因为我试图在部分内部使用指令,但我无法触发简单的指令元素单击事件。
HTML:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<tabbed-Panel1 class="bottomTabPanel">
TEST CLICK HERE!
</tabbed-Panel1>
</body>
</html>
js:指令
angular.module('directives', ['basemodule'])
.directive('tabbedPanel1',function() {
debugger;
restrict:"E",
return {
link: function(scope, elem, attr) {
elem.bind('click', function() {
//never gets here!
debugger;
});
}
};
});