sails-angular2 icon indicating copy to clipboard operation
sails-angular2 copied to clipboard

Unable to redirect from app root

Open vishalbiradar opened this issue 7 years ago • 2 comments

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.

vishalbiradar avatar Dec 22 '17 07:12 vishalbiradar

The error is self-explanatory. You do not have the app correctly setup. The root component is not identified.

xmaestro avatar Dec 27 '17 11:12 xmaestro

@xmaestro Above scenario works perfectly fine with only angular, when I am trying to integrate in sails it is throwing error. You can also try this,

  1. with only angular (separate project) 2)Same angular code in sails app (separate project)

vishalbiradar avatar Dec 29 '17 05:12 vishalbiradar