-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
70 lines (58 loc) · 2.32 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var carApp = angular.module('carPoolingApp', ['ngFileUpload','ngRoute','ngMap','ui.slider','ui.bootstrap','ngFacebook']);
carApp.config( function( $facebookProvider ) {
$facebookProvider.setAppId('278307552320713');
})
.run( function( $rootScope ) {
// Load the facebook SDK asynchronously
(function(){
// If we've already installed the SDK, we're done
if (document.getElementById('facebook-jssdk')) {return;}
// Get the first script element, which we'll use to find the parent node
var firstScriptElement = document.getElementsByTagName('script')[0];
// Create a new script element and set its id
var facebookJS = document.createElement('script');
facebookJS.id = 'facebook-jssdk';
// Set the new script's source to the source of the Facebook JS SDK
facebookJS.src = '//connect.facebook.net/en_US/sdk.js';
// Insert the Facebook JS SDK into the DOM
firstScriptElement.parentNode.insertBefore(facebookJS, firstScriptElement);
}());
})
// configure our routes
carApp.config(function($routeProvider) {
$routeProvider
.when('/',{
templateUrl: 'app/views/home.html',
controller:'homeController'
})
.when('/howitWorks', {
templateUrl: 'app/views/how-does-it-work.html',
controller: 'mainController'
})
.when('/search-result/:query', {
templateUrl: 'app/views/search-result.html',
controller: 'searchResultController'
})
.when('/ride-detail/:id', {
templateUrl: 'app/views/ride-details.html',
controller: 'rideDetailController'
})
.when('/dashboard', {
templateUrl: 'app/views/dashboard.html',
controller: 'dashboardController'
})
.when('/about-us', {
templateUrl: 'app/views/about-us.html'
})
.when('/offer-rides', {
templateUrl: 'app/views/offer-rides.html',
controller: 'offerRidesController'
})
.when('/edit-ride/:id', {
templateUrl: 'app/views/edit-ride.html',
controller: 'editRideDetailController'
})
.otherwise({
redirectTo: '/'
});
});