i was testing a small angular directives code then i got the error by firebug console that Failed to instantiate module myApp
see and tell me what is wrong in the above code
<div ng-app="myApp">
<div log='some-div'></div>
<p>Have a look at you console!</p>
</div>
var myApp = angular.module('myApp', []);
myApp.directive('log', function() {
return {
controller: function( $scope, $attrs ) {
console.log( $attrs.log + ' (controller)' );
},
compile: function compile( tElement, tAttributes ) {
console.log( tAttributes.log + ' (compile)' );
return {
pre: function preLink( scope, element, attributes ) {
console.log( attributes.log + ' (pre-link)' );
},
post: function postLink( scope, element, attributes ) {
console.log( attributes.log + ' (post-link)' );
}
};
}
};
});