This is what I did.
$scope.data.months = [];
angular.forEach(response, function (value, key) {
$scope.data.months.push({'month':value});
});
console.log(response) is look like this
Array[3]
0
:
"April 2017"
1
:
"May 2017"
2
:
"June 2017"
and console.log of months array result is look like this.
Array[0]
0 : Object
month : "April 2017"
__proto__
:
Object
1 : Object
month : "May 2017"
__proto__
:
Object
2 : Object
month : "June 2017"
__proto__
:
Object
I have two question
-> First one is why it is showing Array[0] insist of Array[3] as there are three objects in this array.
-> Second one is how to count number of month I think if first one is solved then second one will be solved from first one.
I am newbie in angular js, What I am doing wrong please guide me through right direction.