I do have a problem with using Angular with Laravel's foreach loop, i tried to be as detailed as possible :)
<div style="padding:15px;" id="table-scroll" ng-app>
<table class="table table-responsive tblProducts" id="tblProducts">
<thead>
<tr>
<th>Description</th>
<th>Prices</th>
<th></th>
<th></th>
<th>Action</th>
</tr>
</thead>
<tbody>
//foreach loop here
</tbody>
</table>
</div>
this is my foreach loop
@foreach($products as $product)
{{ $product->product_description }}
product_price }}" ng-model="price">
@{{price*qty}}
@endforeach
Problem:
-When I use "ng-model" the prices/quantity are not displayed, but when i use "ng-bind" the prices/quantity are displayed but the subtotal column displays NaN (i have no idea why).
Flow:
-Each row of that table displays a list of grocery items, when the checkbox is clicked, it means that the item is selected and transferred to another table for calculating the grandtotal.
Reference: https://ibb.co/hCddLv (snap from list of grocery items) https://ibb.co/e0jk0v (when that product is transferred, this happens) *im using "ng-bind" to display the price and quantity...
Thanks for the answer in advance guys...
I have updated this with my controller code in laravel
public function create() {
$rooms = Room::where('status','=',0)->orderBy('room_length_of_stay')->get();$products = DB::table('classifications') ->join('products', 'classifications.id', '=', 'products.classification_id') ->select('classifications.*', 'products.*') ->get(); //$scope.products = $products; return View::make('frontdesk.transactions.create', ['rooms' => $rooms, 'products'=>$products]); }