0
在指令中,单击jQuery元素时,我正在更新范围。但它不起作用。什么是正确的方法来做到这一点?angular-directive - jQuery单击事件不更新范围
angular.module('app.directives', []).directive('newContent', function() {
return {
link: function(scope, element, attrs) {
var title = element.find('h1'); //getting the element
scope.show = true;
var that = scope;
title.on('click', function(){
scope.show = false; //not working
})
}
}
})