Commit Graph

613 Commits

Author SHA1 Message Date
Pete Bacon Darwin e06f1960f4 docs: migrate example to use non-legacy message IDs (#41689)
From 11.x, new projects are set up to use the latest message ID format.
This commit updates the i18n example project to stop using legacy IDs.

PR Close #41689
2021-04-19 14:18:51 -07:00
Bendik Skarpnes 5e343173e8 docs: fix styling issues in example CSS (#41222)
PR Close #41222
2021-04-19 14:15:45 -07:00
aschaap 5e8dcfd641 docs(docs-infra): fix (+) not accepting null error by using `Number` instead (#41570)
Fix unexpected error when following the tutorial (when going through it with stricter type checking enforced). While (+) converts a string to an integer, it does not account for the possibility that `this.route.snapshot.paramMap.get('id')` could return null (type: string | null). Since this null case is not a practical outcome, it is a matter of types; switching from (+) to the `Number` function eliminates this issue, making the tutorial more robust.
PR Close #41570
2021-04-12 21:08:21 -07:00
Alan Cohen 319da894be docs: change ActivatedRouteStub code sample to work with strictNullChecks on (#41559)
convertToParamMap() does not accept undefined.
Fix code sample so it can be used in strict mode without requiring changes.

PR Close #41559
2021-04-12 21:01:39 -07:00
Paul Muriel Biya-Bi 5a81490554 docs: use the right tag in the HeroesComponent's template snippet (#41473)
Based on the tutorial content of the Hero Editor, the tag to be used in
HeroesComponent's template snippet should be h2 and not h3.

PR Close #41473
2021-04-07 11:51:37 -07:00
Kapunahele Wong e340d190bd docs: add some boilerplate button, h3, and hr styles (#41052)
PR Close #41052
2021-03-23 09:37:59 -07:00
MariosRadis ed5bfe8173 docs: simplify deleteHero method in tutorial (#41303)
Fixes #41233

PR Close #41303
2021-03-22 08:54:53 -07:00
George Kalpakas e23994191c docs: make `HeroService#gerHero()` in `toh-pt5` compatible with TS strict mode (#41234)
Fixes #41207

PR Close #41234
2021-03-18 10:00:52 -07:00
George Kalpakas 6d47b05b5b docs: align `toh-pt5` code with `toh-pt4` (#41234)
This commit aligns the code of `HeroService` `getHeroes()` and
`getHero()` methods in `toh-pt5` with that of `toh-pt4`. I.e. it applies
the changes from #40419 to `toh-pt5`.

PR Close #41234
2021-03-18 10:00:52 -07:00
Kristiyan Kostadinov 59ef40988e feat(core): support TypeScript 4.2 (#41158)
Updates the repo to TypeScript 4.2 and tslib 2.1.0.

PR Close #41158
2021-03-17 09:10:25 -07:00
Gérôme Grignon 7d5b60e409 docs: remove unused attribute (#41211)
Fixes #41210

PR Close #41211
2021-03-16 14:48:52 -07:00
pniedermeyer 4c79b8a644 docs: Remove of unnecessary Input (#41150)
remove unnecessary Input

PR Close #41150
2021-03-10 11:20:01 -08:00
Aristeidis Bampakos a730315fb2 docs: use double quotes in Tour of Heroes (pt1) (#41134)
Use double quotes to be consistent across the component template

PR Close #41134
2021-03-09 08:56:50 -08:00
Quentin Monmert c676ec1ce5 docs: fix some typos in angular.io examples (#41093)
This commit updates example code to make the spacing more consistent.

PR Close #41093
2021-03-05 15:08:11 -08:00
Carl Fredrik Samson e7453f15d5 docs: fix issue #40941 (#40942)
setting the `hero` property as an optional property fixes the compilation
error: `Property 'hero' has no initializer and is not definitely assigned
in the constructor` when having the ts transpiler set to "strict" mode.

PR Close #40942
2021-03-05 09:47:44 -08:00
Kapunahele Wong 6c783c7fcb docs: rewrite structural-directives.md (#40015)
PR Close #40015
2021-03-01 15:32:26 -08:00
Kapunahele Wong 356d9a0537 docs: improve contrast of colors and body padding in boilerplate CSS (#40890)
Shifts colors to pass WebAIM contrast checker and adds media
query so that body padding is smaller at smaller widths.
Body padding responsiveness will help on StackBlitz and small
screens.

PR Close #40890
2021-03-01 15:30:32 -08:00
Pete Bacon Darwin 4859c0947a build(docs-infra): implement full template checking for examples (#40930)
This commit turns on full template type checking and fixes the examples
that had errors.

PR Close #40930
2021-02-26 15:40:44 -08:00
Alan Agius d51d39cb4c docs: update docs to use new zone.js entry-points (#40823)
In CLI version 12, the old style of imports is no longer supported.

PR Close #40823
2021-02-24 07:58:29 -08:00
Carl Fredrik Samson 03de2f2b78 docs: fix ch 4 so it compiles in strict mode (#40970)
Fixes error: `TS2564: Property 'heroes' has no initializer and is not definitely assigned in the constructor`
and makes `hero` property consistent with ch 3 (ref: #40942)

PR Close #40970
2021-02-24 07:57:53 -08:00
Kapunahele Wong 06d3267824 docs: improve accessibility for toh-pt1 example (#40560)
PR Close #40560
2021-02-23 10:41:56 -08:00
Kapunahele Wong 1f91672d50 docs: improve accessibility of toh2 example (#40575)
Increases contrast of example copy.
Explicitly references inputs from labels.
Updates screenshot of styles that aren't accessible.
Removes the term master.
Provides more detailed alternate text for the image.
Adds padding to input so it is an easier target for touch or pointer.

PR Close #40575
2021-02-23 10:41:05 -08:00
Kapunahele Wong 1f7921be33 docs: improve accessibility of tohpt3 (#40617)
PR Close #40617
2021-02-23 10:40:09 -08:00
Kapunahele Wong bd6f377db2 docs: improve accessibility of tohpt4 (#40622)
PR Close #40622
2021-02-23 10:39:44 -08:00
Kapunahele Wong 4d1299bd82 docs: improve accessibility of toh-pt5 example (#40632)
PR Close #40632
2021-02-23 10:39:13 -08:00
Kapunahele Wong edd26a2b79 docs: improve accessibility of toh-pt6 (#40805)
PR Close #40805
2021-02-23 10:38:50 -08:00
Kapunahele Wong 49e02ca7d6 docs: move JsonParser class above CustomJsonInterceptor (#40964)
This move fixes the error in StackBlitz of
Cannot access 'JsonParser' before initialization

PR Close #40964
2021-02-23 10:37:26 -08:00
Kapunahele Wong 30d5e25a28 docs: edit attribute-directives.md, move best practice to styleguide (#39849)
PR Close #39849
2021-02-19 08:14:54 -08:00
David Shevitz 8658cd59b2 docs: add what is angular topic (#40811)
PR Close #40811
2021-02-17 11:13:21 -08:00
Pete Bacon Darwin 322951af49 refactor(compiler-cli): error on cyclic imports in partial compilation (#40782)
Our approach for handling cyclic imports results in code that is
not easy to tree-shake, so it is not suitable for publishing in a
library.

When compiling in partial compilation mode, we are targeting
such library publication, so we now create a fatal diagnostic
error instead of trying to handle the cyclic import situation.

Closes #40678

PR Close #40782
2021-02-17 06:53:38 -08:00
Kapunahele Wong 75db0c7445 docs: edit builtin-directives doc (#39816)
Edit built-in-directives.md copy and headers, fixes affected
links, adds a docregion to make steps clearer.

PR Close #39816
2021-02-16 13:04:41 -08:00
Alexey Elin dd3dd63845 docs: use shorthand background CSS property in Routing example (#40834)
PR Close #40834
2021-02-16 09:26:26 -08:00
Pete Bacon Darwin d6440c1808 docs: fix missing code line from tutorial example (#40789)
In #40419 we move the code that creates the `heroes` object
above the code that updates the message service. But this moved
that line of code outside of the docregion that is displayed in
the tutorial ealier on, making it non-sensical.

This commit ensures that this line of code is now rendered in the
tutorial be moving it within the correct docregion.

Closes #40788

PR Close #40789
2021-02-16 08:40:26 -08:00
Pete Bacon Darwin 529f0a83cb docs(http): add custom JSONParser example (#40645)
Update the HTTP guide and associated example to demonstrate
how an interceptor can be used to provide a custom JSON parser.

Resolves #21079

PR Close #40645
2021-02-16 08:03:33 -08:00
Dan Levy 72db3e8d54 docs: add camelCase example to style notation (#40699)
PR Close #40699
2021-02-16 07:59:40 -08:00
mgechev 72a00dcc6b docs: add a style recommendation for initializing inputs (#40698)
This practice is to better align with `strictPropertyInitialization`
which is coming by default with strict mode in v12.

PR Close #40698
2021-02-12 17:07:30 -08:00
Valerij Dobler 2a851c0924 docs: edit example to fetch hero before sending message (#40419)
PR Close #40419
2021-02-09 14:46:18 -08:00
Kapunahele Wong f76f2eb381 docs: update docs-style-guide (#36281)
This commit updates the documentation style guide
so that it is in line with current standards, those
of Google as well as those within the Angular docs.

PR Close #36281
2021-02-09 14:26:06 -08:00
hilmer-martin e3213f6783 docs: changes for typescript 2.7 (#40735)
Because of changes in Typescript a property must have an initializer
or be set to undefined.

PR Close #40735
2021-02-09 10:52:44 -08:00
S. Iftekhar Hossain 365ac5e68e docs: fixed issue with missing code sample by rearranging import to proper docregion (#40565)
Fixes #40558

PR Close #40565
2021-01-26 09:17:28 -08:00
Wataru.Kasahara 956f75f068 docs: fix the docs because the interface does not exist (#40308)
PR Close #40308
2021-01-25 16:29:13 -08:00
Justin Santa Barbara a78493ffd7 docs: Fix syntax in interpolation example (#40554)
Correcting a typo in the example.
PR Close #40554
2021-01-25 09:59:50 -08:00
Kapunahele Wong 51d6aed677 docs: clarify name collision info, add example snippet, and fix example CSS (#40451)
Fixes #40403 and fixes imgs and layout of example
that are unrestrained and thus are too big in StackBlitz.

PR Close #40451
2021-01-20 16:13:43 -08:00
Pete Bacon Darwin 315b272f9f docs: add missing type parameter to testing example (#40479)
Without this type parameter the call to `resolve()` is invalid.

PR Close #40479
2021-01-20 16:12:15 -08:00
Pete Bacon Darwin 4a9f7daf37 docs: remove unused "docregions" (#40479)
This commit removes all the docregion tags in examples that are not
being referenced in any doc.

PR Close #40479
2021-01-20 16:12:15 -08:00
abarghoud 2c95f57266 feat(docs-infra): use Record type instead of key-value (#40463)
use Record type instead of key-value

Closes #39804

PR Close #40463
2021-01-19 09:21:23 -08:00
Bill Ludwig 5013a7e12d docs: update identity-revealed.directive.ts to use `AbstractControl` instead of `FormGroup` (#40132)
Changes example code to accept an `AbstractControl` instead of `FormGroup` in
`identityRevealedValidator` function.

Closes #40131.

PR Close #40132
2021-01-13 14:47:53 -08:00
Kapunahele Wong 184d0e568f docs: edit getting started start-forms.md (#39681)
PR Close #39681
2021-01-11 15:34:12 -08:00
Alexey Elin aea265bfc5 docs: lifecycle-hooks example - extract things (components, directives) into their own files (#40212)
This change is in line with Angular Style Guide rule 01-01
https://angular.io/guide/styleguide#style-01-01.

PR Close #40212
2021-01-07 13:10:41 -08:00
George Kalpakas 1e151f9fe4 docs: fix instructions for setting up `ProductDetailsComponent` in `start-routing.md` (#40197)
PR #34934 switched the `getting-started` docs example from using the
index of a product in the `products` array to using the product's ID
property for indentifiying each product in the `ProductDetailsComponent`
component. However, some necessary changes in the example code and the
`start-routing.md` guide were missed in #34934, resulting in broken
instructions for the readers (see #40189).

This commit is essentially a follow-up to #34934, making the remaining
changes in the example code and the guide instructions.

Fixes #40189

PR Close #40197
2021-01-06 13:54:54 -08:00
George Kalpakas d08828339b docs: refactor code in `get-product` docregion of `getting-started` docs example (#40197)
This commit slightly refactors the code in the `get-product` docregion
of the `getting-started` docs example to make it easier to follow.

PR Close #40197
2021-01-06 13:54:54 -08:00
George Kalpakas 1d78d4d774 docs: clean up docregions in the `getting-started` docs example (#40197)
This commit does some minor clean-up in docregions of the
`getting-started` docs example. More specifically, it:
- Removes redundant docregion markers.
- Fixes whitespace inconsistencies.
- Adds `/* ... */` to indicate that there is more code before the end of
  a docregion (in order to avoid confusion).

PR Close #40197
2021-01-06 13:54:54 -08:00
George Kalpakas 1fae285e04 docs: more closely align the `getting-started-v0` and `getting-started` docs examples (#40197)
This commit aligns the code and style in the `getting-started-v0` docs
example with that of the `getting-started` example more closely (except
for the the parts that are intentionally different between the two).

PR Close #40197
2021-01-06 13:54:54 -08:00
Alexey Elin f846c093b1 docs: specify fallback generic font family (#40254)
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
"You should always include at least one generic family name in a font-family list,
 since there's no guarantee that any given font is available. This lets the browser
 select an acceptable fallback font when necessary."

PR Close #40254
2021-01-06 07:09:27 -08:00
George Kalpakas 5ba7bcd2a6 docs: fix `SpyDirective` in `lifecycle-hooks` docs example to use one ID per instance (#40208)
Previously, the `SpyDirective` in the `lifecycle-hooks` docs example
would use a different ID when logging `onInit` and when logging
`onDestroy` for the same instance, making it impossible to associate the
two calls. This was not helpful and came in constrast with how the
directive was described in the corresponding guide and shown in the
accompanying `spy-directive.gif` image.

This commit fixes the logic of the `SpyDirective` class to use the same
ID for all log operations of an instance.

Partially addresses #40193.

PR Close #40208
2020-12-21 14:22:15 -08:00
George Kalpakas e28d460307 docs: make the `spy-directive` docregion (in `lifecycle-hooks` example) easier to follow (#40208)
Previously, the docregion code referenced a `nextId` variable that was
not shown in the code, which was confusing for the reader.

This commit makes the declaration of the `nextId` variable part of the
docregion, so it is clear to the reader where it comes from and how it
is initialized.
This commit also removes the `logIt()` helper method, which didn't seem
to add value and calls `logger.log()` directly instead.

PR Close #40208
2020-12-21 14:22:15 -08:00
George Kalpakas 251b27701f docs: fix the order of links in `lifecycle-hooks` docs example (#40208)
This commit aligns the order of the links to the various sections of the
`lifecycle-hooks` docs example with the order in which the sections
appear in the template (which also coincides with the order in which
they are presented/discussed in the corresponding guide).

PR Close #40208
2020-12-21 14:22:15 -08:00
Troels Lenda 362f45c4bf docs: use an explicit product id in the getting started example (#34934)
Simplyfing the example by prodiving an id for each
product instead of relying on their index in the array.

Closes #34738

PR Close #34934
2020-12-17 12:02:10 -08:00
Alexey Elin 4f4f318d28 docs: remove prefixed animation related CSS properties (#40084)
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard CSS properties:
* @keyframes rule
* animation

PR Close #40084
2020-12-14 11:36:48 -08:00
Alexey Elin 1e05109f17 docs: remove unused CSS rule (#40080)
Removed rule don't affect their component views.
The reason - the templates don't contain elements to which that rule is applied.
See https://angular.io/guide/view-encapsulation for more details

PR Close #40080
2020-12-14 11:35:36 -08:00
Alexey Elin b08fd0c18c docs: remove unused CSS rules (#40069)
Removed rules don't affect their component views.
The reason - the templates don't contain elements to which that rules are applied.
See https://angular.io/guide/view-encapsulation for more details

PR Close #40069
2020-12-10 14:30:17 -08:00
Alexey Elin 91fb830c86 docs: remove prefixed border-radius related properties (#40066)
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard CSS properties:
* border-radius
* border-bottom-left-radius
* border-bottom-right-radius

PR Close #40066
2020-12-10 14:29:39 -08:00
Alexey Elin 76e3de253c docs: remove -webkit-box-sizing and -moz-box-sizing (#40039)
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard box-sizing CSS property

PR Close #40039
2020-12-10 13:38:19 -08:00
Amadou Sall 29298f4f3d docs: fix the code sample displayed in the "reusable animations" guide (#37262)
Currently the code sample displayed in this guide is not a valid.
The `trigger` is directly used in the `@Component` decorator.
It should instead be in the `animations` array of the `@Component` decorator.

PR Close #37262
2020-12-10 11:03:32 -08:00
Alexey Elin 13dfef14dc docs: remove cursor: hand (#39918)
PR Close #39918
2020-12-09 09:04:54 -08:00
profanis e8d2348e21 docs: how to create a custom Attribute decorator in a child component and use it from a parent component (#38721)
Aside from using the @input() decorator, we can use the @Attrbitute decorator too.
Of course, those two are different and support different causes.
I expected to see a working example on the Attribute Bindings section, but I didn't find one.
This PR depicts the usage of the Attribute decorator between two components

PR Close #38721
2020-12-08 08:52:25 -08:00
Alexey Elin 775394c809 docs: use double colon for pseudo-elements (#40004)
The double colon helps to distinguish between pseudo-classes and pseudo-elements.
https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

PR Close #40004
2020-12-07 09:49:46 -08:00
Kapunahele Wong 0b5b24abd7 docs: edit interpolation doc (#38687)
This commit edits the copy on the interpolation page.
Tightens language, clarifies headers, and streamlines text.
There are no content or code changes.

PR Close #38687
2020-12-01 10:15:00 -08:00
Kapunahele Wong 1de59d2818 docs: edit step 2 of getting started start-routing.md (#39593)
PR Close #39593
2020-11-30 15:00:38 -08:00
Kapunahele Wong 93d689ffa8 docs: edit dependency-injection.md (#39255)
PR Close #39255
2020-11-30 11:03:59 -08:00
George Kalpakas 23c36a24ed test(docs-infra): disable the Selenium Promise Manager in docs examples e2e tests (#39818)
This commit disables the Selenium Promise Manager when running e2e tests
for docs examples in order to more closely align them with new apps
created with CLI v11. This change requires that any async operations in
tests are handled explicitly (e.g. using `async/await` or
`Promise#then()`).

PR Close #39818
2020-11-24 14:56:14 -08:00
George Kalpakas 1fd09277a6 test(docs-infra): remove redundant code from `upgrade-module` e2e tests (#39818)
This commit removes some code that is no longer necessary for the
`upgrade-module` docs example e2e tests to run. It used to be necessary
in earlier version of Protractor but not any more.

PR Close #39818
2020-11-24 14:56:13 -08:00
George Kalpakas 4dba9fa530 test(docs-infra): fix the `dependency-injection-in-action` e2e tests (#39818)
Previously, the tests made no meaningful assertions. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
2020-11-24 14:56:12 -08:00
George Kalpakas c7605ccf05 test(docs-infra): fix the `dynamic-component-loader` e2e tests (#39818)
Previously, the test made no meaningful assertion. It seems that the
intention was to ensure that some elements were present on the page, but
all the assertions did was verify that the corresponding
`ElementFinder`s were defined. The `ElementFinder`s would always be
defined, even if there were no corresponding elements on the page. In
fact, some of the `ElementFinder` selectors were incorrect, so they did
not match any actual elements.

This commit fixes the tests by fixing the `ElementFinder` selectors and
asserting that the elements are actually present on the page.

PR Close #39818
2020-11-24 14:56:10 -08:00
George Kalpakas 3d2c2c40d8 build(docs-infra): update docs examples to Angular v11.0.1 (#39818)
This commit updates the docs examples to Angular v11.0.1. In addition to
updating the dependencies versions, it also updates the project's
structure and config to more closely match what a new v11 CLI app would
look like. See, also, the [diff][1] between a basic v10.1.3 CLI app and a
v11.0.2 one.

NOTE:
I refrained from disabling the Selenium Promise Manager (as seen
[here][2]) and switching all e2e tests to `async/await`, because that is
a big change and should be done in a separate commit/PR.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3..11.0.2
[2]:
https://github.com/cexbrayat/angular-cli-diff/compare/10.1.3...11.0.2#diff-dbd675d74087d57cd084d6dd6ae24ae2eeff2ff0122680e12916052f8a843a29

PR Close #39818
2020-11-24 14:56:09 -08:00
Kapunahele Wong 2c275f6d7a docs: archive template expression operators doc, move pipes precedence section (#39170)
Archives most of the content in the template expression operators doc.
The pipes precedence section that was originally in
template expression operators moves into the pipes doc
with some editing and an addition of a ternary example.

PR Close #39170
2020-11-24 08:41:18 -08:00
Marcono1234 3e1e5a15ba docs: update links to use HTTPS as protocol (#39718)
PR Close #39718
2020-11-20 12:52:16 -08:00
andyg3 e2ce9af115 docs: update /deep/ to ::ng-deep in component styles example (#32398)
Update example because ::ng-deep is the preferred syntax.

PR Close #32398
2020-11-20 12:48:14 -08:00
Kapunahele Wong 156f9f30ae docs: edit di providers doc (#39403)
Edits copy and removes tokens and treeshaking
sections to reduce content duplication and keep
info focused. Moves provideParent() from di-navtree
to di providers.

PR Close #39403
2020-11-20 09:24:51 -08:00
Jacob Foshee fe1ada86e8 docs: add missing return to example storage.service.ts (#31434)
While JavaScript does support implicit returns, it seems TypeScript will not infer the function return type from
the implicit return of the last statement (at least not in TS 3.4.3). So, when the `return` is missing from the
`get` function the implicit type of the function is `void`. So for the `get` function to be usable it needs to an
explicit return.

PR Close #31434
2020-11-20 08:28:56 -08:00
Ajit Singh 806d7aa22c docs: add documentation for ngNonBindable (#36560)
ngNonBindable documentation was not present, on docs site added documentation for ngNonBindable. With this template primitive, Angular won't
evaluate expressions in elements.

Fixes #28577 Fixes #19497

PR Close #36560
2020-11-17 11:56:46 -08:00
Kapunahele Wong a87236292e docs: edit two-way binding doc (#38952)
This commit edits copy and doc regions to clarify concepts.

PR Close #38952
2020-11-12 13:50:51 -08:00
Kapunahele Wong e3d2f46bbd docs: move template ref vars doc to concepts section clarify, add scope section, and update headers (#31195)
Fixes #31186. This commit adds more context about the behavior
of template reference variables in nested templates and moves
doc into concepts section.

PR Close #31195
2020-10-28 14:41:44 -07:00
Aristeidis Bampakos cf60e0e889 docs: use SimpleChanges in component interaction guide (#39342)
Use the SimpleChanges interface in the example of component interaction guide

PR Close #39342
2020-10-26 10:47:31 -07:00
Kapunahele Wong 3e6f24edcd docs: edit property binding doc (#38799)
This commit edits the property binding doc copy and adds some
docregions to clarify explanations.

PR Close #38799
2020-10-21 08:23:42 -07:00
Dave Shevitz a67895cee3 docs: Add Component Overview topic to angular.io (#39186)
PR Close #39186
2020-10-20 10:47:44 -07:00
Vlasis Charalampous 79d67dc1f4 refactor(docs-infra): fix `strictTemplates` failures in `accessibility` docs example (#39248)
fix `strictTemplates` failures in `accessibility` docs example

PR Close #39248
2020-10-16 16:09:07 -07:00
Kapunahele Wong 4dc8d83d84 docs: edit attribute-binding doc and move colSpan note to property binding (#38860)
This commit edits the copy of the attribute binding documentation, moves the
colspan section that is primarily about property binding to the property
binding document, and adds a docregion to the attribute-binding
example to help clarify a point in the document.
Part of the copy edit reformats the style precedence list in tabular format
so that it is easier to read and understand.

PR Close #38860
2020-10-16 10:06:16 -07:00
Pete Bacon Darwin 34b74cecb6 build(docs-infra): add a tool to create new examples (#39283)
This tool can be run from anywhere in the aio folder as:

```sh
yarn create-example <example-name>
```

It will create some basic scaffold files to get the example started.
After creation the developer should then use `yarn boilerplate:add`
or similar to ensure that the example can be run and tested.

You can optionally provide an absolute path to a pre-existing CLI
project and it will copy over appropriate files (ignoring boilerplate)
to the newly created example.

```sh
yarn create-example <example-name> /path/to/other/cli/project
```

Fixes #39275

PR Close #39283
2020-10-16 08:14:38 -07:00
Nicholas Papadopoulos 7669827436 docs: fix typo at console.log (#39252)
PR Close #39252
2020-10-15 14:15:36 -07:00
Kristiyan Kostadinov 4a1c12c773 feat(core): remove ViewEncapsulation.Native (#38882)
Removes `ViewEncapsulation.Native` which has been deprecated for several major versions.

BREAKING CHANGES:
* `ViewEncapsulation.Native` has been removed. Use `ViewEncapsulation.ShadowDom` instead. Existing
usages will be updated automatically by `ng update`.

PR Close #38882
2020-10-08 11:56:03 -07:00
George Kalpakas 53a7ed4317 test(docs-infra): fix and enable remaining `component-interaction` e2e tests (#39001)
Previously, some of the e2e tests of the `component-interaction` docs
example were disabled because they were failing.

This commit fixes and re-enables them.

PR Close #39001
2020-09-28 16:26:32 -04:00
George Kalpakas 2df39ee338 refactor(docs-infra): minor refactoring of the `component-interaction` e2e tests (#39001)
This commit refactors the e2e tests of the `component-interaction` docs
example to improve readability and make them easier to maintain.

Changes include:
- Switch from `element.all().get(0)` to `element()` when there is only
  one such element on the page.
- Switch from `Promise#then()` to `async/await`.
- Move `ElementFinder`s at the top of the test (instead of having them
  interleaved with expectations).
- Load the page before every test (i.e. in a `beforeEach()` instead of
  `beforeAll()`) to prevent state from each test leaking into the
  subsequent tests.
- Order imports alphabetically.

PR Close #39001
2020-09-28 16:26:32 -04:00
George Kalpakas 2b6b9c95f9 fix(docs-infra): fix the `component-interaction` example e2e tests to run in prod mode (#39001)
Previously, the `component-interaction` docs example was configured to
run e2e tests on CI in development mode (in contrast to the default for
all docs examples, which is to run e2e tests in production mode). This
was necessary due to the following reasons:
- One of the components, `CountdownTimerComponent`, which is used by
  `CountdownLocalVarParentComponent` and
  `CountdownViewChildParentComponent`, was triggering a periodic
  asynchronous task (via `setInterval()`), which prevented the app from
  stabilizing and caused tests to fail.
- In order to prevent this from happening, the example's `AppModule` had
  special provisioning to not include the problematic components in its
  declarations when testing.
- Since this had to be determined dynamically at runtime (via inspecting
  the URL query params), the `AppModule`'s config could not be
  statically evaluated in AOT compilation.

This commit fixes the example to make it compatible with AOT compilation
and removes the custom test command from its `example-config.json`
(allowing it to be run with the default e2e test command, i.e. in
production mode).

PR Close #39001
2020-09-28 16:26:32 -04:00
George Kalpakas c5e178997c build(docs-infra): update docs examples to Angular v10 (#38993)
This commit updates the docs examples to Angular v10.1.3. In addition to
updating the dependencies versions, it also updates the project's
structure and config to more closely match what a new v10 CLI app would
look like. See, also, the [diff][1] between a basic v9.1.4 CLI app and a
v10.1.3 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/9.1.4..10.1.3

PR Close #38993
2020-09-28 16:24:59 -04:00
George Kalpakas e459dc7c42 test(docs-infra): add missing test for the `rx-library` docs example (#38905)
This commit adds an extra test for the `retry-on-error` snippet of the
`rx-library` docs example to ensure it can successfully recover after a
couple of failed attempts.

This commit addresses comment
https://github.com/angular/angular/pull/38905#discussion_r491494196.

PR Close #38905
2020-09-28 16:20:11 -04:00
Sonu Kapoor fd7146cc71 test(docs-infra): add unit tests for rx-library examples (#38905)
This commit adds missing unit tests for all rx-library examples from the docs.

Closes #28017

PR Close #38905
2020-09-28 16:20:11 -04:00
Sonu Kapoor 5ef2c983b9 fix(docs-infra): fix the retry-on-error example (#38905)
Previously, the `retry` example did not work as intended. The `retry`
operator was called before the exception occured, thus not retrying the
`ajax` request.

This commit moves the `retry` operator into the correct order to ensure
that the failed request is retried.

PR Close #38905
2020-09-28 16:20:11 -04:00
Sonu Kapoor 8422633b8a test(docs-infra): add missing unit tests for backoff example (#38896)
This commit adds the missing unit test for the backoff example.

PR Close #38896
2020-09-24 11:33:20 -04:00
Sonu Kapoor 37297cfed7 fix(docs-infra): fix the backoff example (#38896)
Previously, the `backoff()` example did not work as intended. More
specifically, the `range(1, maxTries)` observable would complete
immediately after emitting the `maxTries`th value, causing the overall
observable to also complete. As a result, it would only make
`maxTries - 1` attempts to recover from an error. More importantly, the
outer observable would complete successfully instead of erroring.

This commit fixes the `backoff()` operator by ensuring it makes exactly
`maxTries` attempts to recover and it propagates the actual error to the
outer observable.

The test for this change is added in the next commit.

PR Close #38896
2020-09-24 11:33:20 -04:00