Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. @Component({
  2. selector: 'product-profile',
  3. templateUrl: './product-profile.component.html',
  4. styleUrls: ['./product-profile.component.scss']
  5. })
  6. export class ProductProfileComponent {
  7. // I have ommitted so much code here....
  8. product: Observable<Product>;
  9.  
  10. constructor(
  11. private store: Store<any>
  12. ) {
  13.  
  14. this.product = this.store
  15. .let(getProductStore)
  16. .let(getProductProfile);
  17.  
  18. this.product
  19. .select((product: Product) => product && product.id)
  20. .subscribe(productId => this.productId = productId
  21. });
  22. }
  23.  
  24. // I have omitted so much code here....
  25. }
  26.  
  27. @Component({
  28. selector: 'product-footer',
  29. templateUrl: './product-footer.component.html',
  30. styleUrls: ['./product-footer.component.scss']
  31. })
  32. export class ProductFooterComponent {
  33.  
  34. // this is the same Observable / property from the parent
  35. // when there is a change in the parent I want to update the property below...
  36. product: Observable<Product>;
  37.  
  38. constructor(){}
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement