2016-10-29 1 views

答えて

1

あなたはセッターに

export class Directive { 

    private _cleanTextBox: boolean; 

    @Input() set cleanTextBox(value: boolean) { 
    if (value) { 
     this.doClean(); 
    } 
    this._cleanTextBox = value; 
    } 

    get cleanTextBox() { 
    return this._cleanTextBox; 
    } 

    public abc = "someValue"; 

    public doClean{ 
    this.abc = ''; 
    } 
} 
を使用することができます
関連する問題