Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit f1aa95b

Browse files
committed
docs(prod-deploy): more of Ward's copy edits
1 parent 06ff8e2 commit f1aa95b

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

public/docs/ts/latest/guide/production-deploy.jade

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -214,28 +214,31 @@ a#angular-configuration
214214
:marked
215215
## Angular configuration
216216

217-
## INTRODUCTION NEEDED
217+
Angular configuration can make the difference between whether your app launches quickly or doesn't load at all.
218218

219219
a#base-tag
220220
:marked
221221
### The `base` tag
222+
223+
The HTML [_<base href="..."/>_](https://angular.io/docs/ts/latest/guide/router.html#!#base-href)
224+
specifies a base path for resolving relative URLs to assets such as images, scripts, and style sheets.
225+
For example, given the `<base href="/myapp/">`, the browser resolves a URL such as `some/place/foo.jpg`
226+
into a server request for `myapp/some/place/foo.jpg`.
227+
During navigation, the Angular router uses the _base href_ as the base path to component, template, and module files.
222228

223-
## FIX THIS PROSE
224-
There is an important configuration item in the Angular Router that needs to be adjusted for
225-
different environments:
226-
[the `base` tags `href` property](https://angular.io/docs/ts/latest/guide/router.html#!#base-href).
227-
This property tells the router what the app root URL is so that the router can match routes.
228-
229-
On your development server, your app is most likely served at the root: `http://localhost:3000/`.
230-
Here you use `<base href="/">`, since `/` is the root of your app.
229+
.l-sub-section
230+
:marked
231+
See also the [*APP_BASE_HREF*](../api/common/index/APP_BASE_HREF-let.html "API: APP_BASE_HREF") alternative.
232+
:marked
233+
In development, you typically start the server in the folder that holds `index.html`.
234+
That's your root folder and you'd add `<base href="/">` near the top of `index.html` because `/` is the root of your app.
231235

232-
But depending on the server setup that you use, the app can be served from a subfolder like
233-
`http://localhost:3000/myapp/` or `http://www.mysite.com/myapp/`, where `/myapp/` is the subfolder.
234-
In this case you should use `<base href="/myapp/">`, since `/myapp/` is the root of your app and
235-
not `/`.
236+
But on your shared or production server, you might serve the app from a subfolder.
237+
For example, when the URL to load the app is something like `http://www.mysite.com/myapp/`,
238+
the subfolder is `myapp/` and you should add `<base href="/myapp/">` to the server version of the `index.html`.
236239

237-
When your `base` tag is misconfigured your browser console will show several errors in the console,
238-
from missing files on wrong paths to router errors about missing routes.
240+
When your `base` tag is misconfigured, the app fails to load and the browser console displays `404 - Not Found` errors
241+
for the missing files. Look at where it _tried_ to find those files and adjust the base tag appropriately.
239242

240243
a#enableProdMode
241244
:marked
@@ -297,6 +300,8 @@ a#server-configuration
297300

298301
### Why fallback to `index.html`?
299302

303+
a#deep-link
304+
:marked
300305
A routed application should support "deep links".
301306
A _deep link_ is a URL that specifies a path to a component inside the app.
302307
For example, `http://www.mysite.com/heroes/42` is a _deep link_ to the hero detail page

0 commit comments

Comments
 (0)