0

I want to convert an AngularJS app to Angular 4. I'm reading the official Angular documentation for upgrading from AngularJS at https://angular.io/guide/upgrade. It states this:

To begin converting your AngularJS application to a hybrid, you need to load the Angular framework. You can see how this can be done with SystemJS by following the instructions in Setup, selectively copying code from the QuickStart github repository.

The 'Setup' link however leads to a page which doesn't mention SystemJS. How do I use SystemJS to load/build the Angular 4 framework into the existing AngularJS app?

2 Answers 2

1

The link you specified points to the Angular quickstart project which uses systemjs. https://github.com/angular/quickstart

Although the project is marked as deprecated it is currently still valid in how you can setup Angular with systemjs.

You can then use the quickstart as the basis for porting your code across and will enable you to follow the additional instructions in that setup steps.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I realised reading further through the upgrade guide (specifically the 'PhoneCat Upgrade Tutoria'l) that there are instructions on how to selectively use some of the output of setting up the quickstart project, including the SystemJS configuration that it produces (so that SystemJS can load the modules of the Angular 4 app).
0

That quote I gave from the Angular documentation is very confusing. What you actually need to do when upgrading is to somehow set up the scaffolding for an Angular 4 app within your project, then use SystemJS as the module loader that will load the Angular 4 modules at runtime (since there is currently incomplete native browser support for the EcmaScript module system).

I figured out by reading further through the upgrade guide (specifically the 'PhoneCat Upgrade Tutorial - https://angular.io/guide/upgrade#phonecat-upgrade-tutorial) that what you're expected to do is set up the QuickStart project in an independent location, somehow move most of it into your existing AngularJS project to provide the scaffolding for an Angular 4 project, then wire up SystemJS as the module loader by selectively using some of the SystemJS configuration that is inside your 'built' QuickStart project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.