Closed ryanelian closed 6 years ago
@ryanelian, is this still relevant? If so, could you create a PR, please? If not, could you close the issue, please?
Should be still relevant but:
We don't use AngularJS these days. (Vue)
If we happened to need AngularJS, we have a custom build tool which enables inlining HTML templates out of the box let template = require('./template.html');
So closing the issue.
Currently, using the option option
moduleSystem: Browserify
outputs the following line:However, the variable
angular
is not actually defined prior to the call in the module file.(It can be easily solved by defining
var angular = require('angular');
in the module that requires thetemplates.js
, but that would not be elegant.)Hence, the output should look like this instead:
And then the
module.exports
should be the template name instead of the whole module!module.exports = 'templates';
That way, the template module can be loaded into the angular application by just doing this (like most other angular module libraries):
Because currently the
templates.js
is the odd one out in my project: