I tried to Bind Laravel Eloquent ORM array to Angular JS View.
This is my code,
controller (Laravel)
public function index()
{
$data = User::all();
Response::json(array('data'=>$data));
}
View (Laravel)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel PHP Framework</title>
<script type="text/javascript" href="{{URL::asset('js/angular.js')}}"></script>
<script type="text/javascript" href="{{URL::asset('js/controller.js')}}"></script>
</head>
<body>
<div class="welcome">
<ul ng-controller="clientList">
<li ng-repeat="clients as clients">{{clients.name}}</li>
</ul>
</div>
Controller (Anular JS)
var anguApp = angular.module('anguApp', []);
anguApp.controller('clientList',function($scope,$http)
{
$scope.clients=[];
$http.get('/').success(function (data, status) {
$scope.clients = data;
console.log(data);
});
});
Now getting a blank screen in browser.... How to solve this ?