How to set value and get the value in the form of $scope.object1.object = "some data";
In html and js if i set data like this it will work.
<select ng-model="myColor" ng-options="color.name for color in colors">
$scope.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
But actually i want like these
<select ng-model="myColor" ng-options="color.name for color in test.colors">
$scope.test.colors = [
{name:'black', shade:'dark'},
{name:'white', shade:'light'},
{name:'red', shade:'dark'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
See the Example in plunker demo
jsphave to do with anything here?