在core.module.ts
内定义 host
import { NgModule, Optional, SkipSelf } from '@angular/core';
import { throwIfAlreadyLoaded } from './module-import-guard';
@NgModule({
providers: [
{
provide: 'host',
useValue: 'http://localhost/'
}
]
})
export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
throwIfAlreadyLoaded(parentModule, 'CoreModule');
}
}
在routes/passport/login/login.component.ts内如何使用?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…