Hi,
Could you tell me how can i resolve my problem. I would like to see i my
console something like this: 1,2,3. My code shows 3 x zero.
var app = angular.module('myApp', []);
app.controller('mainCtrl', function ($scope, $http, $q) {
$scope.text = 0;
$scope.addText = function () {
$scope.arr = [1, 2, 3];
//var deferred = $q.defer();
$scope.arr.forEach(function (i) {
console.log($scope.text); //0,0,0 how make to 1,2,3 ??
$http.get('http://api.openweathermap.org/data/2.5/weather?q=London,uk').
then(function (response) {
$scope.text = i;
}, function (response) {
});
})
}
}
);
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.