在单独的目录中定义句柄脚本 [英] Define handlebars scripts in a separate directory

查看:128
本文介绍了在单独的目录中定义句柄脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想避免管理一个包含我所有的handlebars模板的大index.html文件。
我读了不同的解决方案的多个博客,但我不知道最好的博客。
官方的ember.js团队有没有人可以为此提供最佳实践?
是最好的解决方案吗?



目前我没有使用任何特殊的后端,如node.js.只有一个基本的http apache服务器。 REST API由Tomcat服务器提供

解决方案

IMO如果您不是rails开发人员,那么最好的选择之一是确实咕噜或更好的yeoman( http://yeoman.io/ )。使用生成器ember( https://github.com/yeoman/generator-ember )和yeoman togheter会让你快速上手。例如,在安装yeoman和生成器ember之后,您可以使用简单的 yo ember 创建一个完整的项目结构,这将创建所有必要的视图/控制器/路由/模板,您可以立即开始编码。您应该尝试一下。



修改



正如评论中所述@Toran Billups,Ember核心团队正在开展此项目( https://github.com/ stefanpenner / ember-app-kit ),这将是基于grunt的,它将使用模块和更棒的东西。



希望它有帮助。 p>

I would like to avoid to manage a big index.html file containing all my handlebars template. I read multiple blogs with different solutions but I'm not sure of the best one. Is there someone from the official ember.js team able to provide the best practice for this ? Is grunt the best solution ?

Currently I do not use any special backend like node.js. Only a basic http apache server. The REST API is provided by a Tomcat server

解决方案

IMO if you are not a rails developer then one of the best option would be indeed grunt or much better yeoman (http://yeoman.io/). Using the generator-ember (https://github.com/yeoman/generator-ember) and yeoman togheter will get you up and running in no time. For example after installing yeoman and the generator-ember you can create a full project structure with a simple yo ember, this will create all the necessary folder for views/controller/routes/templates where you can start coding right away. You should give it a try.

Edit

As stated in the comment of @Toran Billups, the ember core team is working on this project (https://github.com/stefanpenner/ember-app-kit) which will be grunt based and it will work using modules and much more awesome stuff.

Hope it helps.

这篇关于在单独的目录中定义句柄脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆