I'm very new to AngularJS and have some basic skills with html, css, etc.
But I can't seem to figure out how to achieve the below.
I'm trying to use ng-repeat to loop through and then show the information
in 3 columns. I'm semi there, but now I can't figure out how to reference
correctly the items information inside the ng-init statement.
This is where I am currently,
[code]
<div ng-repeat="item in itemsInGroup('Lights') track by $index"
ng-if="$index % 3 == 0" class="row">
<div class="col-xs-4">
<table style="width: 100%;">
<tr>
<td style="padding: 0px; padding-top: 10px;">
<div ng-init='model[$index]={"FF_Light_KitchenEating": "Kitchen",
"item": "FF_Light_KitchenEating", "hidelabel": true, "hideonoff": true,
"iconset": "smarthome-set","icon": "bulb","icon_size": "62" }'>
<widget-switch ng-model="model[$index]" />
</div>
</td>
</tr>
<tr>
<td style="line-height: .1em; padding-top: 20px; padding-bottom:
10px;">{{itemsInGroup('Lights')[$index].label}}</td>
</tr>
</table>
</div>
<div class="col-xs-4">{{itemsInGroup('Lights')[$index+1].label}}</div>
<div class="col-xs-4">{{itemsInGroup('Lights')[$index+2].label}}</div>
</div>
[code]
I just can't figure out how to add the variable information to the ng-int,
something like this replacing "Kitchen" with the variable.
[code]
<div ng-init='model[$index]={"FF_Light_KitchenEating":
[{{itemsInGroup('Lights')[$index].label}}], "item":
"FF_Light_KitchenEating", "hidelabel": true, "hideonoff": true, "iconset":
"smarthome-set","icon": "bulb","icon_size": "62" }'>
[/code]
Thanks
PT
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.