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
})
}
}
})