Peter
Peter

Reputation: 914

Dart, conditional loading of Angular 2 packages/modules

Can output of dart2js (and angular2) be split into multiple packages and conditionally loaded during app runtime?

Similar to how RequireJS can do conditional loading of app parts/packages.

Example:

<button onClick="showAdminInterface()">ADMIN</button>

function showAdminInterface()
{
     require(['myApp/AdminPackage'], function(pkg){
         pkg.display();
     });
}

Upvotes: 1

Views: 139

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657248

Dart supports lazy loading of libraries and Angular2 also allows to use this feature.

For details see

Upvotes: 4

Related Questions