修改路径
This commit is contained in:
29
src/app/components/admin-header/admin-header.component.ts
Normal file
29
src/app/components/admin-header/admin-header.component.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
|
||||
import {GlobalUserService} from '../../services/global-user.service';
|
||||
import {User} from '../../class/User';
|
||||
|
||||
@Component({
|
||||
selector: 'c-admin-header',
|
||||
templateUrl: './admin-header.component.html',
|
||||
styleUrls: ['./admin-header.component.less']
|
||||
})
|
||||
export class AdminHeaderComponent implements OnInit {
|
||||
|
||||
constructor(private userService: GlobalUserService) {
|
||||
}
|
||||
|
||||
user: User
|
||||
@Output() infoClicked = new EventEmitter<void>()
|
||||
|
||||
logout = () => this.userService.logout();
|
||||
infoClickedEvent = () => this.infoClicked.emit();
|
||||
|
||||
ngOnInit(): void {
|
||||
this.userService.watchUserInfo({
|
||||
next: data => this.user = data.result,
|
||||
error: err => this.user = null,
|
||||
complete: null
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user