internal-policy.component.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { NgxSpinnerService } from 'ngx-spinner';
  2. import { AuthServiceService } from './../../shared/auth-service.service';
  3. import { ActivatedRoute, Params } from '@angular/router';
  4. import { Component, OnInit } from '@angular/core';
  5. import { HttpClient } from '@angular/common/http';
  6. @Component({
  7. selector: 'app-internal-policy',
  8. templateUrl: './internal-policy.component.html',
  9. styleUrls: ['./internal-policy.component.css']
  10. })
  11. export class InternalPolicyComponent implements OnInit {
  12. constructor(private route: ActivatedRoute,
  13. private http: HttpClient,
  14. private spinner: NgxSpinnerService,
  15. private authSer:AuthServiceService) { }
  16. policyId: number;
  17. data = [];
  18. ngOnInit() {
  19. this.spinner.show();
  20. this.authSer.homeActivate = false;
  21. this.route.params.subscribe(
  22. (params: Params) => {
  23. this.policyId = params['policyId'];
  24. this.data = [];
  25. this.http.get(this.authSer.pathApi + '/get_footer/' + this.policyId).subscribe(
  26. (responce) => {
  27. this.data = responce['footer'];
  28. console.log(this.data);
  29. this.spinner.hide();
  30. },
  31. (error) => {
  32. console.log(error);
  33. }
  34. );
  35. }
  36. );
  37. }
  38. }