This is my controller code
var myApp = angular.module('myApp',[]);
myApp.controller('restaurantController',['$scope','$http', function($scope, $http){
$http.get($scope.something).success(function (data){
$scope.items = data;
});
$scope.orders = [];
$scope.process = function(item){
var cart = '{"name":"'+item.name+'","price":"'+item.quantity*parseInt(item.price)+'","quantity":"'+item.quantity+'"}';
$scope.orders.push(cart);
}
}]);
Basically I have a PHP page where I am getting the user values and dynamically adding elements to the $scope.orders array.
And then to display the elements of array I am using this code
<div class="container" ng-repeat="order in orders">
<h3>{{order.name}}</h3>
</div>
In my PHP page.But nothing being displayed.
cart
is a string, not object – Tushar 23 hours ago