How to Extract Country Code from Input in AngularJS
I am a newcomer to AngularJS and currently working on a project involving a dropdown for country code and an input field for a mobile number. Upon submitting the form, I am able to retrieve the mobile number successfully, but I am wondering how to also extract the country code. Below is a snippet of my HTML code:
<input type="tel" class="form-control" id="tel" name="tel"
ng-model="updating.phone" ng-intl-tel-input numbers-only
data-selected-country="selected.country" style="width:100%;">
And here is the relevant section of my script:
function getviewed()
{
var form = new FormData();
var numbr = document.getElementById('tel').value;
}
Editors note:
For more information on the ng-intl-tel-input directive, please visit their GitHub page here.