2016-02-29 85 views
0

我有4個文本框。數量,單價,總額和增值稅。即使能夠獲得總價格,但無法獲得總額/ 100 * 5的增值稅百分比。其文字不coming.how拿到總,形成總價值無法在angularjs中找到百分比

<table> 
<tr> 
    <td> 
     <asp:Label ID="Label5" Text="Qty : " runat="server"></asp:Label> 
    </td> 
    <td> 
     <asp:TextBox runat="server" ID="txtQty" ng-model="qty"/> 
    </td> 
</tr> 
<tr> 
    <td> 
     <asp:Label ID="Label6" Text="Unit Price : " runat="server"></asp:Label> 
    </td> 
    <td> 
     <asp:TextBox runat="server" ID="txtUnitPrice" ng-model="unitprice"/> 
    </td> 
</tr> 
<tr> 
    <td> 
     <asp:Label ID="Label7" Text="Total Price : " runat="server"></asp:Label> 
    </td> 
    <td> 
     <asp:TextBox runat="server" ID="txttotalprice" Text="{{qty*unitprice}}" ng-model="TotalPrice/> 
    </td> 
</tr> 
<tr> 
    <td> 
     <asp:Label ID="Label8" Text="VAT @ 5% : " runat="server"></asp:Label> 
    </td> 
    <td> 
     <asp:TextBox runat="server" ID="txtVatPrice" Text="{{TotalPrice/100 * 5}}" /> 
    </td> 
</tr> 

+0

嘗試{{(TotalPrice/100)* 5}} –

+0

ng-model and bind Combination not working in total price。 –

+0

'TotalPrice'究竟是什麼?我沒有看到它在任何地方定義。 –

回答

1

您需要使用NG-模型和NG綁定像這樣在這個總數的5%,

<input type="text" runat="server" ID="txttotalprice" ng-model="totalprice" ng-bind="{{totalprice= qty*unitprice }}" />

檢查此plunker瞭解更多詳情。

+0

我想獲得增值稅總額和總額。文本=「{{qty * unitprice}} + {{(qty * unitprice/100)* 5}}」。//op- 100 + 20.但是我需要120 –

+0

然後你可以使用''check updated [plunker](http://embed.plnkr.co/h2xoob3PLPi0XgzYO71l/) –

+1

真的很好的編碼和謝謝.. –

0
<tr> 

       <td> 
        <asp:Label ID="Label5" Text="Qty : " runat="server"></asp:Label> 
       </td> 
       <td> 

        <asp:TextBox runat="server" ID="txtQty" Width="408px" ng-model="qty"/> 
       </td> 

      </tr> 




      <tr> 

       <td> 
        <asp:Label ID="Label6" Text="Unit Price : " runat="server"></asp:Label> 
       </td> 
       <td> 

        <asp:TextBox runat="server" ID="txtUnitPrice" Width="408px" ng-model="unitprice"/> 
       </td> 

      </tr> 


       <tr> 

       <td> 
        <asp:Label ID="Label7" Text="Total Price : " runat="server"></asp:Label> 

       </td> 
       <td> 

        <asp:TextBox runat="server" ID="txttotalprice" Width="408px" Text="{{qty*unitprice}}"/> 
       </td> 

      </tr> 


       <tr> 

       <td> 
        <asp:Label ID="Label8" Text="VAT @ 5% : " runat="server"></asp:Label> 
       </td> 
       <td> 

        <asp:TextBox runat="server" ID="txtVatPrice" Width="408px" Text="{{(qty*unitprice/100) * 5}}" /> 
       </td> 

      </tr>