简体   繁体   中英

Rails Assets: Load order

I am attempting to use a package called angular-dragula which is available through bower as well as a gem. I need the package to load after the DOM loads, in the body (not the head), but when I include the file in application.js with //=require angular-dragula it loads before the DOM, and results in an error.

Is there a way to control this? When I try to include it in the .html with <script src="bower_components/angular-dragula/angular-dragula.js"></script> , I get a 404 error.

https://github.com/bevacqua/angular-dragula

app/views/layouts/application.html.erb的正文中,添加以下内容:

<%= javascript_include_tag "angular-dragula" %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM