JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.min.js"></script>
<div ng-app="myApp" ng-controller="DemoCtrl">
<select ng-model="reservation.room" ng-options="room as room.name for room in rooms track by room.id"></select> <button ng-click="switchReservation()">Switch Reservation</button> {{ reservation.room | json }}
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('DemoCtrl', function ($scope) {
$scope.rooms = [{id: 1, name: "Room 1"}, {id: 2, name: "Room 2"}, {id: 3, name: "Room 3"},{id: 4, name: "Room 4"}];
$scope.reservation = {
id: 1,
time: "9AM",
room: {id: 1, name: "Room 1"}
};
$scope.switchReservation = function() {
$scope.reservation = {
id: 1,
time: "9AM",
room: {id: 2, name: "Room 2"}
};
}
});