TestProject Forum
Powered by leading experts in the test automation community

Run initialize code before startup of angularjs app

I want to run a few lines of code before my app controllers/directives.

Whats the best way to achieve this ?

var app = angular.module('myApp', []);

app.run(function($rootScope) {
    // init code
});