-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (27 loc) · 851 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
var apichallenge = angular.module('apichallenge', ['ui.router', 'angularify.semantic.popup']);
// routes
apichallenge.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state('home', {
url: "/",
templateUrl: "partials/index.html",
controller: "indexController"
})
.state('result', {
url: "/game/:id",
templateUrl: "partials/result.html",
controller: "resultController"
});
});
// allow data links
apichallenge.config(['$compileProvider',
function ($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|data):/);
}]);
// directive to load popups
apichallenge.directive('loadPopup', function() {
return function(scope, element, attrs) {
angular.element(element).popup();
};
})