L
Size: a a a
L
YK
<button (click)="runSimulation()"
>New simulation
</button>
private newSimulationClicks$ = new Subject();
runSimulation() {
this.newSimulationClicks$.next();
}
YK
@ViewChild('searchInput')
input: ElementRef;
const a$ = fromEvent<any>(this.input.nativeElement, 'keyup')
L
@ViewChild('searchInput')
input: ElementRef;
const a$ = fromEvent<any>(this.input.nativeElement, 'keyup')
L
YK
YK
L
YK
YK
L
L
IS
YK
@ViewChild('newSimulationButton', { static: false, read: ElementRef })
newSimulationButton: ElementRef;
...
const newSimulationClicks$ = fromEvent(this.newSimulationButton.nativeElement, 'click');
@ViewChild('autoModeSlideToggle', { static: false })
autoModeSlideToggle: MatSlideToggle;
...
const autoMode$ = this.autoModeSlideToggle.change;
L
@ViewChild('newSimulationButton', { static: false, read: ElementRef })
newSimulationButton: ElementRef;
...
const newSimulationClicks$ = fromEvent(this.newSimulationButton.nativeElement, 'click');
@ViewChild('autoModeSlideToggle', { static: false })
autoModeSlideToggle: MatSlideToggle;
...
const autoMode$ = this.autoModeSlideToggle.change;
YK
export class DrugsShortComponent implements OnInit {
@Input()
drugs: Drug[];
drugsFormatted: string;
constructor() {
}
ngOnInit() {
this.drugsFormatted = this.formatDrugs();
}
private formatDrugs(): string {
return this.drugs.length ? this.drugs
.map(drugFullName => drugFullName.substring(0, 3))
.join(', ') : 'No drugs given';
}
}
rugFormattingService с
единственной функцией? AK
export class DrugsShortComponent implements OnInit {
@Input()
drugs: Drug[];
drugsFormatted: string;
constructor() {
}
ngOnInit() {
this.drugsFormatted = this.formatDrugs();
}
private formatDrugs(): string {
return this.drugs.length ? this.drugs
.map(drugFullName => drugFullName.substring(0, 3))
.join(', ') : 'No drugs given';
}
}
rugFormattingService с
единственной функцией? YK
AK