Tutorial 2.1(1.1) Data Binding

****************************index.html*************************

<div ng-app ng-init="qty=1;cost=2">

  <b>Invoice:</b>

  <div>

    Quantity: <input type="number" min="0" ng-model="qty">

  </div>

  <div>

    Costs: <input type="number" min="0" ng-model="cost">

  </div>

  <div>

    <b>Total:</b> {{qty * cost | currency}}

  </div>

</div>

****************************index.html*************************

Comments

Popular posts from this blog

Tutorial 12.12 Creating a Directive that Wraps Other Elements 3

Tutorial 12.14 Creating Directives that Communicate