Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Guys,
This is potentially more of a stack over flow type question rather than a specfic Umbraco Question, so appoligies if it doesn't quite fit here.
I'm creating a custom section and in one of my controllers I am sucessfully creating an Arrary of propertyeditor objects.
In my view this is working
<umb-property property="vm.propertEditors[0]" ng-if="!vm.isNew"> <umb-editor model="vm.propertEditors[0]"></umb-editor> </umb-property> <umb-property property="vm.propertEditors[1]" ng-if="!vm.isNew"> <umb-editor model="vm.propertEditors[1]"></umb-editor> </umb-property> <umb-property property="vm.propertEditors[2]" ng-if="!vm.isNew"> <umb-editor model="vm.propertEditors[2]"></umb-editor> </umb-property>
But What I really want to do is look through, now I know how I can do this is JS for loop, but I'm pretty sure there must be a angular way of doing it, I'm still getting to grips with Angular so please forgive my niavity.
Thanks in Advance.
Found the answer on stack overflow - For anyone else starting out on Angular...
In Angularjs, you can loop through an array using ng-repeat. For example:
<umb-property ng-repeat="editor in vm.propertEditors" property="editor" ng-if="!vm.isNew"> <umb-editor model="editor"></umb-editor> </umb-property>
For more information, you can find the ng-repeat documentation here: https://docs.angularjs.org/api/ng/directive/ngRepeat
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Syntax Help - JS or Angular - Loop through Property Editors.
Hi Guys,
This is potentially more of a stack over flow type question rather than a specfic Umbraco Question, so appoligies if it doesn't quite fit here.
I'm creating a custom section and in one of my controllers I am sucessfully creating an Arrary of propertyeditor objects.
In my view this is working
But What I really want to do is look through, now I know how I can do this is JS for loop, but I'm pretty sure there must be a angular way of doing it, I'm still getting to grips with Angular so please forgive my niavity.
Thanks in Advance.
Found the answer on stack overflow - For anyone else starting out on Angular...
In Angularjs, you can loop through an array using ng-repeat. For example:
For more information, you can find the ng-repeat documentation here: https://docs.angularjs.org/api/ng/directive/ngRepeat
is working on a reply...