Ionic Apps - Improve Performance




Ten points to remember while developing Ionic mobile apps:


  1. Performance is king 
  2. Use ng-if instead of ng-show. see difference
  3. Use one-time binding '::' as much as possible even in directive parameters.
eg: A value passed through to a directive. my-directive::parameter1   
  1. Use ionic's collection-repeat as much as possible otherwise use one-time binding in ng-repeat.
eg: ng-repeat="item in ::items"

  1. Don't use more filters in view. Instead of that use "$filter" in code
    1. "If you want your function to be called like a normal function, use factory. If you want your function to be instantiated with the new operator, use service. If you don't know the difference, use factory."
      Service recipe works better for objects of custom type while Factory can produce JavaScript primitives and functions. Ex:
      http://stackoverflow.com/questions/11324202/creating-common-controller-functions
  2. Some awesome tips http://julienrenaux.fr/2014/05/09/ionic-framework-features-you-may-have-missed/
  3. Reduce DOM as much as possible. It took too much CPU load.
  4. Use Crosswalk.
  5. Avoid JQuery and its plugins.

bCliks

To make something special you just have to believe it’s special!