angular-docs-cn/aio/content
George Kalpakas 27562e92db fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941)
Previously, the generated StackBlitz examples as well as the
corresponding downloadable zips for the `http` guide examples were not
correct and thus trying to run the app and/or tests would fail.

This commit fixes the examples:

- Replace `TestBed.inject()` (which was [introduced in v9][1]) with
  `TestBed.get()` (which is available in v8 used in the examples).
  (NOTE: The examples will soon be updated to v9 (as part of
  [FW-1609][2] and switched back to `TestBed.inject()` then.)

- Include `src/app/heroes/hero.ts` in the zip, because it is referenced
  by some of the other files and the compilation fails without it.

- Ensure `src/main-specs.ts` is not included in the zip that does not
  include the tests. Including the file broke the app, because there is
  logic in our zip-builder that renamed `main-*.ts` files to `main.ts`
  and thus `main-specs.ts` ended up overwriting the actual `main.ts`.

[1]: https://next.angular.io/guide/deprecations#angularcoretesting
[2]: https://angular-team.atlassian.net/browse/FW-1609

Fixes #33874
Fixes #33945

PR Close #33941
2019-11-20 14:44:31 -08:00
..
cli refactor(docs-infra): remove obsolete `format` attribute from code examples (#31674) 2019-07-24 14:38:54 -07:00
cli-src build(docs-infra): make the git ref for cli command docs configurable (#26391) 2018-10-11 12:57:49 -07:00
examples fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941) 2019-11-20 14:44:31 -08:00
guide docs: add version requirement for routing option (#33909) 2019-11-19 11:40:03 -08:00
images docs: clarify status of sample app in stackblitz (#33574) 2019-11-06 19:39:12 +00:00
marketing docs: Hyperlink to HTML & CSS (#33844) 2019-11-15 10:36:18 -08:00
start feat(docs-infra): simplify image styles and remove figure references (#33748) 2019-11-14 09:27:02 -08:00
tutorial feat(docs-infra): simplify image styles and remove figure references (#33748) 2019-11-14 09:27:02 -08:00
file-not-found.md fix(docs-infra): do not create an anchor for the `file-not-found` header (#27250) 2018-12-05 13:26:26 -08:00
license.md build: bump year (#27880) 2019-01-11 11:15:59 -08:00
navigation.json docs: add template type-checking guide (#33421) 2019-10-30 13:49:18 -07:00