user1492051
user1492051

Reputation: 906

Angular Directive Replace

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

Answers (1)

Chandermani
Chandermani

Reputation: 42669

I am not sure why but if you name your directive directive('test',function() { it works.

Upvotes: 2

Related Questions