I have an array structure like this.

```
[
  {
    "id": "1",
    "name": "John",
    "city": "NY"
  },
  {
    "id": "2",
    "name": "Gerold",
    "city": "LA"
  },
  {
    "id": "3",
    "name": "Stuart",
    "city": "Boston"
  }  
]

```

I need **$scope** like below for my autocomplete search.

```
$scope.name=["john","Gerold","Stuart"];
$scope.city=["NY","LA","Boston"];

```

can anyone help to get this using angularjs controller.
Thanks in Advance.!