Template not found- using angularjs ngCart to buil

2019-09-12 17:05发布

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!

2条回答
beautiful°
2楼-- · 2019-09-12 17:16

In ngcart folder there is a template folder name, you copy it to the project folder, because it contains the html he complained lack.

查看更多
Animai°情兽
3楼-- · 2019-09-12 17:27

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>
查看更多
登录 后发表回答