Hi, friends
add(d)
{
let e = document.getElementById('idElement');
let val = e.nodeValue;
alert(val);
}
help in this
Hi, friends
add(d)
{
let e = document.getElementById('idElement');
let val = e.nodeValue;
alert(val);
}
help in this
Hi, you can do the following ways:
<ion-input #idElement>
In your TS
set before your constructor
@ViewChild('idElement') elem: ElementRef;
then in your function
let val = this.elem.nativeElement.value
alert(val)
<ion-input [(ngModel)]="idElement">
then above your constructor
idElement:string = ''
then in your function
alert(idElement)
ngModel is a two way binding which is easy to work with