I have list of checkboxes with Samsung mobile models.
I also have two offers
$scope.offers = [
{
id: "as23456",
Store: "samsung",
Offer_message:"1500rs off",
modalname: "Samsung Galaxy Young"
},{
id: "de34575",
Store: "samsung",
Offer_message:"20% Flat on Samsung Galaxy S6",
modalname: "Samsung Galaxy S6"
},
]
Here If user checked Samsung Galaxy S6 we need to check with offers data whether we have offers or not for Samsung Galaxy S6.
If we have offers select drop down should come with offer message
<select >
<option value="0">Please Select Offer</option>
<option value="Samsung Galaxy S6">20% Flat on Samsung Galaxy S6</option>
</select>
If user checked Samsung Galaxy Young, we need to check with offers data whether we have offers or not for Samsung Galaxy Young.
If we have offers select drop down should come with offer message
<select >
<option value="0">Please Select Offer</option>
<option value="Samsung Galaxy Young">1500rs off</option>
</select>
If user checked Samsung Galaxy Young, Samsung Galaxy S6 both, we need to check with offers data whether we have offers or not for Samsung Galaxy Young,Samsung Galaxy S6.
If we have offers select drop down should come with offer message
<select >
<option value="0">Please Select Offer</option>
<option value="Samsung Galaxy Young">1500rs off</option>
<option value="Samsung Galaxy S6">20% Flat on Samsung Galaxy S6</option>
</select>
If user does not select these two (Samsung Galaxy Young,Samsung Galaxy S6) select drop down should not come bacause we dont have offers for other models.
Here is my demo