angular-cn/aio/content/examples/http/src
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
..
app fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941) 2019-11-20 14:44:31 -08:00
assets docs: add http guide sample and adjust text (#21326) 2018-01-31 10:24:43 -08:00
testing fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941) 2019-11-20 14:44:31 -08:00
browser-test-shim.js docs: migrate examples from @angular/http to @angular/common/http (#28296) 2019-03-11 10:52:17 -07:00
index-specs.html Revert "docs: add testing styles in index.html, remove additional configuration" (#25892) 2018-10-09 17:04:19 -07:00
index.html docs: add http guide sample and adjust text (#21326) 2018-01-31 10:24:43 -08:00
main-specs.ts build: upgrade zone.js (#23108) 2018-04-04 08:24:02 -07:00
main.ts fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941) 2019-11-20 14:44:31 -08:00
test.css Revert "docs: add testing styles in index.html, remove additional configuration" (#25892) 2018-10-09 17:04:19 -07:00