0

First of all i am new to Angular 2 and i am trying to setup new project where i want user to login and if login is successful (which is always in my case) then user should be rerouted to another component.

Here is my code: https://github.com/tsingh38/Angular2Demo

I am also struck with compilation error here

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 ->]

"): SiteComponent@5: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 ->]

And please suggest me, is this the standard way of defining the flow ?

Thanks

2 Answers 2

1

This is not really an answer, it's a solution. I looked at your code and couldn't see anything obvious. I cloned your repository, and then I was able to see all issues when I attempted to run the project.

You had a few things I had to address before I can get this running. I have fixed all of them, and I have created a pull request based on your code. You can see the things I changed in the pull request. I added a .gitignore file so you don't check-in all the node modules. You had also misspelled "loginn." Let me know if you have any questions after looking at the pull request.

Here are the files changed in the pull request. https://github.com/tsingh38/Angular2Demo/pull/1/files

Sign up to request clarification or add additional context in comments.

Comments

1

Inside site.component.html you are using the following tag

<navigation></navigation>

However, inside navigation.component.ts you define the components selector as app-navigation which would mean

<app-navigation></app-navigation>

1 Comment

thanks this i have adapted but problem is still there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.