I need to merge text and number properties from JSON to display as select options values by default. The expected output should be: 000.000.0001 - Chicago
HTML:
<!doctype html>
<html ng-app="plunker" >
<head>
<meta charset="utf-8">
<title>AngularJS Plunker</title>
<link rel="stylesheet" href="style.css">
<script>document.write("<base href=\"" + document.location + "\" />");</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<select ng-model="model.selected" ng-options="item.ID as item.Title for item in items"></select>
<p>Selected: {{model.selected}}</p>
</body>
</html>
JS:
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.items = [
{ID: '000.000.0001', Title: 'Chicago'},
{ID: '000.000.0002', Title: 'New York'},
{ID: '000.000.0003', Title: 'Washington'}
];
});