Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

fix(angular): support angular lazy routes in preview #753

Merged
merged 5 commits into from
Dec 21, 2018

Conversation

DimitarTachev
Copy link
Contributor

PR Checklist

What is the current behavior?

When an Angular app with lazy routes is run with preview, all Angular dependencies are marked as external and the app crashes runtime because the @angular/core NgModuleFactoryLoader is located in node_modules and it's not able to load the lazy routes from inside the app bundle.

What is the new behavior?

When @angular/core is an external module, a new ng-replace-lazy-loader transformer is added to the @ngtools/webpack platformTransformers. It modifies the main Angular module by including and providing a local NgModuleFactoryLoader.

In this way, when an Angular app with lazy routes is run with preview, it gets a local NgModuleFactoryLoader implementation inside the app bundle allowing it to access and load the lazy routes.

Related to: NativeScript/nativescript-cli#4024

@DimitarTachev DimitarTachev changed the title Support Angular Lazy Routes in Preview fix(angular): support angular lazy routes in preview Dec 19, 2018
@DimitarTachev DimitarTachev force-pushed the tachev/update-lazy-loader branch from b042c65 to 39c7a6c Compare December 20, 2018 07:44
@DimitarTachev DimitarTachev force-pushed the tachev/update-lazy-loader branch from fe26d49 to b2747e0 Compare December 20, 2018 12:13
@DimitarTachev DimitarTachev force-pushed the tachev/update-lazy-loader branch 4 times, most recently from 803afe1 to b6d49dc Compare December 20, 2018 12:33
@DimitarTachev DimitarTachev force-pushed the tachev/update-lazy-loader branch from af8b635 to f7641dc Compare December 21, 2018 12:07
@DimitarTachev DimitarTachev merged commit a6c23da into master Dec 21, 2018
@DimitarTachev DimitarTachev deleted the tachev/update-lazy-loader branch December 21, 2018 15:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants