I want to pass an html ngModel value <input type="email" [(ngModel)]="email"/>
which is located on app.component.html, to a service which is called email.service.ts.
Inside the service I have this code:
const apiEmail ='http://apilayer.net/api/check?access_key=key' +'&email=' +emailAddress;
I want to dynamically pass the [(ngModel)]="email"
value to +emailAddress
so every time the user inputs an email adress to be able to check if it exists or not.
Thank you!
You could easily define a setter for the
email
property in your component and call the required service-method there.Component