In Angular 1.2, I have a child directive and a parent directive (with an isolate scope) to make a generic popup who takes directive in parameter and include it.
In my child directive i have to update the title of my parent directive, the value is updated in my console, but it is not updated in my UI.
Behavior:
1 - I set attributs of my directive declaration like : `
2 - I open my custom-box for audio devices by click on button -> the title equals A
3 - I have 3 tab in my audio-popup directive, so i click on 3rd tab, and i try to change the title of my custom-box -> FAIL
I ve tryed differents solutions but i can't find, i precise i can't use rootScope in this case.
//childDirective
$scope.setTabTo = function (to) {
$scope.tab = to;
if ($scope.tab == "already") {
$scope.$parent.continueClose = false; //in console = false
$scope.$apply(function () { $scope.$parent.title = "New Title" });
}
//...
};
I 've read this : How to access parent scope from within a custom directive *with own scope* in AngularJS? but I have an error if i try $scope.$parent.$apply directly, have miss something to apply the scope ... And this post Directive updates parent scope value doesn't works for me.
I have tryed to watch the title value in my parent directive but doesn't work to...