Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created April 22, 2020 21:16
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 manoj-choudhari-git/80cc7f7c241f5436f7386be62175359b to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/80cc7f7c241f5436f7386be62175359b to your computer and use it in GitHub Desktop.
App component
import { Component, OnInit } from '@angular/core';
import { AuthService } from './auth.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'SecureApp';
constructor(private authService: AuthService) { }
ngOnInit() {
this.authService.initializeAuth();
}
login() {
this.authService.logIn();
}
logOut() {
this.authService.logOut();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment