2017-02-22 6 views
0

私は@ angular/cliで構築されたプロジェクトと、ng2-toolsと呼ばれるサードパーティのライブラリ を持っています。私はこのライブラリをインストールし、@angular CLIを使用して それを実行すると、私はサードパーティ製のライブラリを統合した角型cli

ERROR in Ng2ToolsModule is not an NgModule 

しかし、私は一つのモジュールを消去し、エラーが消えて applicatinが正常に動作、それを再度追加する場合は、このエラーが発生します。私ができないことは、同じエラーのためにアプリケーションを構築することです。 ここではng2-tools ライブラリのリンクです、マスターブランチは公開されたコードを持っていますthisは、 ang/cliでビルドされたアプリケーションのソースコードです。このエラーが発生しないように、npm の詳細を公開する必要がありますか?アンサンブル2のライブラリはどのようにバンドルされていますか?私はライブラリを構築するために gulpを使用しているので、別々にコンパイルされた各ファイルを取得できます。 これはapp.module

import { MaterialModule } from '@angular/material'; 
import { CommonModule } from '@angular/common'; 
import { BrowserModule } from '@angular/platform-browser'; 
import { NgModule } from '@angular/core'; 
import { FormsModule } from '@angular/forms'; 
import { HttpModule } from '@angular/http'; 
import { RouterModule } from '@angular/router'; 
import { Ng2TableModule } from 'ng2-table/ng2-table'; 

import { Ng2ToolsModule } from 'ng2-tools/module'; 

import { APP_ROUTES } from './app.routes'; 
import { APP_COMPONENTS } from './app-components'; 
import { AppComponent } from './app.component'; 

@NgModule({ 
    declarations: [ 
     AppComponent, 
     ...APP_COMPONENTS 
    ], 
    imports: [ 
     Ng2TableModule, 
     CommonModule, 
     FormsModule, 
     BrowserModule, 
     MaterialModule, 
     HttpModule, 
     Ng2ToolsModule, 
     RouterModule.forRoot(APP_ROUTES) 
    ], 
    bootstrap: [AppComponent] 
}) 
export class AppModule { 
} 

からソースコードであり、この問題は私のビルドシステムがにバンドルを構築していないということですNg2ToolsModule

import { NgModule } from "@angular/core"; 

import { AutocompleteModule, GenericFormModule } from './components/index'; 
import { DirectivesModule } from "./directives/directives.module"; 
import { CORE_SERVICES } from "./services/index"; 

@NgModule({ 
    imports: [AutocompleteModule, GenericFormModule, DirectivesModule], 
    exports: [AutocompleteModule, GenericFormModule, DirectivesModule], 
    providers: [CORE_SERVICES] 
}) 
export class Ng2ToolsModule { 
} 
+0

あなたは、Appモジュールからソースコードを投稿することができますか? –

+0

はい私は質問 – Nicu

+0

を更新しました.Ng2ToolsModuleはあなたのモジュールですよね? –

答えて

0

のコードですaotと互換性があります。@ ngrx/storeのビルド設定を使用して、npmとangular> = 2のライブラリをビルドすることができます。別のリポジトリに移動した後にフォームコンポーネントを作成しています。リポジトリ。

ここに私のライブラリがあります。 library built using ngrx/store config

0

問題は私のビルドシステムがバンドルをビルドして互換性がなくなっていて、npmと角度> = 2のビルドを@ ngrx/storeのビルド設定を使ってビルドすることですそれを別のリポジトリに移動した後のフォームコンポーネントは、リポジトリへのリンクを投稿します。

ここに私のライブラリがあります。

library built using ngrx/store build config

関連する問題