在Angular CLI中生成服务时,它将为Injectable装饰器添加带有“提供的”属性且默认值为“ root”的额外元数据。 @Injectable({ providedIn: 'root', }).
確定! 回上一頁