Skip to content

Unable to redirect from app root #3

Description

@vishalbiradar

I am using ur repo code with below modification to rotes.
With empty url i.e. when we hit http://localhost:1337, I want to redirect to HomeComponent
i.e. to home page.
Related routing is as shown below:

app.module.ts

RouterModule.forRoot([
          { path: 'home',  component: HomeComponent },
          { path: '',  redirectTo: 'home', pathMatch: 'full' }
])

But I am getting error after hitting the http://localhost:1337/home
error is:

The selector "my-app" did not match any elements
http://localhost:1337/home page not found

screen shot 2017-12-22 at 1 13 57 pm

Please help me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions