Last active
April 7, 2016 04:22
-
-
Save byeblogs/95c70bf34ec541852741c773ffcc952b to your computer and use it in GitHub Desktop.
What Is Run / Directive / Config ! (Angular_JS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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