我从我的角度应用程序建立一个PWA和我收到以下错误,当我运行ng build --prod
:
ERROR in app\app.module.ts(108,64): Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'Environment' was called in 'environment'
'environment' calls 'Environment'.
然而,这没有任何意义,因为我说export
来,你可以看到这里的类:
environment.prod.ts
import { BaseEnvironment } from './base-environment';
import { ProspectBuilderModel } from '../app/models/prospect';
export class Environment extends BaseEnvironment {
production: boolean = true;
prospectBuilderModel: ProspectBuilderModel = {
buildQuote: false,
buildAcknowledge: false,
buildOrganizationInfo: false,
buildFinancialInfo: false,
buildTradeInfo: false,
buildPermissiblePurpose: false,
buildUserSetup: false,
buildPackageSelection: false,
buildPaymentOptions: false,
buildOrderOptions: false,
buildVerifyOrganizationInfo: false,
buildDocusignAuthorization: false,
buildDocusignContract: false
};
}
export const environment = new Environment();
基environment.ts
import { ProspectBuilderModel } from '../app/models/prospect';
export abstract class BaseEnvironment {
abstract production: boolean;
abstract prospectBuilderModel: ProspectBuilderModel;
}
app.module.ts
...
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
MultiselectDropdownModule,
ReactiveFormsModule,
HttpModule,
ToastrModule.forRoot(),
BrowserAnimationsModule,
NgxMyDatePickerModule.forRoot(),
PopoverModule.forRoot(),
ModalModule.forRoot(),
ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
],
providers: [
...
有谁知道我能做些什么来解决这个问题?