. Advertisement .
..3..
. Advertisement .
..4..
Hello everyone, I’m having the trouble named “cannot get angular”. I have tried a lots, but I cannot find the error. I did these steps as:
- Take to the project
- Setting npm
- Serving ng
The project runs properly. As you can see:
'** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **'.
Then, a web browser was open up, I acrossed to localhost:4200 and I have a result:
'Cannot GET /'
Finally, it shows the following:
'GET http://localhost:4200/ 404 (Not Found)'
The project should be good, however I’m having trouble getting to a working URL on the web page. Routing is set up in a different way than I am used to. The following is implemented : app.module.ts
const appRoutes: Routes = [
{ path: '', redirectTo: 'tree', pathMatch: 'full' },
{ path: 'admin', component: AdminPanelComponent, canActivate: [AuthGuard],
children: [{path:'', component: PanelComponent},{path: 'add', component:
AddTreeComponent}, {path:'manage-trees', component:ManageTreesComponent},
{path:'manage-users', component: ManageUsersComponent}, {path:'view-trees',
component: ViewTreeComponent}]},
{path:'tree', component: TreeComponent},
{path:'error', component: ErrorComponent},
{path:'unauthorized', component: UnauthorizedComponent},
{path:'login', component: LoginComponent},
{path:'entire-tree', component: EntireTreeComponent},
{ path: '**', component: PageNotFoundComponent },
];
I have found a lot of information sourses but I haven’t have the way to solve it. Please help me! Thank a lots.
The cause:
An error in Typescript or Angular Code, as in the import line here.
The solution:
I was able to overcome this mistake by locating and correcting the error that the console had indicated.
Run ng build on your command line/terminal to get a meaningful error, like the one shown in red here: On the type ‘object,’ the property ‘name’ does not exist.