If I have a component with a property of:
import { Component, OnInit } from 'angular2/core';
import { CarService } from 'someservice';
@Component({
selector: 'car-detail',
templateUrl: './app/cars/car.component.html'
})
export class CarComponent implements OnInit {
model: Observable<Car>;
constructor(
private _carService: CarService
) { }
ngOnInit() {
// begin benefit setup
this.model = this._carService.get(5);
}
}
for instance, and I want to in my view use an async pipe to subscribe to that and use the properties as text, how can you actually subscribe to it? For instance:
<template #mycar = "model | async" >
<p>{{ myCar?.make }}</p>
</template>
I am new to Angular2 and not sure if I am doing something wrong or not.