okay, i realized the conzept of angular2! thx for attention...
Am Montag, 18. April 2016 18:24:50 UTC+2 schrieb Volker:
>
> hey ho, i think i havnt understand the complete angular2 construct, but my
> problem is:
>
> i want to create a simple angular2 app. based on some configs, there
> should create some list containers, in any list container are some items.
> so, my problem is, if i create a new list container (aka component):
>
> c = new FlowList();
> c.addItem(new FlowListItem('foo'));
> c.addItem(new FlowListItem('bar'));
>
> there will be add some items into a internal array of "FlowList".
>
> @Component({
> selector: 'flow-list',
> directives: [FlowListItemRenderer],
> template: `
> <div class="flow-list">
> <div class="elements">
> <div class="element" *ngFor="#item of items">
> <h2>Item</h2>
> <flow-list-item-renderer
> [_item]="item"></flow-list-item-renderer>
> </div>
> </div>
> </div>
> `
> })
> export class FlowList {
>
> protected _storage:FlowListItem[] = [];
>
> public addItem(item:FlowListItem) {
> this._storage.push(item);
> return this;
> }
>
>
> get items():FlowListItem[] {
> return this._storage;
>
> }
>
> }
>
>
> on adding point, there are all new items available. but on rendering, the
> getter "items" return an empty array??? this is what i doesnt understand???
>
>
> on the other side, if i create an storage service and inject it to my
> ListCmp, all works as expected... but that isnt a option for me, in the end,
> there should it possible to push items between all the lists. every list has
> its own logic on receiving or pushing elemnts too (REST callbacks, different
> item renderer components and so on...).
>
>
> how can handle this? i think this is more a "best practise" question...
>
>
> thx for any response!
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.