我正在获取给定id的客户,客户详细信息是姓名,电子邮件和客户类型{0,1}。对于0,客户为普通客户,1为临时客户。
我能够在表单上显示客户的详细信息,但是能够选择客户的类型。我的选择选项显示{'常规','临时'},但没有选择任何选项值。
例如
customer1={'name':'john', 'email':'john@gmail.com', 'customer_type':0}
表单能够显示姓名和电子邮件,但不选择'常规'选项
控制器
$scope.customers_type=['regular','temporary'];
//I will get details of customer
$scope.customer=getCustomer($scope.id);
if($scope.customer.customer_type ==0)
$scope.customer.type=$scope.customers_type[0]
else
$scope.customer.type=$scope.customers_type[1]