Is there a way I can execute some JavaScript code at start-up of my AngularJS application? I have some common code that I need to make sure runs before any of the app directives
You can do like this,
var app = angular.module('myApp',[]); app.run(function($rootScope) { //..... });