123456789101112131415161718192021222324252627282930313233343536373839 |
- import { Component, OnInit } from '@angular/core';
- import { Router } from '@angular/router';
- import { AppSessionService } from '../shared/auth/app-session.service'
- import { TokenAuthService, UserInfo } from '../shared/service-proxy/token-auth.service'
- @Component({
- selector: 'app-content',
- templateUrl: './content.component.html',
- styleUrls: ['./content.component.css']
- })
- export class ContentComponent implements OnInit {
- userinfo:UserInfo;
- cardActives: string[]=['show','collapse'];
- constructor(
- private _sessionService: AppSessionService,
- private _tokenAuthService: TokenAuthService,
- private _router: Router
- ) { }
- ngOnInit() {
- this.userinfo = this._sessionService.user;
- }
- collapse(cardIndex){
- this.cardActives[cardIndex] = this.cardActives[cardIndex] == 'show'?'collapse':'show';
- console.log(this.cardActives[cardIndex]);
- }
- logout(){
- this._tokenAuthService.logout()
- .subscribe((result)=>{
- this._router.navigate(['account'])
- document.cookie = "auth_token=" + escape('') + ";expires=-1";
- })
- }
- }
|