Scenario:
I do not want to open more than 3 chat windows on my page. Although I am able to manage that partially, what I want to achieve now is
to show USER buttons again if any chat window is closed (so that the user can again open a chat window if he closes any one of three)
Here is the working plunker . I have taken care of two-way binding
I am handling that in this link function:
link: function(scope, element, attr) {
scope.close = function (){
element.hide();
alert('scope.count not reducing the actual count on index.html')
scope.count--; // <-- THIS IS NOT DECRESING THE COUNT on main index.html
}
scope.$watch('box2', function(newIsOpenVal, oldIsOpenVal){
if(newIsOpenVal !== oldIsOpenVal){
element.find("#msg").toggle();
}
});
}
count: '='
in isolated scopes