0

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?

0

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

it did, that is strange
nvm docs.angularjs.org/guide/directive they mention it here in directive matching

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.