To understand this code concentrate on the ng-model directives
and the expressions are mentioned in {{ }} braces..
<label>Minimum Purchase amount</label>
<input type="text" placeholder="Enter Minimum value" required ng-model="purchasevalue"/>
<label>Discount Value</label>
<select name="discount" required ng-model="dis_type">
<option value="R">Rs</option>
<option value="P" selected="selected">%</option>
</select>
<input type="text" placeholder="Enter Discount value" required ng-model="discountvalue"/>
<label>Result</label>
<p>If purchase value is {{purchasevalue}} /- and discoount value is {{discountvalue}} {{dis_type == "R" ? "/-" : "%"}} then user payable amount is {{ dis_type == "R" ? purchasevalue - discountvalue : purchasevalue - ((discountvalue/100)*purchasevalue) }}</p>
Output
and the expressions are mentioned in {{ }} braces..
<label>Minimum Purchase amount</label>
<input type="text" placeholder="Enter Minimum value" required ng-model="purchasevalue"/>
<label>Discount Value</label>
<select name="discount" required ng-model="dis_type">
<option value="R">Rs</option>
<option value="P" selected="selected">%</option>
</select>
<input type="text" placeholder="Enter Discount value" required ng-model="discountvalue"/>
<label>Result</label>
<p>If purchase value is {{purchasevalue}} /- and discoount value is {{discountvalue}} {{dis_type == "R" ? "/-" : "%"}} then user payable amount is {{ dis_type == "R" ? purchasevalue - discountvalue : purchasevalue - ((discountvalue/100)*purchasevalue) }}</p>
Output
0 comments:
Post a Comment