如何使用angularjs获取ng-bind =“property_address”

时间:2018-02-17 18:55:54

标签: angularjs

{
   "agreement":{
      "property_address":"B-99 Sector 44",
      "property_city":"Noida",
      "property_state":"Uttar Pradesh",
      "property_pincode":"201201",
      "agreement_place":"",
      "agreement_date":"",
      "monthly_rent":"10000",
      "rent_due_date":"5",
      "maintenance_fee":"500",
      "security_deposit":"",
      "renewal_rent_increment":"5",
      "area":"1200",
      "renting_purpose":"Residential",
      "electricity_bill":"Tenant",
      "pets":"Allowed",
      "sub_lease_property":"Allowed",
      "agreement_type":"",
      "property_type":"House",
      "user_type":"",
      "agreement_starting_date":"26 September 2016",
      "agreement_starting_duration":"11",
      "agreement_end_date":"26 August 2017",
      "delivery_address":"Tenant Address",
      "lock_in_period":"2",
      "witness1":"",
      "witness2":"",
      "areaunit":"Sq. Feet"
   },
   "landlord":{
      "name":"Sumit",
      "age":"22",
      "gender":"Male",
      "father_name":"RK Gupta",
      "address":"B-99 Sector 44",
      "city":"Noida",
      "state":"Uttar Pradesh",
      "pincode":"201201"
   },
   "tenant":{
      "name":"Nitish",
      "age":"29",
      "gender":"Male",
      "father_name":"BP Sharma",
      "address":"H.no 78, Sector 2 Chandigarh",
      "city":"HARYANA",
      "state":"Haryana",
      "pincode":"121001"
   },
   "payment":{
      "total_amount":449
   },
   "user":{
      "name":"",
      "email":"",
      "phone":""
   },
   "stamp_price":"",
   "user_id":"86",
   "step":"4"
}

1 个答案:

答案 0 :(得分:0)

一个工作示例: http://plnkr.co/edit/bwNCBH3aiNzQ9ubKuEQS?p=preview

在控制器中:

INSERTS

在视图中:

$scope.data = {
    "agreement": {
        "property_address": "B-99 Sector 44",
        "property_city": "Noida",
        "property_state": "Uttar Pradesh",
    },
    "user": {
        "name": "ajay",
        "email": "ajay@hotmail.com",
        "phone": "0123456789"
    },
}

如果您只想显示信息,请不要使用ng-bind:

<div ng-bind="data.agreement.property_address"/>