What do the parameters in the array of define app do?

时间:2015-07-13 21:02:46

标签: angularjs cordova requirejs

I'm learning angular and am trying to fix up an app that is broken. I found the culprit, when I comment out line 3 here: https://gist.github.com/yajd/7b3243f1d6971202b46e#file-errr-js-L3

It fixes my issues. So I want to understand what are the things in the array of define('app', [........], function(){}). Like I want to look up in the docs but Im not sure what those are called. After I figure that out then Ill dive into the code that uncommenting this line would bring in.

This is the full app and line 1426 is the one that causes the issues: https://gist.github.com/yajd/7417c3a335672d58c552#file-gistfile1-txt-L1426

Thanks

1 个答案:

答案 0 :(得分:1)

That define function is injecting the file dependency for that file using requirejs http://requirejs.org/ it is defining a module for you.

define('yourModuleName', ['otherModuleINeed', 'anotherModuleINeed'], function(){})