2017-01-23 36 views
0

我正在爲我的API結果添加分頁。爲此,我安裝了「Ng2-pagination」,形成這個網址「https://www.npmjs.com/package/ng2-paginate」, 但是,每當我點擊npm start,它給我以下錯誤。angular2分頁錯誤,沒有導出成員'PaginationControlsCmp'

app/blog.component.ts(6,23): error TS2305: Module '"/var/www/html/test/ng/node_modules/ng2-pagination/index"' has no exported member 'PaginationControlsCmp'. 

app/blog.component.ts(13,3):錯誤TS2345:{{selector:string; templateUrl:string;提供者:(typeof PageService | typeof PaginationServic ...'不能分配給'Component'類型的參數 對象字面量可能只指定已知屬性,而'指令'不存在於'Component'類型中

+0

顯示'blog.component.ts'的代碼。也從錯誤''指令'不存在類型'組件'.'它看起來像你正在使用'@組件'裝飾器中的'指令'這已被棄用現在 – ranakrunal9

+0

我認爲你必須嘗試https://github.com/michaelbromley/ng2-pagination並按照指南 – ranakrunal9

+0

「http://pastebin.com/DUVc6s9E」我的博客代碼。 – HKumar

回答

0

In最新發布的角和directivespipes不贊成在@Component元。你要提供你的@NgModule元數據的所有directivespipesdeclarations元。

所以爲每ng2 paginationsimple-example你必須輸入Ng2PaginationModule內YOUT AppModule

您可以檢查documentation瞭解更多關於NgModule的信息。

+0

我試過這個例子,並得到這個錯誤「https://unsee.cc/guronape/」 – HKumar

相關問題