File

src/app/checkout/cart/components/line-item-list/line-item-list.component.ts

Implements

OnInit

Metadata

selector app-line-item-list
styleUrls line-item-list.component.scss
templateUrl ./line-item-list.component.html

Constructor

constructor(store: Store, actions: CheckoutActions)

Methods

ngOnInit
ngOnInit()
Returns: void

Properties

lineItems$
lineItems$: Observable<LineItem[]>
import { getLineItems } from './../../../reducers/selectors';
import { CheckoutActions } from './../../../actions/checkout.actions';
import { AppState } from './../../../../interfaces';
import { Store } from '@ngrx/store';
import { LineItem } from './../../../../core/models/line_item';
import { Observable } from 'rxjs/Observable';
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-line-item-list',
  templateUrl: './line-item-list.component.html',
  styleUrls: ['./line-item-list.component.scss']
})
export class LineItemListComponent implements OnInit {

  lineItems$: Observable<LineItem[]>;

  constructor(private store: Store<AppState>, private actions: CheckoutActions) {
    this.lineItems$ = this.store.select(getLineItems);
   }

  ngOnInit() {
  }

}
<div *ngFor="let item of lineItems$ | async">
  <app-line-item [lineItem]="item"></app-line-item>
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""