How can I update scope in directive?
My directive:
Use $apply method:
element.click(function() { scope.$apply(function(){ scope.text = '2'; }); });
Explanation: How does data binding work in AngularJS?