My
homeController.js
var app = angular.module('myApp');
app.controller('HomeController',
function($scope, $http, $rootScope, $stateParams, $state, LoginService) {
$scope.user = $rootScope.userName;
console.log("Starting http request");
$http.get("http://127.0.0.1:5000/trying").success(function (response) {
$scope.myData = response.users;
console.log(response);
});
console.log("ending http request");
});
<div class="col-md-12" style="width:500px;">
<div align="right"><a ui-sref="login">Logout</a></div>
<h4>Welcome {{user}}! </h4>
<p><strong>This is Home Page</strong></p>
<ul>
<li ng-repeat="x in myData">
Data are : {{ x.fname + ', ' + x.coordinates }}
</li>
</ul>
</div>
The home.html is getting rendered from index.html. It is doing it fine as can be the user with which am logging in is displaying. However the ng-repeat is not working fine. When inspecting its showing that its getting commented out. What am i doing wrong?