Last active
March 10, 2017 10:17
-
-
Save ben-barbier/1936616ff641ea367e0cb36aeaf9f8d1 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
export class AuthenticationService { | |
loginState: Subject<any> = new Subject(); | |
constructor(private http: Http) { | |
} | |
logout() { | |
this.http.get('http://logout...') | |
.subscribe(() => { | |
// Question: comment récupérer la référence du service le plus proprement possible | |
// Pb : ici this ne représente pas le AuthenticationService mais l'appelant | |
this.loginState.next({event: 'LOGOUT'}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment