AngularJS - input that can contain any JS type as ngModel -


how implement field (input validation purposes only) able contain value not have string or number (like object or resource).

i want input field behave similar select directive, value can valid js type (object,array,string etc).

i want use field validation purposes (it hidden).

<input type="hidden" ng-model="fruit" name="fruit citrus-required> <span ng-show="form.fruit.$invalid">pick valid citrus</span>   <a ng-click="fruit={name:'banana'}">banana</a> <a ng-click="fruit={name:'orange'}">orange</a> 

it turns out angular has covered, http://beta.plnkr.co/edit/udq8br6yzhybckyr8kdp don't know if safe ?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -