无需导入OnInit和实现
ngOnInit(){
this.recipies=this.recipeService.getRecipies();
}
Run Code Online (Sandbox Code Playgroud)
这仍然工作正常没有任何抱怨所以我为什么要使用像:
import { Component,EventEmitter,Output , OnInit } from '@angular/core';
export class RecipiesListComponent implements OnInit{}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2536 次 |
| 最近记录: |