Answer the question
In order to leave comments, you need to log in
How does Angular work with a table?
Good afternoon.
I have the following field:
<td
data-ng-class="{'danger':getStatusCell(data, 'status_start_time')}"
data-ng-bind="getCell(data, 'start_time')"
></td>
$scope.getStatusCell = function(data, name) {
return data[name] == 0;
}
$scope.getCell = function(data, name) {
if(!!~name.indexOf('range')){
return (data[name]>1000)?(data[name]/1000)+"km":data[name]+"m";
}else{
if(!data["f_"+name]) {
return "-";
}
return data[name]+"/"+data["f_"+name]+" ("+data["diff_"+name]+")";
}
}
{city_id: 11, city: "Pavlodar", shop_id: 32, shop: "Павлодар 3, пр. Кутузова 44", user: "Тест дата", …}
$$hashKey
:
"020"
city
:
"Pavlodar"
city_id
:
11
created_at
:
"2017-08-08 11:47:29"
diff_end_time
:
0
diff_lunch_end_time
:
0
diff_lunch_start_time
:
0
diff_range_end_time
:
0
diff_range_lunch_end_time
:
0
diff_range_lunch_start_time
:
0
diff_range_start_time
:
58
diff_start_time
:
-12
end_time
:
""
f_end_time
:
""
f_lunch_end_time
:
""
f_lunch_start_time
:
""
f_start_time
:
"11:47"
fake
:
0
imei
:
"3574060723352846"
lunch_end_time
:
""
lunch_start_time
:
""
range
:
"100"
shop
:
"Павлодар 3, пр. Кутузова 44"
shop_id
:
32
start_time
:
"12:00"
status_end_time
:
0
status_lunch_end_time
:
0
status_lunch_start_time
:
0
status_range_end_time
:
0
status_range_lunch_end_time
:
0
status_range_lunch_start_time
:
0
status_range_start_time
:
1
status_start_time
:
1
user
:
"Тулеген Батыр"
ymd
:
"2017-08-08 00:00:00"
__proto__
:
Object
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question