-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (26 loc) · 970 Bytes
/
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
angular.module('thinkfulLessons', ['ui.bootstrap', 'ui.utils', 'ui.router', 'ngAnimate', 'openWeatherApp', 'countriesCapitals']);
angular.module('thinkfulLessons').config(function($stateProvider, $urlRouterProvider) {
$stateProvider.state('home', {
url: '/home',
templateUrl: 'partials/home/home.html'
});
$stateProvider.state('lesson-5', {
url: '/lesson-5',
templateUrl: 'lessons/lesson-5/lesson-5.html'
});
/* Add New States Above */
$urlRouterProvider.otherwise('/home');
});
angular.module('thinkfulLessons').run(function($rootScope, $state) {
$rootScope.safeApply = function(fn) {
var phase = $rootScope.$$phase;
if (phase === '$apply' || phase === '$digest') {
if (fn && (typeof(fn) === 'function')) {
fn();
}
} else {
this.$apply(fn);
}
};
console.log($state);
});