2018-07-09 21:55:18 +00:00
|
|
|
import { Component, ViewChild, ElementRef } from '@angular/core';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-root',
|
|
|
|
|
templateUrl: './app.component.html',
|
|
|
|
|
styleUrls: ['./app.component.css']
|
|
|
|
|
})
|
|
|
|
|
export class AppComponent {
|
|
|
|
|
|
2019-10-05 08:04:54 +00:00
|
|
|
@ViewChild('bindingInput') bindingInput: ElementRef;
|
2018-07-09 21:55:18 +00:00
|
|
|
|
|
|
|
|
isUnchanged = true;
|
|
|
|
|
|
|
|
|
|
getHTMLAttributeValue(): any {
|
|
|
|
|
console.warn('HTML attribute value: ' + this.bindingInput.nativeElement.getAttribute('value'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDOMPropertyValue(): any {
|
|
|
|
|
console.warn('DOM property value: ' + this.bindingInput.nativeElement.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
working(): any {
|
|
|
|
|
console.warn('Test Button works!');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toggleDisabled(): any {
|
|
|
|
|
|
|
|
|
|
let testButton = <HTMLInputElement> document.getElementById('testButton');
|
|
|
|
|
testButton.disabled = !testButton.disabled;
|
|
|
|
|
console.warn(testButton.disabled);
|
|
|
|
|
}
|
|
|
|
|
}
|