In my project utilizing the Ionic framework, I encountered an issue with the code snippet below:
$scope.loginCountryCode;
$scope.loginPhone;
// Code continues...
<div class="container">
<label class="item item-input">
<div class="input-label" style="float:left;width:55%">
Country Code
</div>
<input type="tel" placeholder="123..." ng-model="loginCountryCode">
</label>
<label class="item item-input">
<div class="input-label" style="float:left;width:50%">
Phone Number
</div>
<input type="text" placeholder="123...." ng-model="loginPhone">
</label>
</div>
$scope.loginCountryCode
and $scope.loginPhone
are showing as undefined despite having ng-model="loginCountryCode"
and ng-model="loginPhone"
Interestingly, setting $scope.loginCountryCode = 123;
results in the ng-model value being 123, but any subsequent changes to the input aren't recognized. Any thoughts on how to resolve this? Thanks :)