function myCtrl($scope) {
$scope.Items = [
{
id: 1,
name: "ABC"
},
{
id: 2,
name: "DEF"
},
{
id: 3,
name: "GHI"
}
]
$scope.Items.unshift({id: 0, name: '--select--'})
$scope.select1 = 0;
$scope.Edit = function(item) {
$scope.select1 = item.id;
}
}
我想在司机年龄之后打印“年”
目前我的最低驾驶年龄:18
我该怎么做?
这是完整的代码
$itemData['show_min_driver_age'] = $itemData['min_driver_age'] > 0 ? TRUE : FALSE;
答案 0 :(得分:4)
尝试:
$itemData['show_min_driver_age'] = $itemData['min_driver_age'] > 0 ? TRUE : FALSE;
echo $itemData['show_min_driver_age']." Years";
答案 1 :(得分:0)
尝试:
$temp = " Years";
echo $itemData['show_min_driver_age']. $temp;
您可以使用临时变量在驱动程序时效后打印任何内容
答案 2 :(得分:0)
作为你的If条件试试这个
$itemData['show_min_driver_age'] = $itemData['min_driver_age'] >= 18 ? $itemData['min_driver_age'].' Years': FALSE;
echo $itemData['show_min_driver_age'];