-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
36 lines (32 loc) · 1.02 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
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory(root));
} else if (typeof exports === 'object') {
module.exports = factory(root);
} else {
root.app = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
'use strict';
const show_about = function () {
alert('This is the application "About".\n\nCopyright ©2018-2019 Interart');
}
const show_number = function (num) {
alert('Number: ' + num);
}
const show_multiple = (num1, num2) => {
alert('Number 1: ' + num1 + "\nNumber 2: " + num2);
}
Router
.add(/about/, show_about)
.add(/number:([0-9]+)/, show_number)
.add(/multiple:([0-9]+)\|([0-9]+)/, show_multiple)
.beforeAll(() => {
console.log('Run before all routes!')
})
.afterAll(() => {
console.log('Run after all routes!')
})
.apply()
.start();
});