getEmployee()
是我的服务页面中的一种方法,现在我希望使用HTML模板在我的组件中没有订阅showEmployee()
方法的员工列表。 showEmployee(){
this.employeeModel= this._empService.getEmployee();
}
getEmployee()是我的服务页面中的一种方法,现在我希望使用HTML模板在我的组件中不使用subscribe showEmployee()方法的雇员列表。 showEmployee(){this.employeeModel = ...
so u need the pipe in html
<p *ngFor="let data as employeeModel | async">
<span> {{data.empName}}</span>
</p>
employeeModel : Observable<any>