Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getNativeInput: () => this._getInputElement(),
helperText: this._helperText ? this.helperText.helperTextFoundation : undefined,
icon: this._icons ? this._icons.first.iconTextFoundation : undefined
};
private _foundation: {
init(): void,
destroy(): void,
isDisabled(): boolean,
setDisabled(disabled: boolean): void,
setValid(isValid: boolean): void,
setValue(value: any): void,
isValid(): boolean,
notchOutline(openNotch: boolean): void,
setUseNativeValidation(useNativeValidation: boolean): void
} = new MDCTextFieldFoundation(this._mdcAdapter);
/** View -> model callback called when value changes */
_onChange: (value: any) => void = () => { };
/** View -> model callback called when text field has been touched */
_onTouched = () => { };
constructor(
private _platform: Platform,
private _changeDetectorRef: ChangeDetectorRef,
public elementRef: ElementRef,
private _ripple: MdcRipple) {
// Force setter to be called in case id was not specified.
this.id = this.id;
}
ngAfterViewInit(): void {
this._foundation = new MDCTextFieldFoundation(this._mdcAdapter);
this._foundation.init();
this._initRipple();
}
getDefaultFoundation() {
return new MDCTextFieldFoundation(
{
addClass: (className: string) => this.root.addClass(className),
removeClass: (className: string) => this.root.removeClass(className),
hasClass: (className: string) => this.root.hasClass(className),
registerTextFieldInteractionHandler: (
evtType: K,
handler: SpecificEventListener
): void => this.root.addEventListener(evtType, handler),
deregisterTextFieldInteractionHandler: (
evtType: K,
handler: SpecificEventListener
): void => this.root.removeEventListener(evtType, handler),
registerValidationAttributeChangeHandler: (
handler: (attributeNames: string[]) => void
): MutationObserver => {
const getAttributesList = (mutationsList: MutationRecord[]) =>