I have scoured the internet trying to figure out why the proprietary AngularJS validation is not working when using jQuery.Select2 and the ui-select2 directive - is it a bug??
Edit: ok I've discovered it is only tagging inputs this is occurring, my Select drop downs and text inputs are working fine.
Here's the fiddle http://jsfiddle.net/whiteb0x/ftEHu/
Html:
<form name="myForm" ng-controller="Ctrl">
userType: <input ui-select2="version1" class="input-xlarge" type="hidden" name="input" ng-model="userType" required>
<span class="error" ng-show="myForm.input.$error.required">Required</span><br>
<tt>userType = {{userType}}</tt><br>
<tt>myForm.input.$valid = {{myForm.input.$valid}} wtf???????!!!</tt><br>
<tt>myForm.input.$error = {{myForm.input.$error}} huh????</tt><br>
<tt>myForm.$valid = {{myForm.$valid}} | please hand me a gun :)</tt><br>
<tt>myForm.$error.REQUIRED = {{!!myForm.$error.REQUIRED}}</tt><br>
</form>
Javascript:
var app = angular.module('myApp', ['ui.directives']);
function Ctrl($scope) {
$scope.userType = '';
$scope.version1 = {
tags : null
};
}