Commit Graph

29 Commits

Author SHA1 Message Date
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
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 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
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 bfd13c06e1 refactor(docs-infra): fix docs examples for Angular-specific tslint rules (#38143)
This commit updates the docs examples to be compatible with the
following Angular-specific tslint rules:
- `component-selector`
- `directive-selector`
- `no-conflicting-lifecycle`
- `no-host-metadata-property`
- `no-input-rename`
- `no-output-native`
- `no-output-rename`

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:06 -07:00
George Kalpakas 5303773daf refactor(docs-infra): fix docs examples for tslint rule `prefer-const` (#38143)
This commit updates the docs examples to be compatible with the
`prefer-const` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:06 -07:00
George Kalpakas 6334749d2c refactor(docs-infra): fix docs examples for tslint rule `member-ordering` (#38143)
This commit updates the docs examples to be compatible with the
`member-ordering` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:06 -07:00
George Kalpakas 8aa29438ac refactor(docs-infra): fix docs examples for tslint rules related to object properties (#38143)
This commit updates the docs examples to be compatible with the
`no-string-literal`, `object-literal-key-quotes` and
`object-literal-shorthand` tslint rules.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:06 -07:00
George Kalpakas 7c0f11789b style(docs-infra): fix docs examples for tslint rules related to whitespace (#38143)
This commit updates the docs examples to be compatible with the `align`,
`space-before-function-paren` and `typedef-whitespace` tslint rules.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:05 -07:00
George Kalpakas 0a791e4a50 style(docs-infra): fix docs examples for tslint rule `import-spacing` (#38143)
This commit updates the docs examples to be compatible with the
`import-spacing` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
2020-07-31 11:00:05 -07:00
George Kalpakas d89200ad24 refactor(docs-infra): remove unnecessary `use strict` from docs examples TS files (#38143)
By default, TypeScript will emit `"use strict"` directives, so it is not
necessary to include `'use strict'` in `.ts` files:
https://www.typescriptlang.org/docs/handbook/compiler-options.html#:~:text=--noImplicitUseStrict

PR Close #38143
2020-07-31 11:00:05 -07:00
Paul Gschwendtner e17fe90aaa refactor: fix undecorated classes with angular features in repo (#36921)
A few instances of undecorated classes with Angular features
have been discovered in the framework repo. This commit fixes
those.

PR Close #36921
2020-05-06 15:06:10 -07:00
crisbeto 9d54679e66 test: clean up explicit dynamic query usages (#33015)
Cleans up all the places where we explicitly set `static: false` on queries.

PR Close #33015
2019-10-17 16:10:10 -04:00
Alex Rickabaugh 84dd2679a9 fix(core): require 'static' flag on queries in typings (#30639)
This commit makes the static flag on @ViewChild and @ContentChild required.

BREAKING CHANGE:

In Angular version 8, it's required that all @ViewChild and @ContentChild
queries have a 'static' flag specifying whether the query is 'static' or
'dynamic'. The compiler previously sorted queries automatically, but in
8.0 developers are required to explicitly specify which behavior is wanted.
This is a temporary requirement as part of a migration; see
https://angular.io/guide/static-query-migration for more details.

@ViewChildren and @ContentChildren queries are always dynamic, and so are
unaffected.

PR Close #30639
2019-05-24 16:55:00 -04:00
George Kalpakas 2dc4e8801c ci(docs-infra): loosen conditions to reduce flakiness on CI (#29757)
The exact messages depend on the timing of several events and may vary
between runs. This occasionally causes flakes on CI.
This commit reduces the risk of flakes by loosen the conditions to only
check for what we actually care about.

Fixes #29544

PR Close #29757
2019-04-25 10:58:12 -07:00
George Kalpakas 00866186a7 refactor(docs-infra): switch from promises to async/await in tests (#29757)
PR Close #29757
2019-04-25 10:58:12 -07:00
swseverance fe3679a356 style: remove empty comments (#23404)
PR Close #23404
2018-05-10 15:48:13 -07:00
Brandon Roberts 2278fe8f0e docs(aio): Upgrade examples to Angular 6 (#23234)
PR Close #23234
2018-04-17 14:09:02 -07:00
Anuj Jain b5f41f2c35 docs: fixed live example for the lifecycle hooks. (#23201)
PR Close #23201
2018-04-05 16:29:38 -07:00
Jesus Rodriguez 1a75934cc0 build(aio): migrate plunker to stackblitz (#20165)
PR Close #20165
2018-01-23 21:30:27 -08:00
Shavi Pathania 949836d003 docs(aio): Clearing array with [] (#20369) (#20395)
Convert remaining references to directly use LoggerServices logs.

PR Close #20395
2017-11-16 16:19:35 -06:00
Shavi Pathania 697fb76960 docs(aio): Removing reference to LoggerService property (#20369) (#20395)
The reference removed so that calling LoggerService clear() method
behaves as intended in SpyComponent.

PR Close #20395
2017-11-16 16:19:35 -06:00
Shavi Pathania 0fedb57cb0 docs(aio): Clearing array with [] (#20369) (#20395)
Clearing array with setting length to 0 replaced with [] for being short
and marginally efficient. For reference: [] is turned into a sequence of
around 15 machine instructions on x64 (if bump pointer allocation succeeds),
whereas a.length=0 is a C++ runtime function call, which requires 10-100x as
many instructions.
Benedikt Meurer

PR Close #20395
2017-11-16 16:19:35 -06:00
Jesus Rodriguez 9bbf009dff build(aio): change examples to CLI (#19248)
PR Close #19248
2017-09-21 17:05:54 -07:00
Filipe Silva bfd5f27525 feat(aio): add e2e (#15976)
PR Close #15976
2017-04-19 22:36:23 -05:00
Peter Bacon Darwin fd72fad8fd docs(aio): update migrated content from anguar.io 2017-03-28 10:21:46 +01:00
Peter Bacon Darwin 1f3198cb50 feat(aio): copy example code from angular.io 2017-02-23 23:23:58 -08:00