0
ng-repeat에서 데이터를 데이터 속성으로 전달하려면 어떻게해야합니까?1.x 각도로 데이터를 전달하는 방법
다음 내용을 참조하십시오.
불쌍한 형식으로 미안합니다. 이것은 내 StackOverflow에 처음 게시됩니다.
<div class="row">
<div class="col-md-3" ng-repeat="p in controller.prod | filter:{state:'California'}">
<div class="card">
<div class="card-block">
<h3 class="card-title">{{p.productName}}</h3>
<h6 class="card-subtitle text-muted">${{p.price}}</h6>
<img ng-src="{{p.productImage}}" class="img-fluid">
</div>
<div class="card-block">
<div class="card-text">Product information<a
href="#"
class="card-link productItem btn btn-primary"
<!--Below is what i'm trying to accomplish -->
data-name="{{p.productName}}"
data-s="black"
data-price="{{p.price}}"
data-id="1">Add to Cart</a>
</div>
<br />
</div>
</div>
</div>
</div>
데이터 이름 데이터 가격이란 무엇입니까? – Sajeetharan
데이터 이름, 데이터 가격은 값을 캡처하여 세션 저장소에 저장할 수 있도록하는 것입니다. –