Skip to content

Instantly share code, notes, and snippets.

@byeblogs
Last active April 7, 2016 04:22
Show Gist options
  • Save byeblogs/95c70bf34ec541852741c773ffcc952b to your computer and use it in GitHub Desktop.
Save byeblogs/95c70bf34ec541852741c773ffcc952b to your computer and use it in GitHub Desktop.
What Is Run / Directive / Config ! (Angular_JS)
/*
Source : http://jsfiddle.net/ysq3m/
<div ng-app="myApp" ng-controller="myCtrl">
<div test1 test2> </div>
</div>
*/
var myApp = angular.module('myApp', []);
myApp.factory('aProvider', function() {
console.log("factory");
});
myApp.directive("test1", function() {
console.log("directive setup");
return {
compile: function() {console.log("directive compile");}
}
});
myApp.directive("test2", function() {
return {
link: function() {console.log("directive link");}
}
});
myApp.run(function() {
console.log("app run");
});
myApp.config( function() {
console.log("app config");
});
myApp.controller('myCtrl', function($scope) {
console.log("app controller");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment