2017-09-19 11 views
0

사용자 정의 섹션을 만들고 컨트롤러 중 하나에서 propertyeditor 객체의 Arrary를 성공적으로 작성했습니다. 내보기에서움 브라 코 7 - 구문 도움말 - JS 또는 각도? - Umbraco Property Editor를 통한 루프

<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> 

작동하지만 내가 정말로 원하는 것은 통해 볼입니다, 지금은 내가 JS 루프입니다이 작업을 수행 할 수있는 방법을 알고,하지만 난이 있어야 확실 해요 그것을하는 각진 방법, 나는 여전히 앵글과 그립에 와서 그래서 내 niavity을 용서하십시오.

답변

1

Angularjs에서 ng-repeat을 사용하여 배열을 반복 할 수 있습니다. 예를 들어 : https://docs.angularjs.org/api/ng/directive/ngRepeat

: 자세한 내용은

<umb-property ng-repeat="editor in vm.propertEditors" property="editor" ng-if="!vm.isNew"> 
    <umb-editor model="editor"></umb-editor> 
</umb-property> 

, 당신은 여기에 NG-반복 설명서를 찾을 수 있습니다