Commit graph

678 commits

Author SHA1 Message Date
Dario Piotrowicz
7278a9c584 docs(animations): fix filter-animations docregion (#44544)
the filter animation example in the complex-animation-sequences guide
talks about entering and leaving elements, but the presented html
snipped exluded the *ngFor which actually adds and removes the elements,
so add the *ngFor section to make the example complete and
understandable

PR Close #44544
2022-01-05 17:46:10 +00:00
Dario Piotrowicz
d5ced77d31 refactor(docs-infra): fix eslint issues for aio ugrade-* examples (#44534)
fix the eslint issues in the aio/content/examples/upgrade-* folders
and remove their ignorePattern in the examples eslintrc file

PR Close #44534
2022-01-04 16:34:06 -08:00
Abdurrahman Abu-Hijleh
f0b4c709c9 docs: fix code sample indentation (#44517)
PR Close #44517
2022-01-04 12:15:55 -08:00
huangqing
bfd94b39d3 docs: Replace OnInit with AfterViewInit (#44485)
`this.adHost` is undefined if loadComponent is called in OnInit.
So replace OnInit with AfterViewInit!
PR Close #44485
2022-01-04 12:14:44 -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
Yousaf Nawaz
ab2248e773 docs(docs-infra): change variable names in route guards examples (#44444)
change variable name 'next' to 'route' in route guards examples on developer guides "Routing and Navigation Tutorial: Adding routing to Tour of Heroes" to make it consistent with api docs and subsequent examples.

Fixes #44291

PR Close #44444
2021-12-14 16:08:05 -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
dario-piotrowicz
6ae38584b0 docs(core): improve viewEncapsulation documentation (#44151)
Slighlty improve the `viewEncapsulation` documentation (both in code
comments and content files) to make it more clear and understandable.

See https://github.com/angular/angular/pull/44099#discussion_r745890903

PR Close #44151
2021-11-24 18:53:45 +00: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
fusho-takahashi
6c618de22e docs: Adding type annotation to ngOnInit() to make it consistent with the class structure produced by the CLI (#43579)
PR Close #43579
2021-11-16 14:09:51 -08: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
37e02750a7 build(docs-infra): fix SystemJS-based docs examples (#43868)
Previously, the SystemJS-based docs examples (typically `ngUpgrade`
examples) were not compatible with Angular v13 (due to the removal of
UMD bundles from the published packages).

This commit makes the examples compatible with Angular v13 and
re-enables the tests for all SystemJS-based examples on CI.

PR Close #43868
2021-11-08 17:01:16 +00:00
Dustin M. Eastway
544c26d779 docs: fix typescript errors for the schematics-for-libraries example (#30966)
PR Close #30966
2021-11-05 16:33:26 +00:00
Dustin M. Eastway
024fd9d9f0 docs: add cross-platform support to postbuild in schematics-for-libraries (#30966)
Use the cross-platform `copyfiles` package instead of using `cp` which fails on Windows machines when copying files in the `postbuild` script of the "schematics-for-libraries" example.

PR Close #30966
2021-11-05 16:33:26 +00:00
Alan Agius
2f62a9a548 docs: improve consuming partial-Ivy code outside the Angular CLI (#44027)
With this change we add an example of how to consume the linker plugin and also clean up the parts of this section.

Closes #44026

PR Close #44027
2021-11-04 18:55:52 +00:00
Andrew Kushnir
967283e8a1 docs: update dynamic component guide to use factory-less ViewContainerRef.createComponent (#43895)
PR Close #43895
2021-10-29 15:39:04 -07: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
George Kalpakas
8286190930 build(docs-infra): update docs examples to Angular v13.0.0-rc.0 (#43880)
This commit updates the docs examples to Angular v13.0.0-rc.0. In
addition to updating the dependency versions, it also updates the
projects' structure and configs to more closely match what a new v13 CLI
app would look like. See, also, the [diff][1] between a basic v12.1.3
CLI app and a v13.0.0-rc.0 one.
(NOTE: v12.1.3 was the last version for which we aligned the projects
with how a new CLI app would look like.)

Additionlly:
- Since we now use RxJS v7 in docs examples, this commit removes the
  extra CI steps to explicitly test the docs examples against RxJS v7.
- Since Angular v13 no longer supports IE, this commit removes an
  IE-specific section from `upgrade-setup.md`.

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

PR Close #43880
2021-10-29 13:10:25 -07:00
George Kalpakas
0fc4e66f6e test(docs-infra): fix practical-observable-usage docs example tests with RxJS v7 (#43880)
Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.

PR Close #43880
2021-10-29 13:10:25 -07:00
dirk diebel
a91fe6db8c docs(docs-infra): change deprecated keyboardEvent.keyCode example to use keyboardEvent.code (#43934)
PR Close #43934
2021-10-26 00:05:22 +00:00
Alan Agius
e48b49959d docs: remove fesm5 and esm5 deprecation notice. (#43915)
This has been removed in version 11 and should no longer be listed.

PR Close #43915
2021-10-25 17:54:52 +00:00
iRealNirmal
c78f1cd34e docs: move deprecations example snippets to external file (#43700)
Moving angular depreciation examples to external project

closes #43337

PR Close #43700
2021-10-20 20:24:54 +00:00
dario-piotrowicz
68d18a0422 refactor(docs-infra): remove unnecessary tsconfig.json file (#43818)
the tsconfig.json file in aio/content/examples does not seem necessary
anymore as it was only used for tslinting and tslint has been removed
from the examples in PR #43592 and PR #43746

PR Close #43818
2021-10-13 16:51:10 +00:00
dario-piotrowicz
919d7dc233 refactor(docs-infra): remove tslint from cli systemjs examples (#43746)
remove the deprecated tslint from the examples of type systemjs

note: eslint hasn't be applied and linting has been removed entirely
to follow angular's unopinionated view on linting

PR Close #43746
2021-10-11 17:14:30 +00:00
Tanguy Nodet
8b2971417a docs: add missing declaration of CartComponent in tutorial (#43774)
PR Close #43774
2021-10-11 16:42:34 +00:00
dario-piotrowicz
acf3102369 refactor(docs-infra): remove linting from i18n example angular.json (#43747)
remove linting from the i18n angular.json example as that is no longer
present in the boilerplace angular.json (and the two should be kept in
sync)

note: the linting was removed from the boilerplate angular.json file in PR #43592

PR Close #43747
2021-10-08 20:42:00 +00:00
markostanimirovic
018af62141 docs: fix forms in template examples (#43772)
PR Close #43772
2021-10-08 20:39:11 +00:00
George Kalpakas
7555e9fb8a docs: use correct service name when creating error handler in http example (#43767)
PR Close #43767
2021-10-08 20:17:58 +00:00
JoostK
06732606c9 docs: remove legacy compiler options in library schematics example (#43224)
The `skipTemplateCodegen`, `strictMetadataEmit` and
`enableResourceInlining` options are specific to ViewEngine and have no
effect when using the Ivy compiler. Since libraries can no longer be
compiled using ViewEngine from Angular 13, this commit removes these
options entirely.

The `annotateForClosureCompiler` is also no longer recommended to use,
as Closure Compiler is not supported outside of Bazel.

Finally, the `fullTemplateTypeCheck` flag is changed into
`strictTemplates` as the former flag is being deprecated. Enabling
`strictTemplates` does result in more strict type-checking than with
only `fullTemplateTypeCheck` enabled, but simply removing
`fullTemplateTypeCheck` right away would result in less strict
type-checking which is not desired.

PR Close #43224
2021-10-04 16:32:11 -07:00
dario-piotrowicz
d2f3f2cad6 refactor(docs-infra): remove tslint from cli examples (#43592)
remove the deprecated tslint from the examples of type cli

note: eslint hasn't be applied and linting has been removed entirely
to follow angular's unopinionated view on linting

PR Close #43592
2021-10-04 16:30:48 -07:00
iRealNirmal
e5c3017df3 docs: move angular-compiler-options tsconfig snippets to external file (#43545)
Moving angular-compiler-options docs inline code to external file of tsconfig.json and tsconfig.app.json.

closes #43336

PR Close #43545
2021-10-04 10:55:04 -07:00
Andrew Scott
d04b550f2e docs: Deprecate longhand binding prefixes (#43671)
DEPRECATION:

The template prefixes `bind-`, `on-`, `bindon-`, and `ref-` have been deprecated
in v13. Templates should use the more widely documented syntaxes for binding and references:

* `[input]="value"` instead of `bind-input="value"`
* `[@trigger]="value"` instead of `bind-animate-trigger="value"`
* `(click)="onClick()"` instead of `on-click="onClick()"`
* `[(ngModel)]="value"` instead of `bindon-ngModel="value"`
* `#templateRef` instead of `ref-templateRef`

PR Close #43671
2021-10-04 10:27:06 -07:00
Paul Gschwendtner
77cb17166e test(docs-infra): update http test to use correct charset name due to chromium update (#43431)
We updated the dev-infra version as part of the v13 package format
in order to be able to use the latest `rollup` version (and its
plugins). The update of the shared dev-infra package resulted in an
update of Chromium to a more recent version. This version of Chromium
seems to normalize the `content-type` header differently, so that the
AIO `http` example test assertion needs to be updated to work with the
new version of chromium. This commits updates the test.

PR Close #43431
2021-10-01 18:28:46 +00:00
little-pinecone
7cd87ea4c4 docs: add button type in form array example (#43666)
add a button type in the example of creating a dynamic form so that the button that adds the alias control does not submit the entire form

PR Close #43666
2021-10-01 12:23:09 -04:00
xiaohanxu-nick
544cb43eed docs: fix missing step in get started example (#43646)
PR Close #43646
2021-10-01 08:45:59 -07:00
dario-piotrowicz
6e7454df86 docs(animations): improve the aio animations introduction (#42885)
improve slightly the angular.io animation introduction guide, such
improvement are styling, information and clarity related

PR Close #42885
2021-10-01 08:34:19 -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
Chris
9c2b8c2902 docs: clarify description of :host and :host-context selectors (#41332)
Fixes #39466

PR Close #41332
2021-09-29 10:00:05 -07:00
Ricardo Chavarria
de662da8e2 docs: Add Ricardo Chavarria to GDE resources (#43571)
update size image
update preview
docs: replace an avatar with smaller size
Change order


PR Close #43571
2021-09-27 14:25:56 -07:00
dario-piotrowicz
a1633c1c6e docs(service-worker): improve service worker guides (#43508)
improve slightly the angular.io guides related to service workers, by
means of fixes, styling, information and clarity changes

PR Close #43508
2021-09-22 17:48:39 +00:00
Xiaohanxu1996
6e5f59fe61 docs: remove duplicate import from @angular/core (#43530)
PR Close #43530
2021-09-22 16:16:05 +00:00
Pete Bacon Darwin
7efa47075c docs: remove http example dependency on 3rd party service (#43475)
Previously the `http` example did accessed the npmsearch.com website to demonstrate response caching.
But if this service became unavailable then the example (and its e2e tests) would fail.

This commit changes the example to use the in-memory-web-api for this lookup, which will not be affected by 3rd party outages.

The guide that references this example has been updated to avoid references to the original npm search service.

PR Close #43475
2021-09-16 15:59:05 +00:00
Pete Bacon Darwin
1986407ab5 docs: move i18n angular.json snippets to external file (#43216)
Note that because `angular.json` is a "boilerplate" file we cannot
just add comments to the one that is actually used in the application.

Instead this commit makes a copy, which is annotated with docregions.
To ensure that this file is not ignored by the example-collector, we had to
update the `.gitignore` to not ignore this file. (This also allows the file to be
easily stored tracked in git).

PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c464bb4555 docs: move duplicate custom id snippets to external examples (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
04e41b8c35 docs: move nginx and apache config blocks to external files (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
c0988d6f52 docs: move plural function example to external file (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
602a127d08 docs: move global locale import to external example file (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
Pete Bacon Darwin
eb0c1475ab docs: move shell snippets to external example files (#43216)
PR Close #43216
2021-09-15 10:46:45 -07:00
dario-piotrowicz
df177d9176 docs: amend code related to string-expressions for property binding (#43366)
resolves #43287

PR Close #43366
2021-09-10 09:22:14 -07:00