Added logout and localStorage

This commit is contained in:
piratefinn 2017-06-05 18:47:34 +01:00
parent d8ff4064e2
commit 1bd586b3ae
5 changed files with 59 additions and 13 deletions

View file

@ -1,11 +1,17 @@
import { Component, OnInit } from '@angular/core';
import { ApiService } from '../providers/api-service';
import {Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
templateUrl: './full-layout.component.html'
templateUrl: './full-layout.component.html',
providers: [ApiService]
})
export class FullLayoutComponent implements OnInit {
constructor(
private api: ApiService,
private router: Router,
) {}
public disabled = false;
public status: {isopen: boolean} = {isopen: false};
@ -20,4 +26,14 @@ export class FullLayoutComponent implements OnInit {
}
ngOnInit(): void {}
}
userlogout() {
console.log('logout clicked');
this.api
.logout()
.subscribe(
result => {
console.log('Logged out!');
}
);
}
}