#5 Max Array Value

If you have an array:

You can get the maximum value with a computed property

The maxNumber property will always have the maximum value in the array and will auto re-compute and update any bindings automatically.
Here is some sample code:
https://ember-twiddle.com/43939812f6c9729845bff7072619c361?openFiles=controllers.application.js%2C

Bonus

You can get the minimum with

See more at http://emberjs.com/api/classes/Ember.computed.html


Also published on Medium.

Published by

Emad Ibrahim

Author of asp .net MVC & TDD, entrepreneur, passionate technologist, programmer and productivity nut. more at http://t.co/oSJXPvzu