var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.name = 'World';
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>AngularJS run() and config() methods</title>
<script src="https://code.angularjs.org/1.4.9/angular.js"></script>
<script>
var app = angular.module('myApp', []);
//This is run(function()).
app.run(function() {
alert("App run() method called.");
console.log("App run() method called.");
});
//This is config(function()).
app.config(function() {
alert("App config() method called.");
console.log("App config() method called.");
});
//This is controller.
app.controller('myCtrl', function($scope, $log) {
$log.log("app controller");
alert("App controller called.");
});
</script>
</head>
<body data-ng-app="myApp">
<div data-ng-controller="myCtrl"></div>
</body>
</html>
/* Put your css in here */