I have created a directive, which has an isolated-scope:
.directive('title',function(){
return {
restrict:'E',
scope:{
text:'@'
},
replace:true,
template:'<div>{{text}}</div>',
link:function(scope,iElement,iAttrs){
}
};
})
When I am trying to change "text" attribute by .attr method, the binding does not work. I have tried to use $apply method, but without any success.
What is wrong?
PS: Pls, do not suggest any solution with using controller and binding the text attribute to $scope's properties(something like a <title text="{{somepropertyincontrollersscope}}">...). My problem is only related to changing the attribute externally.