sails-angular2
sails-angular2 copied to clipboard
Unable to redirect from app root
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
Please help me.
The error is self-explanatory. You do not have the app correctly setup. The root component is not identified.
@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,
- with only angular (separate project) 2)Same angular code in sails app (separate project)