What are you actually trying to do? This kind of violates a scoping separation issue- what if wi has different values based on different states of each of the instantiated ng-repeat items?
It seems like, if you want to do something with higher-level values propagating up and down, the best thing to do is the standard one: create a service object to store your value, inject it in both the give-wi and higher scope, and use that to store the value. I'm still not sure I grok what you're trying to accomplish, but that would do it. e On Wed Dec 17 2014 at 11:38:59 AM trzczy <[email protected]> wrote: > plunker <http://plnkr.co/edit/Sxq0uQ4vAZhEVDxbudoE?p=preview> > > <!DOCTYPE html> > <html> > <body> > <div ng-app="app" ng-controller="test"> > <i ng-repeat = "abc in [1,2,3]" give-w>abc<br></i> > <br>{{ wi }} > </div> > <script src="https://code.angularjs.org/1.3.6/angular.js"></script> > <script> > console.clear(); > app = angular.module('app', []); > app.controller('test', function($scope) { > }); > var directives = {}; > directives.giveW = [ > function() { > return { > link: function(scope, element, attrs) { > scope.wi = 5; > } > } > } > ]; > app.directive(directives); > </script> > </body> > </html> > > The value of *wi* is present the child scope of *ng-repeat*. How to > propagate it to its parent scope so it would be present in the main scope > and in html view? When ng-repeat is removed the *wi* value of 5 is > actually present in html view but *ng-repeat* must remain. > > How to do that? Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
