I am new to Angular and TypeScript. I have defined input field phone number and collected its value in text box. Now i want that value to be displayed when sending email to the admin. I tried the below code but its not working. Here is the code
<div class="text-input"> <label i18n="@@phoneNumberTitle" for="phoneNumber">i18n</label> <input id="phoneNumber" autocomplete="off" placeholder="@@placeholderphoneNumberTitle" i18n-placeholder="@@placeholderphoneNumberTitle" name="phoneNumber" #phoneNumber="ngModel" [(ngModel)] = "phone_number" required /> this is the typescript code
/** * Call service to send notification via email to admin */ sendEmailToNotificateAdmin(user) { const data = { to: environment.adminEmail, cc: '123vron@gmail.com', subject: 'A new user has registered', body: ` A new user has registered at XYB. Phone Number: $(phone_number) }; } https://stackoverflow.com/questions/66593022/how-do-i-use-the-value-of-ngmodel-in-a-seperate-file-to-display-the-value March 12, 2021 at 09:40AM
没有评论:
发表评论