I'm building an angular directive which will be used in a few different locations.
I can't always guarantee the file structure of the app the directive is used in, but I can force the user to put the directive.js
and directive.html
(not the real file names) in the same folder.
When the page evaluates the directive.js
, it considers the templateUrl
to be relative to itself. Is it possible to set the templateUrl
to be relative to the directive.js
file?
Or is it recommended to just include the template in the directive itself.
I'm thinking I may want to load different templates based on different circumstances, so would prefer to be able to use a relative path rather than updating the directive.js