Currently, the Angular $templateCache service is being used to compile all component templates into the js/template.js file. This is good for performance, because it prevents Angular from having to make a separate request for every template it encounters. The $templateCache service can be buggy at times, though, and adds extra complexity to the build process. You can achieve the same benefit with less complexity by simply using inline templates within your Angular components. And with Browserify, you can keep the template files nicely separated from the component JS and import them, as if they were inline, using require(). Browserify requires the "stringify" middleware package in order to do this.
Currently, the Angular
$templateCache
service is being used to compile all component templates into thejs/template.js
file. This is good for performance, because it prevents Angular from having to make a separate request for every template it encounters. The$templateCache
service can be buggy at times, though, and adds extra complexity to the build process. You can achieve the same benefit with less complexity by simply using inline templates within your Angular components. And with Browserify, you can keep the template files nicely separated from the component JS and import them, as if they were inline, usingrequire()
. Browserify requires the "stringify" middleware package in order to do this.