Dynamic Variable name in binding or nested {{}} inside {{}}

4,617 views
Skip to first unread message

josepht...@gmail.com

unread,
Dec 25, 2012, 1:25:12 AM12/25/12
to ang...@googlegroups.com
Hello, 

 I'm looking into having a dynamically generated binding where binding itself is evaluated/calculated beforehand. Something like:

   <li ng-repeat="section in item.sections">
       <p>{{item.{{section}}.description}}</p>
   </li>

 It doesn't work as is. 

 ngBind or ngBindTemplate are not useful. 

 I thought perhaps I can create a function that gets name of the binding variable as a parameter and calls $scope.X

 What's the best way to do this?

Thanks

Peter Bacon Darwin

unread,
Dec 25, 2012, 2:30:37 AM12/25/12
to ang...@googlegroups.com

{{item[section].description}}

... sent from my tablet

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
 
 
Reply all
Reply to author
Forward
0 new messages