Very simple code:
<div ui-if="showMemberId">
<input ng-model="memberId" ng-change="test()" id="memberId" name="memberId" class="text" type="text">
</div>
With this for the controller:
$scope.memberId = 'SDF';
$scope.test = function test(){
console.log($scope.memberId);
};
$scope.showMemberId = true;
Bizarrely, the ng-change
works but not the ng-model
. When I type into the input, it just logs the string SDF
to the console over and over because the model isn't changing.
Any ideas?