Angular Build 4 Error: Error Detecting Static Character Values

I am updating Angular CLI (v1.0.0), Angular (v4.0.2) and related packages in a previously running ng2 application to add a newer version of Angular Material. After dealing with several other errors due to breaking changes, I stayed with this on the assembly:

Error in error. You can only refer to initialized variables and constants, because the value of this variable is required by the template compiler (position 15:22 in the source .ts file)

allowing the symbol ROUTES in / path / node_modules/@angular/router/src/router_config_loader.d.ts,

allowing makeRootProviders symbol / path / node_modules / ui-router -ng2 / lib / uiRouterNgModule.d.ts,

allowing symbol UIRouterModule.forRoot in / path / node_modules / ui -router-ng2 / lib / uiRouterNgModule.d.ts,

allowing the symbol AppModule in /path/src/app/app.module.ts,

allowing the AppModule character in / path / csi / app / app.module.ts

. /src/main.ts : : './$$_gendir/app/app.module.ngfactory' '/path/src'  @./src/main.ts 5: 0-74  @multi./src/main.ts

, UIRouter ( app.module.ts), :

imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    MaterialModule.forRoot(),
    FlexLayoutModule,
    UIRouterModule.forRoot({
        states: [
            homeState,
            buttonsState,
            colorState,
            fontsState,
            iconsState,
            logosState,
            messagingState,
            typographyState
        ],
        useHash: false
    })
],

, , ​​ . , UIRouterModule, . .

+4
1

, . , ROUTES .ts, :

import { ROUTES } from '@angular/router/src/router_config_loader';

@angular/router not '@angular/router/src/router_config_loader'. , IDE , .

, SO-.

0

Source: https://habr.com/ru/post/1674982/


All Articles