How to use the .run directive of the Angular? [closed]

-3

How to use the .run of AngularJS directive?

    
asked by anonymous 08.01.2016 / 20:21

1 answer

2
var app = angular.module('aplicacao', ['highcharts-ng']);

app.run(function($rootScope) {
    ...     
});

Explaining:

  var app = angular.module('aplicacao', ['highcharts-ng']);

Create an angular module called 'application' that injects the dependency of 'highcharts-ng'.

app.run(function($rootScope) {

It is the starting point of your application. As a comparison, it is the same as the main (args) of java / c #.

And inside it you will write your code with the desired functions (:

    
08.01.2016 / 21:38