0
我不想打開我的網頁上超過3個聊天窗口。雖然我能夠部分地管理的是,我想現在實現的是
再次顯示USER按鍵如有聊天窗口關閉(所以,如果他關閉所有用戶可以再次打開聊天窗口其中之一)
Here is the working plunker。我採取的雙向綁定
我處理,在此鏈接功能的護理:
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();
}
});
}
我看不到雙向綁定,但我*做*看到兩個指令之間的隔離範圍。 – Makoto
@Makoto:我在隔離範圍內保留了'count:'='' –
是的,因此爲什麼我沒有看到兩者之間的任何雙向綁定。它們被有效隔斷。 – Makoto