Hi,
What I want to do is something like this (c#):
string CurrentWidget;
foreach (var widget in widgets)
{
CurrentWidget = widget;
}
So, CurrentWidget is outside of loop, and I like to do *CurrentWidget* =
*widget* where widget is current element.
DataBinding ==> *widget* and *CurrentWidget*
Mrs LEYE Gora
Tocane Technologies
7, avenue des ursulines 78300 POISSY
512 987 777 R.C.S. VERSAILLES
TEL : 06 98 33 33 85
Site Web :
http:// <http://logcorner-news.azurewebsites.net/>www.masterconduite.com
http://logcorner-news.azurewebsites.net/
Blog : http://logcorner.wordpress.com
2015-11-20 11:49 GMT+01:00 Sander Elias <[email protected]>:
> Hi Olivier,
>
> Switch to controllerAs syntax and do try something like:
>
> <div data-ng-controller="WidgetCtrl as wdgt">
> <ul>
> <li data-ng-repeat="widget in widgets" ng-click='wdgt.active =
> widget>
> ID {{widget.ID}}: {{widget.Color}} {{widget.Shape}}
> </li>
> </ul>
>
> <div>Current Widget = <span ng-bind="{{wdgt.active.ID}}"></span></div>
>
> </div>
>
>
>
> Hope this helps a bit ;)
>
> regards
>
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/Rkc0tXZhpWk/unsubscribe.
> To unsubscribe from this group and all its topics, 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.