In the directive, On click of jQuery element, i am updating the scope. But it's not working. what is the correct way to do this?
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
})
}
}
})