shyamseshadri / angularjs-up-and-running

All the source code for the AngularJS Up & Running Book for O'Reilly
MIT License
466 stars 438 forks source link

Simplify stock.html for legibility #22

Open dkromp opened 8 years ago

dkromp commented 8 years ago

Simplify from:

<!-- File: chapter11/directive-broken-reference/stock.html -->
<div class="stock-dash">
  Name:
  <span class="stock-name"
        ng-bind="stockData.name">
  </span>
  Price:
  <span class="stock-price"
        ng-bind="stockData.price | currency">
  </span>
  Percentage Change:
  <span class="stock-change"
        ng-bind="getChange(stockData) + '%'">
  </span>

  <button ng-click="changeStock()">
    Change Stock in Directive
  </button>
</div>

to:

<!-- File: chapter11/directive-broken-reference/stock.html -->
<div>
  Name: {{stockData.name}}
  Price: {{stockData.price | currency}}
  Percentage Change: {{getChange(stockData) + '%'}}

  <button ng-click="changeStock()">
    Change Stock in Directive
  </button>
</div>