Ionic in Action: Hybrid Mobile Apps with Ionic and AngularJS by Jeremy Wilken

Ionic in Action: Hybrid Mobile Apps with Ionic and AngularJS by Jeremy Wilken

Author:Jeremy Wilken [Unknown]
Language: eng
Format: epub, pdf
Publisher: Manning Publications


Listing 5.26. Currencies controller (www/views/currencies/currencies.js)

Your controller is fairly lean and starts by setting values on the scope. You listen for the $stateChangeStart event because you want to disable reordering any time the currencies tab loses focus, and this event will fire any time the tab changes. This is just a convenience for users; otherwise, if the reordering is active when they leave the tab, it will still be active when they return. The move() method takes the item that’s being moved along with the two index values for where it was and where it needs to go. Using splice, you remove it first from the array and then re-insert it at the new location.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.