Hi I have some nested menu where I am trying to change the color of a child scope from parent but its not working. Here is the simplified code.
.directive('botMenuClick', function() {
return {
link: function(scope,ele,attrs){
ele.bind('click', function(){
if(ele.attr('homeBtn')==='true'){
scope.$parent.setDisplay = {'color': '#fff'} // this applies to all children but not the one which is set in else condition
}else{
scope.setDisplay = {'color': 'green'}
}
scope.$apply();
});
}
}
})
So, once I get in to the else condition and that menu color is changed to green then no matter what it won't change to white even if I go in the above homeBtn condition.