In Html:

```
<input class="form-control"[(ngModel)]="value" #muInput/>
<button (click)="onSetAttribute()"> set</button>`

```

In this:

```
`@ViewChild('muInput') muInput: ElementRef; `

```

`public seperator : string onSetAttribute() {` if(this.seperator ) {
this.muInput.nativeElement.setAttribute('mask' , this.seperator);this.muInput.nativeElement.setAttribute('thousandSeparator' , ',');`
}}

**I want to click on the button set a mask attribute to input this my code but is not working**