Skip to content

Commit

Permalink
feat: first step on supporting systemjs & import
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Mar 5, 2015
1 parent 585e354 commit cb8dd62
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ocLazyLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,13 @@
return $q.all(promisesList);
};

// if someone loaded the module file with something else and called the load function with just the module name
if(angular.isUndefined(config.files) && angular.isDefined(config.name) && moduleExists(config.name)) {

This comment has been minimized.

Copy link
@lookfirst

lookfirst Mar 7, 2015

Contributor

It feels like angular.isDefined(config.name) should belong within moduleExists()

This comment has been minimized.

Copy link
@ocombe

ocombe Mar 7, 2015

Author Owner

Well modulesExists just takes the name of the module, but maybe some refractoring might be a good idea, I'll do that when I rewrite everything in ES6

recordDeclarations.push(true); // start watching angular.module calls
addToLoadList(config.name);
recordDeclarations.pop();
}

filesLoader(config, localParams).then(function success() {
if(modulesToLoad.length === 0) {
deferred.resolve(module);
Expand Down

3 comments on commit cb8dd62

@lookfirst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, what is the point of using push/pop here instead of just setting a true/false boolean?

@ocombe
Copy link
Owner Author

@ocombe ocombe commented on cb8dd62 Mar 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also used in the filesLoader section, and because you can load files in parallel it has to be an incremental thing :)

@lookfirst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks.

Please sign in to comment.