Javascript 在angularjs和middleman上处理资产
我很难将angularjs集成到我的中间人应用程序中。我正在学习angularjs的phonecatApp教程和关于模板和链接图像的教程6。输出很好,但是控制台上显示了一个恼人的bug 得到http://localhost:4567/images/ 404找不到 现在我读到这个问题发生在将angulars表达式直接放到image元素的src属性时,所以建议将它放在ng src指令中,但是我在它上面使用了一个helper,它给了我thsi错误。这是我的密码:Javascript 在angularjs和middleman上处理资产,javascript,angularjs,sprockets,middleman,Javascript,Angularjs,Sprockets,Middleman,我很难将angularjs集成到我的中间人应用程序中。我正在学习angularjs的phonecatApp教程和关于模板和链接图像的教程6。输出很好,但是控制台上显示了一个恼人的bug 得到http://localhost:4567/images/ 404找不到 现在我读到这个问题发生在将angulars表达式直接放到image元素的src属性时,所以建议将它放在ng src指令中,但是我在它上面使用了一个helper,它给了我thsi错误。这是我的密码: = image_tag nil, "n
= image_tag nil, "ng-src" => asset_path(:images, "{{phone.imageUrl}}")
image_标记帮助器在任何情况下都会添加一个src属性。请参见,单击“查看源”:
# File 'padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb', line 253
def image_tag(url, options={})
options.reverse_merge!(:src => image_path(url))
tag(:img, options)
end
由于图像_标记在内部仅使用标记辅助对象,因此您可以通过以下方式获得结果
= tag :img, "ng-src" => asset_path(:images, "{{phone.imageUrl}}")