forked from arcnovus/learning-parse-angular-patch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.js
More file actions
43 lines (35 loc) · 1.44 KB
/
application.js
File metadata and controls
43 lines (35 loc) · 1.44 KB
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
/*jslint white: true */ // My code is beautiful JSLint, STFU!
// Main application setup.
(function (window, angular, Parse) {
"use strict";
var ngDependencies,
app;
// Put your Parse keys here.
Parse.initialize("appid", "jssdkkey");
// set up dependencies for the main Angular Module
ngDependencies = [];
ngDependencies.push('ngRoute'); // the Angular router
ngDependencies.push('parse-angular'); // The Parse-Angular-Patch we are learning about
ngDependencies.push('parse-angular.enhance'); // Sugar on top of the Parse-Angular-Patch
// register the main Angular Module
app = angular.module('MainApp', ngDependencies);
// set up our routes
app.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.when('/home', {
templateUrl: 'views/home.html',
controller: 'Home', // ?? not sure why we set this here AND in the html
name: 'Home', // to help with the nav
title: 'Home Page' // to set the page title on the header
}).
when('/crud', {
templateUrl: 'views/crud.html',
controller: 'Crud',
name: 'CRUD',
title: 'CRUD Example > People List'
}).
otherwise({
redirectTo: '/home'
});
}]);
}(this, this.angular, this.Parse)); // pass globals in explicitely to please JSLint