JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app>
<h2>Todo</h2>
<div ng-controller="TodoCtrl">
<div ng-repeat="variant in variant_options" class="col-md-4">
<select class="form-control" ng-change="calculateProductPrice(variant_values)" ng-model="variant_values">
<option ng-repeat="value in variant" value="{{value}}">{{value}}</option>
</select>
</div>
</div>
</div>
JavaScript
function TodoCtrl($scope) {
$scope.variant_options = {
color: ['white', 'red', 'blue'],
material: ['paper', 'plastic']
};
$scope.calculateProductPrice = function (variant_values) {
$scope.variant1 = variant_values;
console.log('inside calculate price==========', $scope.variant1);
if (data.color == variant_values) {
console.log(data);
}
};
}
/*----------------data-------------------------*/
//{color:'white', material:'paper', price:'100'}
//{color:'white', material:'plastic', price:'200'}
//{color:'red', material:'paper', price:'300'}
//{color:'red', material:'plastic', price:'400'}
//{color:'blue', material:'paper', price:'500'}
//{color:'blue', material:'plastic', price:'600'}