Reputation: 573
I read a lot of articles and AngularJS documentation but I could not find any way to propagate my directive scopes modification to my modal controller.
Here is easier version of the context :
I am able to retrieve the model from the modal controller, change it within my directive but when it comes to update parent scope, I always get the default model value.
I tried to used both inherited or isolated scope but I can't see what I am missing. Should anyone help me on this ?
Here is a very detailed planker : http://plnkr.co/edit/t3ecXakeJMlttQkj9GLM?p=preview
To reproduce the problem :
Thanks for your help
t00f
Upvotes: 1
Views: 1571
Reputation: 137
you should pass a "sub.model" to your model scope here is a working plunkr http://plnkr.co/edit/vXmgbVdYGrxbxYTIZVUU?p=preview
you'll see in the modal controller that instead of use $scope.model = 'AAA' directly as a string i used $scope.model = {data : 'AAA'} and I directly pass model.data into my-directive in modal.html
you'll get more explanation in this answer
Hope it'll help you
Upvotes: 4