0
자산이있는 응용 프로그램을 구축 중이며 이러한 자산 각각에는 많은 메모가 있습니다. 이제 내 응용 프로그램에서 내 자산을 반복 오전 내 메모를 반복 오전. like so내부 요소의 ng-repeat
<div class="asset-image-container" ng-repeat="asset in assets" data-asset-key="{{ asset.key }}">
<img class="asset-page" src="{{asset.large_asset_path}}"/>
<div ng-repeat="note in asset.notes" class="note-pin" data-note-index="{{ note.index }}" data-asset-key="{{ asset.key }}" style="left: {{ note.x }}%; top: {{ note.y }}%;">
<span class="note-index">{{ note.index }}</span>
<img src="/img/note.png">
</div>
이 동일한 페이지에서 자산없이 목록에 모든 메모를 표시하고 싶습니다. 그래서 2 ng-repeats 필요하지만 첫 번째 html 요소없이 있어야합니다. 어떤 생각이든 내가 이걸 관리 할 수 있을까?
업데이트 :
[
{
"id":69,
"upload_id":16,
"name":"preview-1",
"key":"l476IU94c9YhyvUByZnnr162bbO3uKs3bcWVXSpG",
"created_at":"2014-11-25 20:41:30",
"updated_at":"2014-11-25 20:41:30",
"deleted_at":null,
"large_asset_path":"\/uploads\/vtbwCn1ISkRYCewaYtQE9qwDdXmpWcUohlcQAnzc\/large\/preview-1.jpg",
"small_asset_path":"\/uploads\/vtbwCn1ISkRYCewaYtQE9qwDdXmpWcUohlcQAnzc\/small\/preview-1.jpg",
"notes":[
{
"id":13,
"index":13,
"key":"oidSFwkyYhPmA9TK0XCLU4Jg52nJHA2E9CIv59Lw",
"upload_id":16,
"asset_id":69,
"from_id":1,
"message":"\n ",
"created_at":"2014-12-07 08:46:58",
"updated_at":"2014-12-07 08:47:52",
"deleted_at":null,
"x":"71.67796920821115",
"y":"8.503401360544217",
"parameters":[
{
"id":25,
"note_id":13,
"name":"x",
"value":"71.67796920821115",
"created_at":"2014-12-07 08:46:58",
"updated_at":"2014-12-07 08:47:51",
"deleted_at":null
},
{
"id":26,
"note_id":13,
"name":"y",
"value":"8.503401360544217",
"created_at":"2014-12-07 08:46:58",
"updated_at":"2014-12-07 08:46:58",
"deleted_at":null
}
]
},
{
"id":63,
"index":50,
"key":"CRZGM6XbRJzgWyq4Vmt1BUuRnOlBCnNQs4lHGRu8",
"upload_id":16,
"asset_id":69,
"from_id":1,
"message":null,
"created_at":"2014-12-07 08:49:21",
"updated_at":"2014-12-07 08:49:21",
"deleted_at":null,
"x":"0",
"y":"0",
"parameters":[
{
"id":125,
"note_id":63,
"name":"x",
"value":"0",
"created_at":"2014-12-07 08:49:21",
"updated_at":"2014-12-07 08:49:21",
"deleted_at":null
},
{
"id":126,
"note_id":63,
"name":"y",
"value":"0",
"created_at":"2014-12-07 08:49:21",
"updated_at":"2014-12-07 08:49:21",
"deleted_at":null
}
]
}
],
"upload":{
"id":16,
"key":"vtbwCn1ISkRYCewaYtQE9qwDdXmpWcUohlcQAnzc",
"name":"annots.pdf",
"type":"application\/pdf",
"size":393314,
"status_id":1,
"created_at":"2014-11-25 20:41:29",
"updated_at":"2014-11-25 20:41:29",
"deleted_at":null
}
},
...
]
데이터 모델을 수정하여 메모 목록을 만들고 애셋과 메모가 아닌 메모에서만 반복하는 것이 어떻겠습니까? – Phill
이 질문에 답하기가 훨씬 쉬워 지므로 모델을 게시 할 수 있습니까? –