angular-utils-pagination with rails sprockets

时间:2015-03-12 16:24:51

标签: ruby-on-rails angularjs pagination sprockets

对于分页控件,

angular-utils-pagination取决于dirPagination.tpl.html。我用bower将它安装在bower_components中。树结构是

vendor
└── assets
    ├── bower_components
        ├── angular-utils-pagination
        ├── README.md
        ├── bower.json
        ├── dirPagination.js
        └── dirPagination.tpl.html

配置/ application.rb中

config.assets.paths << Rails.root.join('vendor','assets','bower_components')

config.assets.precompile << %r(.*.(?:eot|svg|ttf|woff|html)$)

当我将应用部署到生产环境时,资产预编译就会启动并将dirPagination.tpl.html复制到public/assets/angular-utils-pagination/dirPagination.tpl-8832242a2286b6a5e4623e6597069175.html。当angular尝试包含文件时,应用程序会给出404。

如何判断角度来自何处访问此文件?

1 个答案:

答案 0 :(得分:0)

我使用以下指令

 <dir-pagination-controls boundary-links="true" on-page-change="pageChangeHandler(newPageNumber)" **template-url="Templates\dirPagination.tpl.html"**>

它的工作对我很好