My ngModel is undefined when using the ngPattern directive. If I remove ngPattern, the ngModel works as expected. See plnkr.
Note how vm.condition does not show when typing a value in the text box, but as soon as the ngPattern is removed, vm.condition shows as expected.
HTML
<body ng-controller="MainCtrl as vm">
<div ng-form="vm.frmTest">
<input id="txtHealth" name="txtHealth" type="text" ng-model="vm.condition" ng-pattern="/^(.+)$/g">
<div class="help-block" ng-messages="vm.frmTest.txtHealth.$error" ng-show="vm.frmTest.txtHealth.$invalid">
<p ng-message="pattern">Error.</p>
</div>
</div>
<span>{{vm.condition}}</span>
</body>
JS
app.controller('MainCtrl', function($scope) {
this.condition = '';
});
NOTE: This is a dumbed down version showing the issue. My directive is showing the same issue.
pattern
in this case