I have created a stackblitz example of my problem,
I want only 1 mode at a time to be visible either
- Draw Mode
- Zoom Mode
- Click Mode
But I am unable to do comparison and zoom mode doesn't appear on clicking the button
import { Component, Input, OnInit } from '@angular/core';
export enum Mode {
DRAW,
ZOOM,
CLICK
}
@Component({
selector: 'hello',
template: `<h1>Hello {{name}}!</h1>
<h1>Draw Mode</h1>
<h1 *ngIf = "mode === Mode.ZOOM">Zoom Mode</h1>
<h1>Click Mode</h1>
<button (click)="setZoomMode()"> Zoom Mode</button>
`,
styles: [`h1 { font-family: Lato; }`]
})
export class HelloComponent implements OnInit {
@Input() name: string;
mode: Mode;
ngOnInit() {
this.mode = Mode.CLICK;
}
setZoomMode() {
this.mode = Mode.ZOOM;
}
}