I have 2 views. View1 and View2. View1 has list of products and checkboxes next to it and submit button. View2 is the page that displays the products selected from view1. My goal is to send the products selected (using checkboxes) from view1 to view2.
Here is my code..
**<a href="/#/Details/{{cartprd}}" class="bg-white" ng-click="SendToCartPage(cartprd)">{{fff}}</a>**
<tr>
<td>
**<input type="checkbox" ng-click="UpdateCart(tbl, $event)" ng-bind="tbl" id=" {{$index + 1}} " />**
</td>
<td>
<div>
<div class="thumbnail" ng-mouseover="getproductonhover()">
<div class="caption">
<span class="">{{tbl.ProdName}}</span>
<p class="">{{tbl.ProdDescription}}</p>
</div>
<img src="~/Images/imgcamera.jpg" class="imgproduct" />
</div>
</div>
</td>
<td>{{tbl.ProdName}}</td>
<td>{{tbl.ProdDescription}}</td>
<td>
<a class="btn btn-primary" ng-click="GetSingleProduct(tbl)">Edit</a>
</td>
</tr>
Controller.js
app.controller('CartController', function ($scope, $routeParams) {
$scope.SendToCartPage = function (cartprd) {
return cartprd;
}
});
View2
<div ng-controller="CartController">
{{SendToCartPage}}
</div>
I see an empty page in the view2. Can someone please tell me what mistake I am doing? One thing I noticed is when I make $scope.SendToCartPage = "mystring"
then I can see "mystring"
in view2.