对象不能在angularjs ng-model中访问


Object can not access in angularjs ng-model?

我想根据用户从客户端列表中选择客户端来显示客户端 ID 和国家/地区,我可以显示整个选定的对象,但不能显示选定的客户端详细信息。

<label class="control-label red">Client</label>
                {{selectedClient}}
                <select class="form-control" ng-model="selectedClient">
                    <option ng-repeat="client in clients" value="{{client.id}}">{{client.name}}</option>
                </select>
                <a href="javascript:void(0)" data-toggle="modal" data-target="#addressModel"><i class="fa fa-map-marker"></i>
                    &nbsp;{{selectedClient.id}},{{selectedClient.address_info.country}}
                </a>

在这里,selectedClient从选择框中相应地显示,但是即使它们持有某些值,selectedClient.idselectedClient.address_info.country也不会显示。

选定客户端的输出为,

{
    "id": 127,
    "payment_terms_id": null,
    "name": "Shihabs company",
    "note": null,
    "created_by": 0,
    "updated_by": null,
    "deleted_by": null,
    "created_at": "2015-03-09 10:32:31",
    "updated_at": "2015-03-09 10:32:31",
    "deleted_at": null,
    "status": 1,
    "payment_term": null,
    "address_info": {
        "id": 54,
        "client_id": 127,
        "street": null,
        "city": null,
        "pobox": null,
        "country": null,
        "phone": null,
        "work_phone": null,
        "mobile": null,
        "email": null,
        "website": null,
        "billing_street": null,
        "billing_city": null,
        "billing_pobox": null,
        "billing_country": null,
        "billing_phone": null,
        "billing_work_phone": null,
        "billing_mobile": null,
        "billing_email": null,
        "shipping_street": null,
        "shipping_city": null,
        "shipping_pobox": null,
        "shipping_country": null,
        "shipping_phone": null,
        "shipping_work_phone": null,
        "shipping_mobile": null,
        "shipping_email": null,
        "created_by": null,
        "updated_by": null,
        "deleted_by": null,
        "created_at": "2015-03-09 10:32:31",
        "updated_at": "2015-03-09 10:32:31",
        "deleted_at": null,
        "status": 1
    }
}

尝试这种方式绑定选择选项

 <select  ng-model="selectedClient" ng-options="client.name for client in 
 clients"></select>