var app = Angular.module (' Mywind ', [' Ui.router '])
App.controller (' Myautumn ', function ($scope, $http, $filter) {
var objs =[{a:1},{a:2}];
Angular.foreach (OBJS, function (Data,index,array) {
Data equivalent to Array[index]
Console.log (data.a+ ' = ' +array[index].a);
Console.log (DATA.A);
Convert to lowercase
Console.log (Angular.lowercase ("A"))
Convert to uppercase
Console.log (Angular.uppercase ("B"))
});
$http
$scope. Swlogin = function () {
$http ({
Method: ' POST ',
Url:url + ",
Params: {}
}). Then (function Successcallback (response) {
$scope. val = response.data
Map Loop Traversal
var role = {
"1": ' Text A ',
"6": ' Text B ',
"9": ' Text C ',
"7": ' Text d ',
"3": ' Text e ',
"5": ' Text F '
}
Looping through changing values
$scope. val = $scope. Val.map (item = {
var obj = {};
Value X.realshow
Obj.realshow = Role[item.prizeid]? Role[item.prizeid]: ";
Return Object.assign ({}, item, obj);
})
}, function Errorcallback (response) {
$scope. message = message;
Console.log ("Error:" + response + "");
});
}
});
Angular iterating through an array of loops