Reputation: 906
Can someone please tell me why the following directive doesn't work?
angular.module('app',[]).
directive('Test',function() {
return {
restrict : 'E',
replace : true,
template :'<h3>Test Test Test Test</h3>'
};
});
Html
<body ng-app="app">
<Test></Test>
</body>
If i understand correctly i expect it to display Test Test Test Test
inside an h3 , but it doesn't, any idea why?
Upvotes: 0
Views: 49
Reputation: 42669
I am not sure why but if you name your directive directive('test',function() {
it works.
Upvotes: 2