footer.js if defined as the main app.
(function () {
var app = angular.module('footer', []);
app.directive('siteFooter', function () {
return {
restrict: 'E',
templateUrl: 'site-footer.html',
};
});
})();
footer.js if added as a dependency.
(function () {
var app = angular.module('footer', []);
app.directive('siteFooter', function () {
return {
restrict: 'E',
templateUrl: 'Hexdra/partials/site-footer.html',
};
});
})();
I have an app that controls just the footer of my site, I then inject that footer app into the main app that defines my page.
I use the templateUrl to load a template for the footer.
For the first case I'm confused because the footerapp is not in the same directory as the template it's linked to, and it's still able to find it.
For the second case when the template has to be defined as 'Hexdra/partials/site-footer.html', why does it require me to go to the root?
If my files are structured as
- Hexdra
- -> app - contains the angular.Js files
- -> assets
- -> partials - contains my site-footer.html file.
- html-files
wouldn't I need to use 'partials/site-footer.html'?