是否可以显示arraylist最后一个数组元素数据

时间:2017-07-21 04:23:53

标签: arrays typescript arraylist angular2-template

是否可以显示ArrayList最后一个数组元素数据

我有ArrayList并且只想显示最后一个数组数据 this.truckDataPoints = []; 这是我的ArrayList对象

这是我的数据:

{
  "jobs" : [ {
    "job_id" : 10,
    "users" : [ {
      "user_id" : 11,
      "data_points" : [ {
        "efficiency" : "good",
        "rev" : 1,
        "probe" : "carboratour",
        "device_id" : "26e09c88237d5342",
        "measurements" : "2",
        "form_id" : "2",
        "instrument" : "plug",
        "background" : "7",
        "surveyed_item_id" : "100",
        "duration" : 0,
        "start_time" : "2017-07-20T04:04:43.000Z",
        "datastream" : "GENERIC",
        "username" : "abc@gmail.com.com"
      }, {
        "efficiency" : "good",
        "rev" : 1,
        "probe_type" : "carboratour",
        "device_id" : "26e09c88237d5342",
        "fixed_measurements" : "2",
        "form_id" : "2",
        "instrument_type" : "plug",
        "background_value" : "7",
        "surveyed_item_id" : "100",
        "duration" : 0,
        "start_time" : "2017-07-20T04:04:43.000Z",
        "datastream" : "GENERIC",
        "username" : "rs022015@gmail.com.com"
      }, {
        "condition" : "good",
        "rev" : 2,
        "type" : "carboratour",
        "device_id" : "26e09c88237d5342",
        "measurements" : "2",
        "form_id" : "2",
        "speed" : "plug",
        "brand" : "7",
        "company" : "100",
        "duration" : 0,
        "start_time" : "2017-07-20T04:04:43.000Z",
        "datastream" : "GENERIC",
        "username" : "rs022015@gmail.com.com"
      } ]
    } ]
  } ]
}

我想只显示最后一个元素

0 个答案:

没有答案