JSFiddle - React, Tailwind, and code Playground

by willtx

HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="mapFilter" ng-app="main" ng-controller="MapsController">
  
    <button ng-click="parseHotelsCityOffices()">Get Data</button> <br />
    <div style="width: 80%">
        <textarea rows="10" cols="50">hotels: {{hotels}}</textarea>
    </div>
    <div style="width: 80%">
        <textarea rows="10" cols="50">city offices: (length: {{CityOffices.length}}) {{CityOffices}}</textarea>
    </div>
</div>

JavaScript

var appRoot = angular.module('main', []);     //Define the main module


appRoot.controller('MapsController', ['$rootScope', '$scope', '$http', '$q', function ($rootScope, $scope, $http, $q) {
	$scope.offices = [];
	$scope.allHotels = [];
	$scope.hotels = [];
	$scope.SelectedHotels = [];
    $scope.CityOffices = getOffices();

function getOffices() {
   return [
{
$id: "1",
hotels: [
{
$id: "2",
brandCode: "HX",
innCode: null,
id: 41396,
officeName: "Hampton Inn Manhattan-SoHo, NY",
address: "54 Watts Street",
city: "New York",
countryCode: "US",
postalCode: "10013",
brand: "Hampton",
latitude: 40.72382,
longitude: -74.00535,
distance: 0.5545393824577332,
projectType: "",
locationType: null,
source: "Holtel"
},
{
$id: "3",
brandCode: "GI",
innCode: null,
id: 34718,
officeName: "Hilton Garden Inn New York Tribeca",
address: "39 Avenue of the Americas",
city: "New York",
countryCode: "US",
postalCode: "10013",
brand: "Hilton Garden Inn",
latitude: 40.7209358,
longitude: -74.00538,
distance: 0.7039581537246704,
projectType: "",
locationType: null,
source: "Hotel"
}
],
id: 157279,
officeName: "Apple Inc.",
address: "103 Prince St",
city: "New York",
countryCode: "US",
postalCode: "10012",
brand: null,
latitude: 40.7249832,
longitude: -73.99896,
distance: 0,
projectType: null,
locationType: null,
source: "Office"
},
{
$id: "4",
hotels: [
{
$id: "5",
brandCode: "GV",
innCode: null,
id: 43462,
officeName: "Hilton Grand Vacations New York/West 57th Street by Hilton C",
address: "102 West 57th Street",
city: "New York",
countryCode: "US",
postalCode: "10019",
brand: "Hilton Grand Vacations",
latitude: 40.7644463,
longitude: -73.97793,
distance: 0.41810479760169983,
projectType: "",
locationType: null,
source: "Hotel"
},
{
$id: "6",
brandCode: "GV",
innCode: null,
id: 35269,
officeName: "Hilton Grand Vacations Hilton Club New York",
address: "1335 Avenue of the Americas",
city: "New York",
countryCode: "US",
postalCode: "10019",
brand: "Hilton Grand Vacations",
latitude:...