Skip to content

Commit e479f60

Browse files
committed
main.js is now documented
1 parent 21820d7 commit e479f60

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

main.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
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+
*/
130
require.config
231
(
332
{
@@ -20,26 +49,26 @@ require.config
2049
}
2150
);
2251

52+
/***************************************************************************************************
53+
* Start loading of each module and its dependencies.
54+
*/
2355
require
2456
(
2557

2658
[
27-
'puremvc',
2859
'EmployeeAdmin'
2960
],
3061

3162
function
3263
(
33-
puremvc,
3464
EmployeeAdmin
3565
)
3666
{
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.
3868
jQuery( function ()
3969
{
4070
var applicationFacade/*ApplicationFacade*/ = EmployeeAdmin.ApplicationFacade.getInstance();
4171
applicationFacade.startup( jQuery("body") );
4272
})
4373
}
44-
4574
);

0 commit comments

Comments
 (0)