docs(aio): minor fixes for the upgrade guide

Fixes #17093
This commit is contained in:
Georgios Kalpakas 2017-05-30 11:22:06 +03:00 committed by Matias Niemelä
parent b1fe63d081
commit 8b4acbbcbf
4 changed files with 19 additions and 42 deletions

View File

@ -6,8 +6,6 @@ The following changes from vanilla Phonecat are applied:
* Karma config for unit tests is in karma.conf.ajs.js because the boilerplate
Karma config is not compatible with the way AngularJS tests need to be run.
The shell script run-unit-tests.sh can be used to run the unit tests.
* There's a `package.ajs.json`, which is not used to run anything but only to
show an example of changing the PhoneCat http-server root path.
* Also for the Karma shim, there is a `karma-test-shim.1.js` file which isn't
used but is shown in the test appendix.
* Instead of using Bower, AngularJS and its dependencies are fetched from a CDN

View File

@ -1,37 +0,0 @@
{
"name": "angular-phonecat",
"private": true,
"version": "0.0.0",
"description": "A tutorial application for AngularJS",
"repository": "https://github.com/angular/angular-phonecat",
"license": "MIT",
"devDependencies": {
"bower": "^1.7.7",
"http-server": "^0.9.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-firefox-launcher": "^0.1.7",
"karma-jasmine": "^0.3.8",
"protractor": "^3.2.2",
"shelljs": "^0.6.0"
},
"scripts": {
"postinstall": "bower install",
"prestart": "npm install",
"start": "http-server -a localhost -p 8000 -c-1 ./",
"pretest": "npm install",
"test": "karma start karma.conf.js",
"test-single-run": "karma start karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor e2e-tests/protractor.conf.js",
"update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\\n' + sed(/sourceMappingURL=angular-loader.min.js.map/,'sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map','app/bower_components/angular-loader/angular-loader.min.js') + '\\n//@@NG_LOADER_END@@', 'app/index-async.html');\""
}
}

View File

@ -34,6 +34,8 @@ For details about `tsconfig.json`, see the official
The [Setup](guide/setup) guide uses the following `tsconfig.json`:
<code-example path="quickstart/src/tsconfig.1.json" title="tsconfig.json" linenums="false"></code-example>
This file contains options and flags that are essential for Angular applications.

View File

@ -1023,7 +1023,7 @@ a successful upgrade.
Since you're going to be writing Angular code in TypeScript, it makes sense to
bring in the TypeScript compiler even before you begin upgrading.
You'll also start to gradually phase out the Bower package manager in favor
You'll also start to gradually phase out the Bower package manager in favor
of NPM, installing all new dependencies using NPM, and eventually removing Bower from the project.
Begin by installing TypeScript to the project.
@ -1041,11 +1041,21 @@ Jasmine unit test framework.
</code-example>
You should also configure the TypeScript compiler with a `tsconfig.json` in the project directory
as described in the [Setup](guide/setup) guide.
as described in the [TypeScript Configuration](guide/typescript-configuration) guide.
The `tsconfig.json` file tells the TypeScript compiler how to turn your TypeScript files
into ES5 code bundled into CommonJS modules.
Now launch the TypeScript compiler from the command line in watch mode.
Finally, you should add some npm scripts in `package.json` to compile the TypeScript files to
JavaScript (based on the `tsconfig.json` configuration file):
<code-example format="">
"script": {
"tsc": "tsc",
"tsc:w": "tsc -w",
...
</code-example>
Now launch the TypeScript compiler from the command line in watch mode:
<code-example format="">
npm run tsc:w
@ -1192,6 +1202,10 @@ Move the `app/index.html` file to the project root directory. Then change the
development server root path in `package.json` to also point to the project root
instead of `app`:
<code-example format="">
"start": "http-server ./ -a localhost -p 8000 -c-1",
</code-example>
Now you're able to serve everything from the project root to the web browser. But you do *not*
want to have to change all the image and data paths used in the application code to match
the development setup. For that reason, you'll add a `<base>` tag to `index.html`, which will