Sorry to necro but Nobody mentioned <base>
http://www.verdantrefuge.com/writing/2013/angularjs-changing-app-path-base-element/
This completely solved our issue:
<base href="{% static 'js/vendor/myapp/app/' %}" />
<script src="js/Module.js"></script>
and we left templateUrl the same in our directive:
(function () {
'use strict';
angular
.module('site.project.app')
.directive('myDirective', [myDirective])
;
function myDirective() {
return {
restrict: 'E',
replace: true,
controller: 'MyCtrl',
templateUrl: 'partials/my-directive.html',
link: function (scope, elem, attrs) {
}
}
}
})();
~
On Wednesday, 11 April 2012 11:57:49 UTC+1, Robert B. Weeks wrote:
>
> Hello -
>
> I was curious on the 'templateURL' field when creating a directive. What
> is this path relative to? I have had a hard time getting it to read in a
> file as the replacement for the template, and have tried multiple paths to
> do so.
>
> That is what this field is for - correct? It looks that way according to
> the docs.
>
> Thanks.
>
> --
> Robert B. Weeks
>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.