91 Commits

Author SHA1 Message Date
Andrew Kushnir
f4c55e464a docs: provide more info on the NO_ERRORS_SCHEMA schema ()
The `NO_ERRORS_SCHEMA` schema can be used to ignore errors related to unknown elements or properties, but since it suppresses these errors it may also hide real problems in a template. This commit updates the `NO_ERRORS_SCHEMA` docs to mention that.

Closes .

PR Close 
2021-06-07 10:46:34 -07:00
Sam Severance
c0b2eeb54c docs: remove unused imports from unit tests ()
PR Close 
2021-06-02 13:22:09 -07:00
Sam Severance
c1a9f07ea1 docs: refactor WelcomeComponent unit test ()
PR Close 
2021-06-02 13:22:08 -07:00
Igor Minar
1fe1dd1f19 docs: clarify the wording around live examples for all testing guides ()
We should primarily point readers to the stackblitz that contains the spec files and runs them.

The application stackblitz is secondary (and doesn't actually contain the spec files, which is confusing).

Fixes 

PR Close 
2021-06-02 13:20:13 -07:00
Sam Severance
da1a868ec2 docs: add missing await to BannerComponent unit test ()
PR Close 
2021-05-26 20:03:46 +00:00
Sam Severance
caf15da651 docs: fix BannerComponent unit tests ()
remove `async` and `await` from `BannerComponent` test because the
component uses an inline template and styles

create doc region in `banner-external.component.spec.ts` demonstrating
test setup that may fail due to a missing call to `.compileComponents()`
for a component with an external template and stylesheet

PR Close 
2021-05-26 20:03:46 +00:00
Sam Severance
74ebdf6fdc docs: refactor HeroDetailComponent and unit test ()
remove `@Input()` decorator from `hero` property because the component
is designed to get the hero via a service, not an input binding.

add `HTMLElement` type to `HeroDetailComponent` unit test

PR Close 
2021-05-26 20:00:35 +00:00
Sam Severance
29ece98744 docs: asynchronous test spy method ()
fixes two `HeroService` tests that were synchronously
testing an asynchronous spy method

PR Close 
2021-05-24 15:18:43 -07:00
Sam Severance
ad12b31c27 docs: unsubscribe from observables ()
Add rxjs `first` operator in `DashboardHeroComponent` unit
tests to ensure unsubscription from observables

PR Close 
2021-05-24 15:16:52 -07:00
Sam Severance
62becc88f9 fix(docs-infra): fix example compilation issues ()
Fix an issue that prevented the Http (tests) StackBlitz
and Testing (tests) StackBlitz from compiling.

Resolves 

PR Close 
2021-05-21 18:07:44 +00:00
Kristiyan Kostadinov
e86a1d3441 docs: make all examples compatible with strict mode ()
Turns on the `strict` compiler flag and resolves the compilation errors in the various AIO examples.

PR Close 
2021-05-17 10:42:18 -07:00
iRealNirmal
e071e3b507 build(docs-infra): fixed i18n broken stackblitz example ()
This commit fixes the broken stackblitz example of i18n.

Closes .

PR Close 
2021-05-10 16:11:34 -04:00
iRealNirmal
2b939767fe docs: update testing components doc with generated compileComponent ()
Updated testing-components-scenarios.md to match CLI generated test case.

Closes 

PR Close 
2021-05-06 15:40:36 -04:00
Alan Cohen
319da894be docs: change ActivatedRouteStub code sample to work with strictNullChecks on ()
convertToParamMap() does not accept undefined.
Fix code sample so it can be used in strict mode without requiring changes.

PR Close 
2021-04-12 21:01:39 -07:00
Kristiyan Kostadinov
59ef40988e feat(core): support TypeScript 4.2 ()
Updates the repo to TypeScript 4.2 and tslib 2.1.0.

PR Close 
2021-03-17 09:10:25 -07:00
Alan Agius
d51d39cb4c docs: update docs to use new zone.js entry-points ()
In CLI version 12, the old style of imports is no longer supported.

PR Close 
2021-02-24 07:58:29 -08:00
S. Iftekhar Hossain
365ac5e68e docs: fixed issue with missing code sample by rearranging import to proper docregion ()
Fixes 

PR Close 
2021-01-26 09:17:28 -08:00
Pete Bacon Darwin
315b272f9f docs: add missing type parameter to testing example ()
Without this type parameter the call to `resolve()` is invalid.

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

PR Close 
2021-01-20 16:12:15 -08:00
Alexey Elin
f846c093b1 docs: specify fallback generic font family ()
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 
2021-01-06 07:09:27 -08:00
Alexey Elin
76e3de253c docs: remove -webkit-box-sizing and -moz-box-sizing ()
Angular has stopped to support browser that requires these CSS properties.
All supported browsers support standard box-sizing CSS property

PR Close 
2020-12-10 13:38:19 -08:00
Alexey Elin
13dfef14dc docs: remove cursor: hand ()
PR Close 
2020-12-09 09:04:54 -08:00
Alexey Elin
775394c809 docs: use double colon for pseudo-elements ()
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 
2020-12-07 09:49:46 -08:00
George Kalpakas
23c36a24ed test(docs-infra): disable the Selenium Promise Manager in docs examples e2e tests ()
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 
2020-11-24 14:56:14 -08:00
George Kalpakas
3d2c2c40d8 build(docs-infra): update docs examples to Angular v11.0.1 ()
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 
2020-11-24 14:56:09 -08:00
Aristeidis Bampakos
cf60e0e889 docs: use SimpleChanges in component interaction guide ()
Use the SimpleChanges interface in the example of component interaction guide

PR Close 
2020-10-26 10:47:31 -07:00
Adrien Crivelli
c4b8964424 docs: drop newEvent() compatibility function ()
Because PhantomJS has been deprecated since March 2018, and `newEvent`
is very confusing for newcomers that read the testing documentation,
we remove it entirely, and instead assume most, if not all, newcomers
will run tests in Chrome as it is the default.

Fixes 

PR Close 
2020-09-17 09:31:17 -07:00
JiaLiPassion
8fbf40bf40 feat(core): update reference and doc to change async to waitAsync. ()
The last commit change `async` to `waitForAsync`.
This commit update all usages in the code and also update aio doc.

PR Close 
2020-08-03 12:54:13 -07:00
George Kalpakas
3a46c2da7c refactor(docs-infra): update docs examples tslint.json to match CLI and fix failures ()
This commit updates the `tslint.json` configuration file, that is used
to lint the docs examples, to match the one generated for new Angular
CLI apps. There are some minimal differences (marked with `TODO`
comments) for things, such as component selector prefix, that would
require extensive and/or difficult to validate changes in guides.

This commit also includes the final adjustments to make the docs
examples code compatible with the new tslint rules. (The bulk of the
work has been done in previous commits.)

PR Close 
2020-07-31 11:00:06 -07:00
George Kalpakas
bfd13c06e1 refactor(docs-infra): fix docs examples for Angular-specific tslint rules ()
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 
2020-07-31 11:00:06 -07:00
George Kalpakas
5303773daf refactor(docs-infra): fix docs examples for tslint rule prefer-const ()
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 
2020-07-31 11:00:06 -07:00
George Kalpakas
1db4f508e6 refactor(docs-infra): fix docs examples for tslint rules related to variable names ()
This commit updates the docs examples to be compatible with the
`no-shadowed-variable` and `variable-name` 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 
2020-07-31 11:00:06 -07:00
George Kalpakas
3c7359f026 refactor(docs-infra): fix docs examples for tslint rule no-angle-bracket-type-assertion ()
This commit updates the docs examples to be compatible with the
`no-angle-bracket-type-assertion` 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 
2020-07-31 11:00:06 -07:00
George Kalpakas
8aa29438ac refactor(docs-infra): fix docs examples for tslint rules related to object properties ()
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 
2020-07-31 11:00:06 -07:00
George Kalpakas
fc709423f2 refactor(docs-infra): fix docs examples for tslint rule only-arrow-functions ()
This commit updates the docs examples to be compatible with the
`only-arrow-functions` 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 
2020-07-31 11:00:06 -07:00
George Kalpakas
3012a8e71c style(docs-infra): fix docs examples for tslint rule jsdoc-format ()
This commit updates the docs examples to be compatible with the
`jsdoc-format` 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 
2020-07-31 11:00:05 -07:00
George Kalpakas
77f38d3be1 style(docs-infra): fix docs examples for tslint rule semicolon ()
This commit updates the docs examples to be compatible with the
`semicolon` 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 
2020-07-31 11:00:05 -07:00
George Kalpakas
7c0f11789b style(docs-infra): fix docs examples for tslint rules related to whitespace ()
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 
2020-07-31 11:00:05 -07:00
George Kalpakas
0a791e4a50 style(docs-infra): fix docs examples for tslint rule import-spacing ()
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 
2020-07-31 11:00:05 -07:00
George Kalpakas
d89200ad24 refactor(docs-infra): remove unnecessary use strict from docs examples TS files ()
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 
2020-07-31 11:00:05 -07:00
George Kalpakas
8660806ddc build(docs-infra): renamed e2e property of example-config.json to tests ()
Each docs example has an `example-config.json` configuration file. Among
other things, this file can be used to specify what commands to run in
order to test the example. (If not specified, the `run-example-e2e.js`
script will run a default `yarn e2e` command.)

Previously, the property specifying the test commands was called `e2e`.
This is because in the past only e2e tests were run for docs examples.
Since recently, some examples may specify commands for other types of
tests (such as unit tests). Therefore, calling the property that holds
the list of test commands `e2e` no longer makes sense and can be
misleading to people looking at the configuration files.

This commit renamed the property to the more generic `tests`. In the
future, the `run-example-e2e.js` script (and corresponding npm script)
should be renamed and refactored to also avoid giving the impression
that only e2e tests are run.

Discussed in:
https://github.com/angular/angular/pull/36143#discussion_r395148379

PR Close 
2020-04-06 15:31:07 -07:00
George Kalpakas
d707124fd9 test(docs-infra): fix unit tests and run them for specific docs examples on CI ()
Previously, only e2e tests were run for docs examples on CI. As a
result, unit tests (which are included in the zipped archives we provide
for users to download and play with the examples locally) were often
outdated and broken.

This commit configures specific docs examples that have meaningful unit
tests to run them on CI (via the `run-example-e2e.js` script). Where
necessary, the unit tests are fixed to ensure they pass and reflect the
changes in the corresponding component/service.
This commit also removes some auto-generated unit tests that are not
meaningful (e.g. make trivial assertions, such that a component instance
is truthy) and are often broken anyway (e.g. because the corresponding
component has been changed in ways that make the tests fail).

PR Close 
2020-04-06 15:31:07 -07:00
George Kalpakas
fc325c49ec build(docs-infra): update project structure to cli@9 3/12 (title in a h1 tag) ()
Make test description less implementation specific.

PR Close 
2020-03-18 10:00:01 -07:00
George Kalpakas
a8e936791b build(docs-infra): update project structure to cli@9 2/12 (fixture.debugElement.componentInstance) ()
`fixture.debugElement.componentInstance` --> `fixture.componentInstance`

PR Close 
2020-03-18 10:00:01 -07:00
George Kalpakas
fbed0a1471 build(docs-infra): remove unused test.html file from testing example ()
This file was from back when the `testing` example was not based on the
Angular CLI and is not used any more.

PR Close 
2020-03-18 10:00:01 -07:00
George Kalpakas
8eb4a9d395 docs: fix docs and associated code snippets for enabling more macro tasks in fakeAsync() ()
In the `testing` guide, there is a section discussing configuring
`fakeAsync()` to handle more macro tasks (e.g.
`HTMLCanvasElement#toBlob()`).

Previously, the corresponding code snippets (some of which were
hard-coded in the guide) were incorrect/incomplete and the associated
tests were broken. This was discovered while enabling docs examples unit
tests in .

This commit fixes the code snippets and associated tests and ensures the
examples used in the guide come from an example app (i.e. are not
hard-coded).

Note: The docs examples unit tests are currently not run on CI. This
will be fixed in .

PR Close 
2020-03-02 13:30:25 -08:00
JiaLiPassion
17b862cf82 feat: add an tickOptions parameter with property processNewMacroTasksSynchronously. ()
This option will control whether to invoke the new macro tasks when ticking.

Close 

PR Close 
2020-02-20 15:14:59 -08:00
Oleg Teterin
79742a397f fix(docs-infra): fix parameters with @Optional() decorator do not match declared, optional type ()
PR Close 
2020-02-07 09:58:31 -08:00
Alan Agius
8f389361ec docs: replace lazy loading import syntax parameter name ()
We replace `mod` with `m` to be in line with what the CLI generates.

PR Close 
2020-01-07 10:44:12 -08:00
ajitsinghkaler
1217c6b7cc docs: replace class hero to interface wherever class properties not used ()
Fixes 

PR Close 
2019-11-25 11:37:39 -05:00