Inside [`demo.html`](https://github.com/angular-ui/ui-select/blob/master/demo/index.html#L38), if you replace `ng-model="data.custom"`: ``` HTML <ui-select ng-model="data.custom"> ... </ui-select> ``` by `ng-model="myItem"`: ``` HTML <ui-select ng-model="myItem"> ... </ui-select> ``` `$scope.myItem` never gets set. It's like [`ngModelCtrl.$setViewValue(newVal)`](https://github.com/angular-ui/ui-select/blob/master/src/select.js#L57) cannot bind to a simple variable `$scope.myItem`. It will work only if `ng-model` is an object: - `demo.js`: `$scope.myItem = {}` - `demo.html`: `ng-model="myItem.data"` I could not figure out why, any idea?
Inside
demo.html, if you replaceng-model="data.custom":by
ng-model="myItem":$scope.myItemnever gets set.It's like
ngModelCtrl.$setViewValue(newVal)cannot bind to a simple variable$scope.myItem.It will work only if
ng-modelis an object:demo.js:$scope.myItem = {}demo.html:ng-model="myItem.data"I could not figure out why, any idea?