import { Component, OnInit, Input } from '@angular/core'; import { IMenuItemAdmin } from '../../../../../models/admin/company/menu-management/menu-management'; import { MenuManagementService } from '../../../../../services/admin/company/menu-management/menu-management.service'; import { ActivatedRoute } from "@angular/router"; @Component({ selector: 'app-static-menu', templateUrl: './static-menu.component.html', styleUrls: ['./static-menu.component.css'] }) export class StaticMenuComponent implements OnInit { MenuAdminId: number; content: string; formTitle: string; file: string = null; _paramId: number = 0; MenuManagementAPIResponse: any; nodes: IMenuItemAdmin; constructor( private menuManagementService: MenuManagementService, private route: ActivatedRoute, ) { } ngOnInit(): void { this.MenuAdminId = Number(this.route.snapshot.params.id); this._paramId = 1; this.menuManagementService.getByMenuId(this._paramId, this.MenuAdminId, data => { this.MenuManagementAPIResponse = data; this.nodes = this.MenuManagementAPIResponse.objResponse.responseContent; this.formTitle = this.nodes.Name; this.content = this.nodes.Content; this.file = this.nodes.ImageVideoData; }, (error) => { console.error('Error: ' + error); return error(error); }); } }