app.component.ts
1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Component, OnInit } from '@angular/core';
import { UserService } from './components/UserEntity/user.service';
import { ManageDiscountCodeService } from './components/ManageDiscountCode/managediscountcode.service';
import { SubscriptionPriceService } from './components/SubscriptionPrice/subscriptionprice.service';
import { LicenseService } from './components/LicenseEntity/license.service';
import { ReportService } from './components/Reports/report.service';
//import { MyAuthService } from './shared/my-auth.service';
import { GlobalService } from './Shared/global';
import { Router, NavigationEnd } from '@angular/router';
//import { HttpClient } from '@angular/common/http';
//import { HttpErrorResponse } from '@angular/common/http';
//import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-component',
templateUrl: '../app/app.component.html',
providers: [UserService, ManageDiscountCodeService, SubscriptionPriceService, LicenseService, ReportService]
})
export class AppComponent implements OnInit {
public obj: any;
public objMenu: any;
public menustaus: string;
public submenustaus: string;
constructor(private userservice: UserService, public global: GlobalService, private router: Router
) { }
ngOnInit(): void {
this.menustaus = "True";
this.global.getJSON().subscribe(data => {
this.obj = data["AdminSections"]
for (let i = 0; i < 7; i++) {
if (this.obj[i].Id == this.global.UserType) {
this.objMenu = this.obj[i].HeaderMenu;
}
}
}, error => console.log(error));
this.router.navigate(['/updateuserprofile']);
}
logout() {
localStorage.removeItem('loggedInUserDetails');
window.location.href = this.global.LiveURL;
}
Product() {
debugger;
//localStorage.removeItem('loggedInUserDetails');
window.location.href = this.global.LiveURL;
//this.router.navigate([this.global.LiveURL]);
}
}