0

I am going through this tutorial. https://code.tutsplus.com/tutorials/mastering-angularjs-directives--cms-22511

For some reason when I add my directive.

myPerfectDirective

It breaks the scoped variable that I have above it. My directive does not have a controller in it. Remove this from my html and my scoped variable returns.

  <my-perfect-directive></my-perfect-directive>

Here is a fiddle: https://jsfiddle.net/ciderman/mfesvznv/2/

1 Answer 1

3

I believe that you can't add both the template and templateUrl as properties in your directive. You could add one or the other, like this: https://jsfiddle.net/g1wpLe4d/1/.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.