O'Reilly logo
  • Charlie Guan thinks this is interesting:

mainCtrl.getChange(stock) + '%'

From

Cover of AngularJS: Up and Running

Note

Instead of doing this calculation in the template, I would prefer adding this in a controller/directive, like this:

scope.getChangePercent = stock => Math.ceil((stock.price - stock.previous) / stock.previous * 100) + "%";