Hello Folks : I have two directive , the second one is included in the template of the first one with two way binding
app.directive('A', function() {
return {
template : '{{ value}} <B model="value'><B>
link : function( scope) {
scope.value = null;
scope.$watch('value', function(newValue) {
console.log( newValue )
});
}
}
}
And directive B where i do some action changing value
app.directive('B', function() {
return {
template : 'etc ...'
scope : {
model : '='
},
link : function(scope) {
// here i do some action changing
scope.model = { bla bla bla }
}
}
}
When I do my action changing scope.model in B, the {{ value }} is updated in the template, but scope.value is not updated in the link no console log of new Value ... I can trigger event in B which might be called in A link, but I would like the scope.value to change in a link, do you have any elegant solutions?