1
+ /**
2
+ * Standard main.js file used by Require.js to load each module in a parallel process but
3
+ * respecting dependencies declaration precedence order before initializing each.
4
+ *
5
+ * Here, as loading jQuery and its dependencies would have required each of the library to be
6
+ * modified and loaded using Require-jQuery https://github.com/jrburke/require-jquery it has been
7
+ * decided to only load the Employee Admin module and the PureMVC library as a proof of concept
8
+ * for PureMVC TypeScript applications to be loaded asynchronously as AMD modules by Require.js.
9
+ *
10
+ * Employee Admin module has been compiled with the standard AMD wrapper :
11
+ *
12
+ * if( typeof define === "function" )
13
+ * {
14
+ * define( "EmployeeAdmin", ['puremvc'], function(puremvc)
15
+ * {
16
+ * //TypeScript generated JavaScript code here
17
+ * }
18
+ * }
19
+ *
20
+ * Have a look at : http://www.tekool.net/blog//2012/11/07/puremvc-typescript/ for more explanations
21
+ * on how the Ant task bundled in the project create the appropriate AMD module file using multiple
22
+ * module files as TypeScript still has some problem with that.
23
+ */
24
+
25
+ /***************************************************************************************************
26
+ * Define the Require.js config for the Employee Admin demo.
27
+ *
28
+ * @url http://requirejs.org/
29
+ */
1
30
require . config
2
31
(
3
32
{
@@ -20,26 +49,26 @@ require.config
20
49
}
21
50
) ;
22
51
52
+ /***************************************************************************************************
53
+ * Start loading of each module and its dependencies.
54
+ */
23
55
require
24
56
(
25
57
26
58
[
27
- 'puremvc' ,
28
59
'EmployeeAdmin'
29
60
] ,
30
61
31
62
function
32
63
(
33
- puremvc ,
34
64
EmployeeAdmin
35
65
)
36
66
{
37
- //Wait for dom to be ready before setting up the application.
67
+ //Wait for the DOM to be ready before setting up the application.
38
68
jQuery ( function ( )
39
69
{
40
70
var applicationFacade /*ApplicationFacade*/ = EmployeeAdmin . ApplicationFacade . getInstance ( ) ;
41
71
applicationFacade . startup ( jQuery ( "body" ) ) ;
42
72
} )
43
73
}
44
-
45
74
) ;
0 commit comments