2016-10-28 41 views
0

首先,我是Angular 2的新手,我試圖設置新的項目,我希望用戶登錄,如果登錄成功(這總是在我的情況下),那麼用戶應該重新路由到另一個零件。Angular2 base安裝錯誤

這裏是我的代碼: https://github.com/tsingh38/Angular2Demo

我也觸動了這裏編譯錯誤

zone.js:355Unhandled Promise rejection: Template parse errors: 'navigation' is not a known element: 1. If 'navigation' is an Angular component, then verify that it is part of this module. 2. If 'navigation' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. (" [ERROR ->]

"): [email protected]:0 ; Zone: ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors: 'navigation' is not a known element: 1. If 'navigation' is an Angular component, then verify that it is part of this module. 2. If 'navigation' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. (" [ERROR ->]

並請建議我來說,這是定義流程的標準方式?

感謝

回答

1

這不是一個真正的答案,它是一個解決方案。我看着你的代碼,看不到任何明顯的東西。我克隆了您的存儲庫,然後當我嘗試運行該項目時,我能夠看到所有問題。

在開始運行之前,我有幾件事需要解決。我已經修復了所有這些問題,並且基於您的代碼創建了一個拉取請求。您可以在拉取請求中看到我更改的內容。我添加了一個.gitignore文件,因此您不需要簽入所有節點模塊。您還拼錯了「登錄」。在查看拉取請求後,如果您有任何疑問,請告知我們。

以下是在拉取請求中更改的文件。 https://github.com/tsingh38/Angular2Demo/pull/1/files

1

內site.component.html您使用以下標記

<navigation></navigation> 

但是,裏面navigation.component.ts定義的組件選擇爲應用程序的導航這意味着

<app-navigation></app-navigation> 
+0

感謝這個我已經改編,但問題仍然存在 – Roxy

+0

它是同樣的錯誤嗎? – domfx