Created
July 21, 2018 19:42
-
-
Save ozgurrgul/fdeef1d529645b9ab769ac1b0eef4c89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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