问题描述
我正在构建一个有角度的Web应用程序,并试图合并ngCart.我使用bower install ngcart --save
安装了它,将bower文件合并到了index.html文件中,并将其作为依赖项注入到应用程序中.当我尝试使用<ngcart-addtocart>
指令(仅将ngcart-addtocart
标记合并到视图文件中)时,出现以下错误-Error: [$compile:tpload] Failed to load template: template/ngCart/addtocart.html (HTTP status: 404 Not Found)
I am building an angular web app and am trying to incorporate ngCart. I installed it using bower install ngcart --save
, incorporated the bower file in my index.html file and injected it as a dependency into the app. When I try to use the <ngcart-addtocart>
directive (only incorporating the ngcart-addtocart
tag in the view file) I get the following error - Error: [$compile:tpload] Failed to load template: template/ngCart/addtocart.html (HTTP status: 404 Not Found)
我怀疑这是我想念的简单事情.谢谢!
I suspect it is something simple I am missing. Thank you!
推荐答案
在bower
安装文件下载到的ngCart
目录中查找.
look in the ngCart
directory that bower
installed downloaded the files to.
app/public/libraries/ngCart/template/
└── ngCart
├── addtocart.html
├── cart.html
├── checkout.html
└── summary.html
然后在指令中将其写入模板位置.
then in the directive write in the template location.
<ngcart-summary template-url="/libraries/ngCart/template/ngCart/summary.html"></ngcart-summary>
这篇关于找不到模板-使用angularjs ngCart构建电子商务购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!