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.


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

function showAdminInterface()
     require(['myApp/AdminPackage'], function(pkg){


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

For details see

Answered By – Günter Zöchbauer

Answer Checked By – Candace Johnson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *