javascript - Angular chosen is not binding Array of Objects -
I am using the angular selection plugin to select an attribute on any selected element.
My data will be in this format:
$ scope.pets = [{id: '1', name: 'dog', desc: "something" }, {Id: '2', name: 'cat', desc: "something"}, {id: '3', name: 'rat', desc: "something"}];
And the angle selected to display the name using the ng-option is:
& lt; Select multiple NG-model = "MyPets" ng-option = "R in pet as R" selected & gt;
I am able to get the drop down using the ng-option for the above data like this,
But if my NG model is bundled, then how do I get angles values to input input The following object can be tied to the box:
$ scope.myPets = {id: '6', name: 'pig', desc: "something"},
You can set default values until you
$ scope.myPets = [$ Scope.pets [0], $ scope.pets [5]];
You need to use an array []
than what you were thinking because you are using the selection multiple. You will not recognize existing objects or analogrices / javascript connections directly for reference.
Comments
Post a Comment