import { Component, OnInit, OnDestroy } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { IComanda } from 'app/shared/model/comanda.model'; @Component({ selector: 'jhi-comanda-detail', templateUrl: './comanda-detail.component.html' }) export class ComandaDetailComponent implements OnInit { comanda: IComanda; constructor(private route: ActivatedRoute) {} ngOnInit() { this.route.data.subscribe(({ comanda }) => { this.comanda = comanda.body ? comanda.body : comanda; }); } previousState() { window.history.back(); } }