angular-docs-cn/aio/content/examples
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
..
accessibility docs: port accessibility app from stackblitz to aio (#32377) 2019-09-10 13:11:48 -04:00
ajs-quick-reference docs: remove gender prefixes from examples (#29972) 2019-05-20 16:42:59 -07:00
animations docs: remove erroneous brack in animations guide (#33525) 2019-11-01 22:27:40 +00:00
architecture docs: update example references from "my-app" to "app-root" (#30789) 2019-06-03 08:55:39 -07:00
attribute-binding docs: rewrite attribute binding section and add example (#26004) 2019-06-14 12:21:28 -07:00
attribute-directives ci(docs-infra): increase waiting time to reduce flakiness on CI (#31408) 2019-07-09 09:35:54 -07:00
binding-syntax test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
bootstrapping docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
built-in-directives docs: include svg files in stackblitz and download examples (#31559) 2019-07-15 16:48:23 -04:00
built-in-template-functions docs: edit $any() section and add example in Template Syntax (#28157) 2019-03-19 13:19:17 -04:00
component-interaction test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
component-styles docs(aio): Upgrade examples to Angular 6 (#23234) 2018-04-17 14:09:02 -07:00
dependency-injection docs: remove gender prefixes from examples (#29972) 2019-05-20 16:42:59 -07:00
dependency-injection-in-action docs: remove gender prefixes from examples (#29972) 2019-05-20 16:42:59 -07:00
displaying-data docs: rename component for constructor example (#30845) 2019-06-04 11:52:57 -07:00
docs-style-guide docs: remove gender prefixes from examples (#29972) 2019-05-20 16:42:59 -07:00
dynamic-component-loader docs: use const in dynamic-component-loader example (#30888) 2019-06-11 14:20:00 -07:00
dynamic-form docs: updated dynamic forms example (#31510) 2019-11-15 16:16:45 -08:00
elements docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
event-binding docs(core): fix typo in event-binding code example (#31611) 2019-07-17 13:26:48 -04:00
feature-modules docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
form-validation docs(aio): add async validation chapter (#25189) 2018-08-10 09:14:25 -07:00
forms docs: removed unused pull-left classes from hero form component (#26178) 2018-11-09 10:23:17 -08:00
forms-overview docs: remove unused properties from forms overview example (#25663) 2018-09-25 18:48:15 -07:00
getting-started docs: Use ngOnInit to fetch data from services in the getting started guide (#32273) 2019-08-27 09:08:25 -07:00
getting-started-v0 docs: add new getting started guide (#27684) 2019-03-29 10:47:37 -07:00
hierarchical-dependency-injection docs: edit and organize di guide (#21915) 2018-08-30 13:15:47 -04:00
http fix(docs-infra): fix StackBlitz and zipped `http` examples (#33941) 2019-11-20 14:44:31 -08:00
i18n docs: update i18n docs sample to cater for latest raw-loader version (#32334) 2019-08-27 09:06:51 -07:00
inputs-outputs docs: rewrite inputs/outputs section of Template Syntax (#27685) 2019-06-14 11:53:13 -07:00
interpolation docs: edit $any() section and add example in Template Syntax (#28157) 2019-03-19 13:19:17 -04:00
lazy-loading-ngmodules docs: update Stackblitz example for lazy-loading (#33070) 2019-10-10 15:17:32 -07:00
lifecycle-hooks test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
ngcontainer docs: update example references from "my-app" to "app-root" (#30789) 2019-06-03 08:55:39 -07:00
ngmodule-faq/src/app docs: remove coremodule references (#28434) 2019-03-29 10:29:51 -07:00
ngmodules docs: add correct default cli ngModule (#31166) 2019-07-08 10:25:57 -07:00
observables docs: update docs to reflect the changes in RxJS 6 (#26238) 2018-10-08 13:43:12 -07:00
observables-in-angular docs: minor wording change in code example comment (#26835) 2019-01-14 10:31:23 -08:00
pipes docs: correct types in transform method to match specification. (#29812) 2019-05-15 14:24:20 -07:00
practical-observable-usage docs: use static zip function as an Observable creator. (#26790) 2019-01-08 17:16:45 -08:00
property-binding docs: rewrite property binding section and add example (#25770) 2019-06-14 11:47:34 -07:00
providers docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
providers-viewproviders docs: edit copy and example in hierarchical injectors guide (#32501) 2019-09-06 18:28:42 -04:00
reactive-forms docs: update shared example dependencies to Angular 7 and CLI 7 (#25892) 2018-10-09 17:04:19 -07:00
resolution-modifiers docs: clarify hierarchical injectors (#28700) 2019-08-15 12:43:51 -07:00
router docs: use dynamic import syntax in examples using lazy loading (#30563) 2019-05-21 09:09:35 -07:00
rx-library style(docs-infra): fix indentation in `rx-library` example (#31553) 2019-07-15 12:13:19 -04:00
schematics-for-libraries refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
security test(core): fix security example e2e test (#26777) 2018-10-26 12:31:49 -04:00
service-worker-getting-started docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
set-document-title docs(aio): Upgrade examples to Angular 6 (#23234) 2018-04-17 14:09:02 -07:00
setup build(docs-infra): remove unused StackBlitz/ZIP configurations for `setup` example (#31937) 2019-08-05 09:54:52 -07:00
structural-directives docs: fix typo in structural directive example (#32459) 2019-09-04 11:36:02 -07:00
styleguide docs: update example references from "my-app" to "app-root" (#30789) 2019-06-03 08:55:39 -07:00
template-expression-operators docs: edit and add example for Template Expression Operators section of Template Syntax (#28087) 2019-06-14 11:53:50 -07:00
template-reference-variables test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
template-syntax test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
testing test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
toh-pt0 docs: increase color contrast on elements in tutorial 2019-05-31 15:23:32 -07:00
toh-pt1 docs: add ending slash to input in TOH pt1 and pt2 examples (#29176) 2019-03-08 09:33:57 -08:00
toh-pt2 docs: clarify toh (#28571) 2019-07-22 09:46:27 -07:00
toh-pt3 docs: clarify toh (#28571) 2019-07-22 09:46:27 -07:00
toh-pt4 docs: clarify toh (#28571) 2019-07-22 09:46:27 -07:00
toh-pt5 docs: clarify toh (#28571) 2019-07-22 09:46:27 -07:00
toh-pt6 docs: clarify toh (#28571) 2019-07-22 09:46:27 -07:00
two-way-binding docs: add example and edit two-way-binding section of Template Syntax (#26278) 2019-06-14 11:50:03 -07:00
universal docs: update universal docs for new ivy implementation (#33040) 2019-10-21 11:25:44 -04:00
upgrade-lazy-load-ajs docs: add tests for lazy loading angularjs example (#30622) 2019-06-28 09:26:49 -07:00
upgrade-module docs: migrate examples from @angular/http to @angular/common/http (#28296) 2019-03-11 10:52:17 -07:00
upgrade-phonecat-1-typescript feat: make the Ivy compiler the default for ngc (#32219) 2019-08-20 16:41:08 -07:00
upgrade-phonecat-2-hybrid feat: make the Ivy compiler the default for ngc (#32219) 2019-08-20 16:41:08 -07:00
upgrade-phonecat-3-final feat: make the Ivy compiler the default for ngc (#32219) 2019-08-20 16:41:08 -07:00
user-input docs(docs-infra): use recommended type assertion (#31042) 2019-10-02 13:25:39 -07:00
visual-studio-2015 feat: make the Ivy compiler the default for ngc (#32219) 2019-08-20 16:41:08 -07:00
.gitignore docs: update docs example dependencies to version 8 (#30385) 2019-05-17 14:16:55 -07:00
tsconfig.json build(aio): give intellisense to the examples 2017-04-15 22:15:54 +01:00
tslint.json refactor: remove tslint no-use-before-declare rule (#30288) 2019-05-07 10:25:36 -07:00