Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. find() {
  2. return this._http.get('api/items')
  3. .map((res:Response) => res.json())
  4. .publishReplay(1)
  5. .refCount();
  6. }
  7.  
  8. ngOnInit() {
  9. this.itemService.find().subscribe((data) => {
  10. this.gridOptions.rowData = data;
  11. this.loaded = true;
  12. });
  13. }
  14.  
  15. ngOnInit() {
  16. let find = this.byType ? this.itemService.findByType : this.itemService.find;
  17. find(this.filter).subscribe((data) => {
  18. this.gridOptions.rowData = data;
  19. this.loaded = true;
  20. });
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement