проверьте, над вами rootfolder / src / index.html 1) если у вас есть разрешение, + wx правильно, если нет, примените правильные разрешения для этого проекта Выполните и напишите или администратор + rwx
2)проверьте, нет ли каких-либо ошибок в rootfolder / src / app / app-routing.module.ts
с правильно импортированными модулями и компонентами import {Routes, RouterModule} из '@ angular / router';
и получите сервисы правильно Пример конечных точек сервисов для angular от laravel.
API_URI = 'http://localhost:3001/endpoint__api';
export class GnomesService {
gnome: Gnomes = {
name: '',
thumbnail: '',
age:'',
weight: '',
height: '',
hair_color: '',
professions: '',
friends:'',
created_at: new Date()
};
constructor(private http: HttpClient) { }
getGnomes() {
return this.http.get(`${this.API_URI}/gnomes`);
}
getGnome(id: string) {
return this.http.get(`${this.API_URI}/gnomes/${id}`);
}
deleteGnomes(id: string) {
return this.http.delete(`${this.API_URI}/gnomes/${id}`);
}
saveGnome(gnome: Gnomes) {
return this.http.post(`${this.API_URI}/gnomes`, gnome);
}
updateGnome(id: string|number, updatedGnome: Gnomes) {
return this.http.put(`${this.API_URI}/gnomes/${id}`, updatedGnome);
}
}
Пример для корневой папки / src / app.routing-module.ts
const routes: Routes = [
{
path: '',
redirectTo: '/gnomes',
pathMatch: 'full'
},
{
path: 'gnomes',
component: GnomesListComponent
},
{
path: 'gnomes/add',
component: GnomesFormComponent
},
{
path: 'gnomes/edit/:id',
component: GnomesFormComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }