Commit graph

114 commits

Author SHA1 Message Date
Derek Cormier
7a134cf41a build(bazel): incrementally run aio example e2e tests
Replaces the workflow where all example e2es are run at once
2022-11-22 13:51:16 -07:00
Derek Cormier
9a27c4cb50 build(bazel): incrementally build aio example zips and live examples
The existing scripts were amended to work on one example at a time
2022-11-22 13:51:16 -07:00
Alan Agius
32135b27a1 docs: update examples to reflect changes in Angular CLI version 15. (#47904)
These changes include
- Remove the usage of `enableProdMode`
- Remove `test.ts`, `polyfills.ts`, `karma.conf.js` and environment files which are no longer generated by default

PR Close #47904
2022-11-03 17:46:46 -07:00
Andrew Kushnir
f73ef21442 feat(router): merge RouterLinkWithHref into RouterLink (#47630)
This commit updates the `RouterLink` to extend the selector to also include `<a>` and `<area>` elements, which were previously matched by the `RouterLinkWithHref` directive. The code of the directives was merged together (since there was a lot of duplication) and this commit finalizes the merge. The `RouterLinkWithHref` becomes an alias of the `RouterLink` directive.

Now there is no need to import and use the `RouterLinkWithHref` class, the `RouterLink` directive will match any element that has the `routerLink` attribute.

DEPRECATED:

The `RouterLinkWithHref` directive is deprecated, use the `RouterLink` directive instead. The `RouterLink` contains the code from the `RouterLinkWithHref` to handle elements with `href` attributes.

PR Close #47630
2022-10-05 15:16:43 -07:00
Marc Wrobel
eca3db5692 docs(docs-infra): fix minor typos in angular.io (#47295) (#47295)
PR Close #47295

PR Close #47295
2022-09-07 10:47:21 -07:00
George Kalpakas
67ec9eec64 build(docs-infra): update Angular CLI/framework to v14.0.0-rc.0 in docs examples (#45997)
Update the docs examples to the latest prerelease versions of Angular
CLI and framework (v14.0.0-rc.0).

Also update the example apps to more closely align with new CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.3 CLI app and a
v14.0.0-rc.0 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/13.0.0-rc.3...14.0.0-rc.0

PR Close #45997
2022-05-23 13:20:10 -07:00
Bob Watson
274c6fa643 docs: remove Narco from hero list in code, text, and images (#46008)
Fixes issue #45769

Removes the malevolent comic book character, "Narco," from the list of heroes. This change removes the reference from the code, text and screenshots used in the documentation and makes other minor edits as necessary.

PR Close #46008
2022-05-17 17:47:03 +00:00
Paul Gschwendtner
68a6a075f4 build: clean up references to old master branch (#45856)
Cleans up all references to the `master` branch we renamed to
`main` across Angular.

PR Close #45856
2022-05-04 16:23:33 -07:00
Tobias Speicher
4ddcf81e61 refactor: replace deprecated String.prototype.substr() (#45397)
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

PR Close #45397
2022-03-24 11:48:09 -07:00
JiaLiPassion
c7cab69af1 docs(core): update triggerEventHandler samples (#45279)
PR Close #45279
2022-03-09 13:51:54 -08:00
Daniele Maltese
4fa530757b fix(docs-infra): removed duplicated style in aio examples (#45157)
Removed duplicated style in aio example scss files.

PR Close #45157
2022-02-22 15:35:16 -08:00
dario-piotrowicz
0d19be1996 refactor(docs-infra): add types to all the aio examples buttons (#44557)
add types to all the buttons in the angular.io examples to encourage
the best practice of always including a type per button (regardless
to whether it is in a form or now)

PR Close #44557
2022-02-03 12:44:47 -08:00
dario-piotrowicz
e1f15a1899 refactor(docs-infra): remove outdated comments regarding CustomEvent (#44557)
remove the comments present in aio examples saying that for older
browsers such as IE CustomEvent could be necessary (as the the Event
constructor could be not available)

such comments are no longer necessary/relevant since the Event constructor
is available for all the supported browsers

PR Close #44557
2022-02-03 12:44:46 -08:00
Dario Piotrowicz
5498a35789 refactor(docs-infra): fix template eslint issues in aio examples (#44557)
the aio examples have various eslint issues regarding template rules, those
are currently turned off and TODO comments have been added to them in the
examples eslintrc, fix such issues and remove the respective TODO comments

this also includes examples refactoring to use buttons for better accessibility,
this change tries to make the smallest amound of changes to the examples' behaviors
and designs/UI

PR Close #44557
2022-02-03 12:44:46 -08:00
shejialuo
6e0481572f docs(docs-infra): change the testing guide due to deprecation (#44674)
The jasmine used in the docs is

```typescript
expect(<variableName>).<matcher>(predicate, failOutput)
```

The new version should be

```typescript
expect(<variableName>).withContext(failOutput).<matcher>(predicate)
```

So, this commit mainly focuses on changing the former to latter with
format below

```typescript
expect(<variableName>)
  .withContext(failOutput)
  .<matcher>(predicate)
```

And for RxJs, see https://rxjs.dev/deprecations/subscribe-arguments.

> For example someone could name functions poorly and confuse the next
reader: `source$.subscribe(doSomething, doSomethingElse, lol)` with that
signature, you have to know unapparent details about subscribe, where
using a partial observer solves that neatly: `source$.subscribe({ next:
doSomething, error: doSomethingElse, complete: lol }`).

This commit also does this conversion.

Last, remove the unused imported `async` from file
`twain.component.marbles.spec.ts`.

PR Close #44674
2022-01-13 12:46:24 -08:00
dario-piotrowicz
835987b78b refactor(docs-infra): use eslint in aio's example-lint script (#43218)
Instead of the deprecated tslint use eslint in the aio's example-lint
script

PR Close #43218
2021-12-15 12:28:46 -05:00
Kristiyan Kostadinov
95ed446009 refactor(docs-infra): clean up entryComponents usages (#44257)
Cleans up some usages of `entryComponents` from AIO.

PR Close #44257
2021-11-30 13:49:45 -05:00
Paul Gschwendtner
489cf42cd0 fix(common): incorrect error type for XHR errors in TestRequest (#36082)
Currently the `HttpClient` always wraps errors from XHR requests, but
the underlying errors are always of type `ProgressEvent`, or don't have
a native error if the status code is just indicating failure (e.g. 404).

This behavior does not match in the `TestRequest` class provided by
`@angular/common/http/testing` where errors are considered being
of type `ErrorEvent`. This is incorrect because `ErrorEvent`s provide
information for errors in scripts or files which are evaluated. Since
the `HttpClient` never evaluates scripts/files, and also since XHR requests
clearly are documented to emit `ProgressEvent`'s, we should change the
`TestSupport` to retrieve such `ProgressEvent`'s instead of incompatible
objects of type `ErrorEvent`.

In favor of having a deprecation period, we keep supporting `ErrorEvent`
in the `TestRequest.error` signature. Eventually, we can remove this
signature in the future.

Resources:
  * https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/error_event
  * https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent
  * https://xhr.spec.whatwg.org/#event-xhr-errpr

Related to: https://github.com/angular/angular/issues/34748.

DEPRECATED: `TestRequest` from `@angular/common/http/testing` no longer
accepts `ErrorEvent` when simulating XHR errors. Instead instances of
`ProgressEvent` should be passed, matching with the native browser behavior.

PR Close #36082
2021-11-19 21:26:52 +00:00
Ramesh Thiruchelvam
6d2276e17f test: type spy objects in test example (#44170)
Example for test doesn't use typing for Jasmine Spy objects. Updated 
them with `SpyObj<T>` typing as in the Angular Documentation.

See https://angular.io/guide/testing-services

PR Close #44170
2021-11-16 09:38:43 -08:00
Pete Bacon Darwin
dc7e5a1e01 build(docs-infra): remove link to custom Stackblitz for running tests (#44085)
Previously there was a custom version of the testing app for Stackblitz that would run the tests in the browser.
With the web-container approach, this is no longer necessary since the tests can be run directly from the command line.

Fixes #44047

PR Close #44085
2021-11-08 18:12:16 +00:00
George Kalpakas
7b35a3426f refactor(docs-infra): align docs examples with default CLI TS config (#43880)
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.

PR Close #43880
2021-10-29 13:10:25 -07:00
Andrew Scott
09d325a9e6 test(router): refactor tests to not use deprecated loadChildren (#43578)
Many of the tests in the router code use the deprecated loadChildren as a string. This
has been deprecated for years and can easily be changed to just a function that
returns the module.

PR Close #43578
2021-09-29 11:14:07 -07:00
George Kalpakas
93590895b5 build(docs-infra): update docs examples to Angular v12.1.3 (#42949)
This commit updates the docs examples to Angular v12.1.3. In addition to
updating the dependencies versions, it also updates the projects'
structure and configs to more closely match what a new v12 CLI app would
look like. See, also, the [diff][1] between a basic v11.2.11 CLI app and
a v12.1.3 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.11..12.1.3

PR Close #42949
2021-08-09 09:41:00 -07:00
Andrew Kushnir
f4c55e464a docs: provide more info on the NO_ERRORS_SCHEMA schema (#42327)
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 #39454.

PR Close #42327
2021-06-07 10:46:34 -07:00
Sam Severance
c0b2eeb54c docs: remove unused imports from unit tests (#42441)
PR Close #42441
2021-06-02 13:22:09 -07:00
Sam Severance
c1a9f07ea1 docs: refactor WelcomeComponent unit test (#42441)
PR Close #42441
2021-06-02 13:22:08 -07:00
Igor Minar
1fe1dd1f19 docs: clarify the wording around live examples for all testing guides (#42406)
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 #38535

PR Close #42406
2021-06-02 13:20:13 -07:00
Sam Severance
da1a868ec2 docs: add missing await to BannerComponent unit test (#42336)
PR Close #42336
2021-05-26 20:03:46 +00:00
Sam Severance
caf15da651 docs: fix BannerComponent unit tests (#42336)
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 #42336
2021-05-26 20:03:46 +00:00
Sam Severance
74ebdf6fdc docs: refactor HeroDetailComponent and unit test (#42349)
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 #42349
2021-05-26 20:00:35 +00:00
Sam Severance
29ece98744 docs: asynchronous test spy method (#42274)
fixes two `HeroService` tests that were synchronously
testing an asynchronous spy method

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

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

Resolves #42198

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

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

Closes #41838.

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

Closes #39740

PR Close #41947
2021-05-06 15:40:36 -04: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
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
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
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
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
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
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
Alexey Elin
13dfef14dc docs: remove cursor: hand (#39918)
PR Close #39918
2020-12-09 09:04:54 -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
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
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
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
Adrien Crivelli
c4b8964424 docs: drop newEvent() compatibility function (#37251)
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 #23370

PR Close #37251
2020-09-17 09:31:17 -07:00