Multiple directives asking for template on

Late to the party here but in my case it happened because I stupidly named the directive the same thing as the variable that was being passed into it so when the directive was being used it was trying to recursively include itself!


Error: [$compile:multidir] Multiple directives [statbox, statbox] asking for template on

Most likely it's because you included the .js twice in your index.html and the compiler at the time of binding the directive doesn't know which template to choose.

you should check:

  • the compiled html page to see if you included twice statbox.js
  • make sure you don't have multiple spots in your code where you define the same .component('statbox',{})

I had this issue with Typescript. I renamed some ts files and visual studio (2015) kept the old generated js files. Somehow, angular used both new and old js files, and I ended up with this error. I did a clean (which deletes all generated js files), build and it worked!