0
store.select(「書籍」)是可觀察到的,並且在下面代碼打印無法觀察到的循環
{ "books": [ { "id": 1, "title": "title here1", "description": "desc here1", "author": "test", "price": 99 }, { "id": 2, "title": "title here2", "description": "desc here2", "author": "test", "price": 99 } ] }
查閱「STEP 1」,我想通過書籍陣列循環,爲此,我寫了「STEP 2」,但它沒有打印任何東西。 需要修改哪些內容才能使* ngFor工作?
<!-- STEP 1 -->
{{store.select('books') | async | json}}
<!-- STEP 2 -->
<ul>
<li *ngFor="let book of store.select('books').books | async">
{{book.title}} {{book.price}}
</li>
</ul>
試試這個:'讓書(store.select('books')| async)?.書籍' –
是的,它已經工作.. – refactor