Custom code before view is rendered

Is there a way you can manually fireup ionic? I want some custom code to run first, like saving some stuff to local storage and make one server request before showing anything on the screen. Once that’s done i want to build the application/show the view.

Doe anyone know how to do this in Iconic 1 and the new alpha 2?