ngboilerplate

AngularJS HTML template/snippet management

淺唱寂寞╮ 提交于 2019-12-12 22:43:05
问题 I'm an Angular noob coming from Backbone+Marionette+Require. If you have an app with a bunch of views and a bunch of directives each with their own HTML where are you putting all the HTML snippets? Most of the examples I see are storing them either inline, in their own script tags, or loaded asynchronously. One thing I love about RequireJS is that templates can live in their own files but can be compiled into the main JS file for production. I assume there's a grunt task or something similar?

ng-boilerplate grunt scripts compilation

假如想象 提交于 2019-12-11 12:07:09
问题 I would like to be able to duplicate ng-boilerplate's script compilation process in my own app, but I am unable to get it working. I am referring to having this line in index.html be compiled into a list of all the scripts in my app: <!-- compiled JavaScript --><% scripts.forEach( function ( file ) { %> <script type="text/javascript" src="<%= file %>"></script><% }); %> I added the filterForJS function and registered the multi task in my gruntfile.js, but it is not working :( 回答1: Have you