update phonecat-final prose

This commit is contained in:
Filipe Silva 2016-11-12 22:09:23 +00:00
parent 8f23969bc5
commit 0985055d2f
1 changed files with 12 additions and 10 deletions

View File

@ -1347,7 +1347,7 @@ code-example(format="").
The Angular 1 directive had a `checkmark` _filter_. The Angular 1 directive had a `checkmark` _filter_.
Let's turn that into an Angular 2 **pipe**. Let's turn that into an Angular 2 **pipe**.
There is no upgrade adapter method to convert filters into pipes. There is no upgrade method to convert filters into pipes.
You won't miss it. You won't miss it.
It's easy to turn the filter function into an equivalent Pipe class. It's easy to turn the filter function into an equivalent Pipe class.
The implementation is the same as before, repackaged in the `transform` method. The implementation is the same as before, repackaged in the `transform` method.
@ -1449,7 +1449,11 @@ code-example(format="").
Now switch the bootstrap method of the application from the `UpgradeAdapter` Now switch the bootstrap method of the application from the `UpgradeAdapter`
to the Angular 2 way. to the Angular 2 way.
Now we can drop `upgrade.bootstrap` from our application bootstrap, and remove the
`ngDoBootstrap()` override from `app.module.ts`
+makeExample('upgrade-phonecat-3-final/ts/app/main.ts', null, 'main.ts') +makeExample('upgrade-phonecat-3-final/ts/app/main.ts', null, 'main.ts')
+makeExample('upgrade-phonecat-3-final/ts/app/app.module.ts', null, 'app.module.ts')
:marked :marked
You are now running a pure Angular 2 application! You are now running a pure Angular 2 application!
@ -1460,18 +1464,16 @@ code-example(format="").
its new life as a pure, shiny Angular 2 app. The remaining tasks all have to its new life as a pure, shiny Angular 2 app. The remaining tasks all have to
do with removing code - which of course is every programmer's favorite task! do with removing code - which of course is every programmer's favorite task!
If you haven't already, remove all references to the `UpgradeAdapter` from `main.ts`. If you haven't already, remove all references to the `UpgradeModule` from `app.module.ts`,
Also remove the Angular 1 bootstrap code. as well as any [Factory provider](#making-angular-1-dependencies-injectable-to-angular-2) for Angular 1 services.
Also remove any `downgradeComponent()` you find, together with the associated Angular 1
When you're done, this is what `main.ts` should look like: directive declarations.
+makeExample('upgrade-phonecat-3-final/ts/app/main.ts', null, 'app/main.ts')
:marked :marked
You may also completely remove the following files. They are Angular 1 You may also completely remove the following files. They are Angular 1
module configuration files and not needed in Angular 2: module configuration files and not needed in Angular 2:
* `app/app.module.ts` * `app/app.module.ng1.ts`
* `app/app.config.ts` * `app/app.config.ts`
* `app/core/core.module.ts` * `app/core/core.module.ts`
* `app/core/phone/phone.module.ts` * `app/core/phone/phone.module.ts`
@ -1482,7 +1484,7 @@ code-example(format="").
we still need are for Jasmine and Angular 2 polyfills. we still need are for Jasmine and Angular 2 polyfills.
code-example(format=""). code-example(format="").
npm uninstall @types/angular --save-dev npm uninstall @types/angular @types/angular-animate @types/angular-cookies @types/angular-mocks @types/angular-resource @types/angular-route @types/angular-sanitize --save-dev
:marked :marked
Finally, from `index.html`, remove all references to Finally, from `index.html`, remove all references to
@ -1580,7 +1582,7 @@ table
:marked :marked
When the bootstrap method is switched from that of `UpgradeAdapter` to When the bootstrap method is switched from that of `UpgradeModule` to
pure Angular 2, Angular 1 ceases to exist on the page completely. pure Angular 2, Angular 1 ceases to exist on the page completely.
At this point we need to tell Protractor that it should not be looking for At this point we need to tell Protractor that it should not be looking for
an Angular 1 app anymore, but instead it should find *Angular 2 apps* from an Angular 1 app anymore, but instead it should find *Angular 2 apps* from