環境: のWindows 10、IntelliJの2016.2、ノードAOTコンパイルが失敗します。 Angular2 RC6 - 関数呼び出しはサポートされていません - RouterModule.forChild(ROUTES)
角度バージョン: 2.0.0-rc.6
言語: [すべて|タイプスクリプトX.X | ES6/7 | ES5] 活字体ES6
(IBMアカデミーの問題のために)ノード:関数呼び出しに文句
node --version
=
ノード4.4.7、NPM 3.10.6
は、AOTコンパイラが失敗した場合、またはラムバ参照。唯一のものはRouterModule.forChild(ROUTES)ですが、以前はこの参照でコンパイルできました。私は、どのようにインポートされたコンポーネントなしでアプリが動作することができないか分かりません。
// /**
// * Angular 2 decorators and services
// */
// // import { BrowserModule } from '@angular/platform-browser'
//
import { CommonModule } from '@angular/common';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
//
import { ROUTES } from './detail.routes';
/*
* Shared Utilities & Other Services
*/
import { Logging } from '../services/utility.service';
/**
* Imported Components
*/
import { DetailComponent } from './detail.component';
@NgModule({
declarations: [// Components/Directives/ Pipes
DetailComponent],
imports: [CommonModule, BrowserModule, FormsModule, RouterModule.forChild(ROUTES),]
})
export class DetailModule {
constructor() {
if (Logging.isEnabled.light) { console.log('%c Hello \"Detail\" component!', Logging.normal.lime); }
}
}
誤りがある
Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol DetailModule in C:/Source/POC/Microservice.Poc/src/app-components/+detail/index.ts, resolving symbol DetailModule in C:/Source/POC/Microservice.Poc/src/app-components/+detail/index.ts
at simplifyInContext (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\static_reflector.js:473:23)
at StaticReflector.simplify (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\static_reflector.js:476:22)
at StaticReflector.annotations (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\static_reflector.js:61:36)
at _loop_1 (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\codegen.js:53:54)
at CodeGenerator.readFileMetadata (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\codegen.js:66:13)
at C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\codegen.js:100:74
at Array.map (native)
at CodeGenerator.codegen (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\codegen.js:100:35)
at codegen (C:\Source\POC\Microservice.Poc\node_modules\@angular\compiler-cli\src\main.js:7:81)
at Object.main (C:\Source\POC\Microservice.Poc\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
Compilation failed
なぜRouterModule.forChild(ROUTES)
は、AOTコンパイルが失敗作っているとき、それはAOTコンパイルと正常に動作しますhere at this repoオーバー?