jcu*_*nod 4 javascript ruby-on-rails angularjs angularjs-templates
我正在尝试让Angular加载模板:
var app = angular.module("myApp", ['templates'])
Run Code Online (Sandbox Code Playgroud)
和我的HTML:
<div ng-app="myApp">
<div ng-include="'blah.html'"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
但我得到的只是404 Failed to load resource因为,Rails告诉我,No route matches [GET] "/blah.html".我知道这是因为Rails中的资产管道.blah.html是在/app/assets/javascripts/templates/blah.html,我正在使用angular-rails-templates宝石试图解决问题.所以我application.js有:
//= require angular-rails-templates
//= require_tree ./templates
Run Code Online (Sandbox Code Playgroud)
但我没有运气.
生成的html表明angular-rails-templates正在加载(它有一个脚本/assets/angular-rails-templates....js)但是rails无法找到blah.html
版本:
rails 4.2.1
angular-rails-templates 0.1.4
angularjs 1.3.15
| 归档时间: |
|
| 查看次数: |
1807 次 |
| 最近记录: |