I can not understand what is the flow of my application. In my index.html the attribute of my object recovers well, but in my controller it gives me an indefinite result.
Controller.js
angular
.module('app.core')
.controller('Controller', Controller);
function Controller($scope, Service) {
$scope.configs = [];
var getConfigs = function() {
Service.getAll.go({
}).$promise.then(function(successResponse) {
$scope.configs = successResponse;
console.log($scope.configs.name); // => Undefined
}, function(err) {
$scope.isLoading = false;
//Function error
});
};
getConfigs();
console.log($scope.configs.name); // => Undefined
}
Index.html
<!DOCTYPE html>
<head>
<title>test</title>
</head>
<body ng-app="app.core">
<div ng-controller="Controller">
<table >
<tr>
<th >Name</th>
<th>Last Name Urgencia</th>
</tr>
<tr ng-repeat="cfg in configs">
<td >{{cfg.name}}</td>
<td >{{configuracion.lastName}}</td>
</tr>
</table>
</div>
</body>
</html>
In index.html I can see the value of the property name and surname. console.log, print undefined