mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
24 lines
467 B
TypeScript
24 lines
467 B
TypeScript
import { Component } from '@angular/core';
|
|
|
|
export type EditorType = 'name' | 'profile';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.css']
|
|
})
|
|
export class AppComponent {
|
|
editor: EditorType = 'name';
|
|
|
|
get showNameEditor() {
|
|
return this.editor === 'name';
|
|
}
|
|
|
|
get showProfileEditor() {
|
|
return this.editor === 'profile';
|
|
}
|
|
|
|
toggleEditor(type: EditorType) {
|
|
this.editor = type;
|
|
}
|
|
}
|