привет. Я хочу попробовать использовать данные сущности на домашней странице без авторизации в угловом формате, и вот мой некоторый код
ChartsComponent
isSaving: boolean;
mass = [];
directions: Direction[];
constructor(private jhiAlertService: JhiAlertService,
private directionService: DirectionService,
) {
}
ngOnInit() {
// res: HttpResponse<Direction[]>;
this.isSaving = false;
this.directionService.query()
.subscribe((res: HttpResponse<Direction[]>) => {
this.directions = res.body;
}, (res: HttpErrorResponse) => this.onError(res.message));
}
private onError(error: any) {
this.jhiAlertService.error(error.message, null, null);
}
ChartsComponent.html
<div *ngFor="let d of directions">
{{d.id}} {{d.name}}
</div>
и в home.component.html я просто звоню <jhi-charts></jhi-charts>
, но в консоли возникает ошибка GET http://localhost:9060/api/directions 401 (Unauthorized)
Заранее спасибо