import { Component, OnInit } from '@angular/core';
import { UserService } from '../../../../services/user.service';

@Component({
  selector: 'app-admin',
  templateUrl: './admin.component.html',
  styleUrls: ['./admin.component.scss']
})
export class AdminComponent implements OnInit {
  users: any;

  constructor(private userService: UserService) { }

  ngOnInit() {
    this.userService.getAllUsers().subscribe(
      data => {
        localStorage.setItem('users', JSON.stringify(data));
      });

      this.users = JSON.parse(localStorage.getItem('users'));
  }

}

import { Component, OnInit } from '@angular/core';
import { UserService } from '../../../../services/user.service';

@Component({
  selector: 'app-admin',
  templateUrl: './admin.component.html',
  styleUrls: ['./admin.component.scss']
})
export class AdminComponent implements OnInit {
  users: any;

  constructor(private userService: UserService) { }

  ngOnInit() {
    this.userService.getAllUsers().subscribe(
      data => {
        localStorage.setItem('users', JSON.stringify(data));
        this.users = JSON.parse(localStorage.getItem('users'));
      });

      this.users = JSON.parse(localStorage.getItem('users'));
  }

}

Fix offline admin panel access issue
Fix offline admin panel access issue
