Skip to content

Instantly share code, notes, and snippets.

@ozgurrgul
Created July 21, 2018 19:42
Show Gist options
  • Save ozgurrgul/fdeef1d529645b9ab769ac1b0eef4c89 to your computer and use it in GitHub Desktop.
Save ozgurrgul/fdeef1d529645b9ab769ac1b0eef4c89 to your computer and use it in GitHub Desktop.
import {Injectable} from '@angular/core';
const TOKEN = 'TOKEN';
@Injectable({
providedIn: 'root'
})
export class CustomerService {
setToken(token: string): void {
localStorage.setItem(TOKEN, token);
}
isLogged() {
return localStorage.getItem(TOKEN) != null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment