TestProject Forum

General => General Questions => Topic started by: Alex on May 19, 2016, 16:55:25 pm

Title: Run initialize code before startup of angularjs app
Post by: Alex on May 19, 2016, 16:55:25 pm
I want to run a few lines of code before my app controllers/directives.

Whats the best way to achieve this ?
Title: Re: Run initialize code before startup of angularjs app
Post by: Oren on May 22, 2016, 20:27:16 pm
Code
var app = angular.module('myApp', []);

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