Created
August 19, 2018 14:47
-
-
Save RayLuxembourg/b227c3a85be88ee5173ae7eca871362a to your computer and use it in GitHub Desktop.
product component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class ProductComponent implements OnInit { | |
product$: Observable<Product>; | |
constructor(private api: ApiService,private route:ActivatedRoute) {} | |
ngOnInit() { | |
const id = this.route.snapshop.params['id']; | |
this.product$ = this.api.product(id); | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment