-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmain.js
74 lines (67 loc) · 2.05 KB
/
main.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
69
70
71
72
73
74
/**
* Standard main.js file used by Require.js to load each module in a parallel process but
* respecting dependencies declaration precedence order before initializing each.
*
* Here, as loading jQuery and its dependencies would have required each of the library to be
* modified and loaded using Require-jQuery https://github.com/jrburke/require-jquery it has been
* decided to only load the Employee Admin module and the PureMVC library as a proof of concept
* for PureMVC TypeScript applications to be loaded asynchronously as AMD modules by Require.js.
*
* Employee Admin module has been compiled with the standard AMD wrapper :
*
* if( typeof define === "function" )
* {
* define( "EmployeeAdmin", ['puremvc'], function(puremvc)
* {
* //TypeScript generated JavaScript code here
* }
* }
*
* Have a look at : http://www.tekool.net/blog//2012/11/07/puremvc-typescript/ for more explanations
* on how the Ant task bundled in the project create the appropriate AMD module file using multiple
* module files as TypeScript still has some problem with that.
*/
/***************************************************************************************************
* Define the Require.js config for the Employee Admin demo.
*
* @url http://requirejs.org/
*/
require.config
(
{
baseUrl: '.',
paths:
{
puremvc: 'lib/puremvc/puremvc-typescript-standard-1.0-min',
EmployeeAdmin: 'bin/puremvc-typescript-employeeadmin-1.0-min'
},
shims:
{
"EmployeeAdmin":
{
deps: ["puremvc"]
}
}
}
);
/***************************************************************************************************
* Start loading each module and its dependencies.
*/
require
(
[
'EmployeeAdmin'
],
function
(
EmployeeAdmin
)
{
//Wait for the DOM to be ready before setting up the application.
jQuery( function ()
{
var applicationFacade/*ApplicationFacade*/ = EmployeeAdmin.ApplicationFacade.getInstance();
applicationFacade.startup( jQuery("body") );
})
}
);