Currently, I am working with Grails 2.4.1 and have incorporated version 1.9.7 of the Grails Asset Pipeline Plugin.
In my project, there is a javascript file that defines an AngularJS directive. This Javascript file needs to access a static HTML template file which will be used by the AngularJS directive.
The question at hand is how do I correctly reference the HTML file within the asset directory?
Project Structure:
- grails-app
- assets
- javascripts
- directives
- hierarchyviewer.js
- hierarchyviewer.html
- directives
- javascripts
Project Structure when using the Angular Template Asset pipeline grails plugin
- grails-app
- assets
- javascripts
- directives
- hierarchyviewer.js
- directives
- templates
- hierarchyviewer.tpl.html
- javascripts
- assets
The file 'directivea.js' contains the following code:
angular.module('HierarchyViewer', []).directive('hierarchyviewer',function(){
return {
restrict: 'EA',
scope: {},
replace: true,
controller: function ($scope, $http) {
},
templateUrl: 'hierarchyviewer.tpl.html'
}
})
However, upon attempting to load a page that references the directive, a 404 error is returned for the directives/directivea.html reference.
How should I properly reference the template while utilizing the Asset Pipeline plugin?