import { Component, OnInit, Input } from '@angular/core';
import {InnerAdminPagesComponent} from '../inner-admin-pages.component'
import { ForinneradminService} from '../forinneradmin.service';
import { Router } from '@angular/router';
import { environment } from '../../../../environments/environment.dev';
@Component({
  selector: 'app-left-admin-panel',
  templateUrl: './left-admin-panel.component.html',
  styleUrls: ['./left-admin-panel.component.scss']
})
export class LeftAdminPanelComponent implements OnInit {

  tile: any;

  @Input() leftTiles;
  @Input() sentId;

  selected :any;
  innerImg_path = environment.imageUrl+'/assets/img/admin/';
  constructor( private router: Router, private _data: ForinneradminService) { }

  ngOnInit() {
    this.selected = this.sentId;
  }

  changerouteNow(id){
    console.log("route ID --- "+id)
      this.router.navigate(['admin/inner-page/'+id]);
  }
  findAncestor (el, cls) {
    while ((el = el.parentElement.parentElement));
    return el;
  }

  // findAncestor(
  //   document.getElementsByClassName('active'), 'li'));
}
