@DavidLoevy wrote:
in controller I have code:
.controller('MyAccountCtrl', function($scope,$http,BaseURL,$localStorage) {
var OnUserComplete=function(response) {
$scope.User=response.data;
}
$BuddyID=$localStorage.get('BuddyName');
$TempURL='/API/User/'+$BuddyID;
$http.get(BaseURL.concat($TempURL))
.then(OnUserComplete);
console.log($scope.User.User[0].CC); /* how can display value "$scope.User.User[0].CC"??? */
})I try "$scope.User.User[0].CC", "$User.User[0].CC", "$scope.User.CC", ... but no success.
I have error "Cannot read property 'User' of undefined" or "undefined" (or similar).
But if I use:console.log($scope)
it display whole "scope" object, including "User", "User[0]" and its atributtes "CC" also.
But I need having dispaly only "CC" value.
Pls some tips or ideas?
Posts: 1
Participants: 1