Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Created November 23, 2020 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mayankgupta688/66b3059fb0352b2f29088315a368c2f5 to your computer and use it in GitHub Desktop.
Save Mayankgupta688/66b3059fb0352b2f29088315a368c2f5 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
empList: any[] = [];
constructor(private _routes: ActivatedRoute) { }
ngOnInit(): void {
this._routes.data.subscribe((response: any) => {
this.empList = response.employees;
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment