Last active
December 14, 2015 08:48
-
-
Save hale/5059904 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| angular.module('venue4usFrontendApp', ['ui']) | |
| .config(['$routeProvider', function ($routeProvider) { | |
| $routeProvider | |
| //.when('/', { | |
| //templateUrl: 'views/main.html', | |
| //controller: 'MainCtrl' | |
| //}) | |
| .when('/venues/:id', { | |
| templateUrl: 'views/venue/show.html', | |
| controller: 'VenueShowCtrl' | |
| }) | |
| .otherwise({ | |
| redirectTo: '/venues/1' | |
| }); | |
| }]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
| <title></title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width"> | |
| <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> | |
| <link rel="stylesheet" href="styles/main.css"> | |
| </head> | |
| <body ng-app="venue4usFrontendApp"> | |
| <!--[if lt IE 7]> | |
| <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p> | |
| <![endif]--> | |
| <!--[if lt IE 9]> | |
| <script src="components/es5-shim/es5-shim.js"></script> | |
| <script src="components/json3/lib/json3.min.js"></script> | |
| <![endif]--> | |
| <!-- Add your site or application content here --> | |
| <div class="container" ng-view></div> | |
| <script src="components/angular/angular.js"></script> | |
| <script src="components/angular-resource/angular-resource.js"></script> | |
| <script src="components/angular-cookies/angular-cookies.js"></script> | |
| <script src="components/angular-sanitize/angular-sanitize.js"></script> | |
| <script src="components/angular-ui/build/angular-ui.min.js"></script> | |
| <!-- build:js scripts/scripts.js --> | |
| <script src="scripts/app.js"></script> | |
| <script src="scripts/controllers/main.js"></script> | |
| <script src="scripts/controllers/venue/show.js"></script> | |
| <!-- endbuild --> | |
| <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> | |
| <script> | |
| var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; | |
| (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; | |
| g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; | |
| s.parentNode.insertBefore(g,s)}(document,'script')); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h2>This is the VenueShow view.</h2> | |
| <div ng-controller="VenueShowCtrl"> | |
| <div id="map_canvas" ui-map="myMap" class="map" ui-options="mapOptions"> | |
| </div> | |
| <dl> | |
| <dt>Id<dt> | |
| <dd>{{ venue.id }}</dd> | |
| <dt>Name<dt> | |
| <dd>{{ venue.name }}</dd> | |
| <dt>City<dt> | |
| <dd>{{ venue.location.city }}</dd> | |
| <dt>Type<dt> | |
| <dd>{{ venue.type }}</dd> | |
| <dt>Capacity<dt> | |
| <dd>{{ venue.capacity }}</dd> | |
| </dl> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| angular.module('venue4usFrontendApp', ['ui']) | |
| .controller('VenueShowCtrl', ['$scope', '$routeParams', function ($scope, $routeParams) { | |
| $scope.venue = { | |
| id: $routeParams.id, | |
| name: "Tiger Tiger", | |
| location: { | |
| city: "Aberdeen", | |
| lat: "57.149717", | |
| lng: "-2.094278" | |
| }, | |
| type: "Nightclub", | |
| capacity: 300 | |
| }; | |
| $scope.myMarkers = []; | |
| $scope.mapOptions = { | |
| center: new google.maps.LatLng($scope.venue.location.lat, $scope.venue.location.lng), | |
| zoom: 15, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP | |
| }; | |
| }]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment