2016-10-28 40 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