javascript - Angularjs appending templates to each other -
how append code existing <div ng-view>
container.
like have template following code:
<p>{{date}}</p> <div ng-repeat='i in items'> <span>{{i.created}}</span> <span>{{i.order}}</span> <span>{{i.customer}}</span> </div>
then ajax loading next date items , on..so how make templates append in end, not replace each other , like:
2013-05-03 created order customer created order customer created order customer 2013-05-04 created order customer 2013-05-05 created order customer created order customer
and on.. ?
thank in advance.
you need create parent ng-repeat
follows:
<div ng-repeat="entry in invoices"> <p>{{entry.date}}</p> <div ng-repeat='i in entry.items'> <span>{{i.created}}</span> <span>{{i.order}}</span> <span>{{i.customer}}</span> </div> </div>
thus, when server loading next date items, add same invoices array.
Comments
Post a Comment