Commit graph

972 commits

Author SHA1 Message Date
Andrea Canciani
f3b624553a refactor: fix a number of typos throughout the codebase (#55018)
Fix some typos detected using spellchecking tools, both in
documentation and in code (comments, identifiers).

PR Close #55018
2024-03-27 10:54:31 -07:00
Mateusz Daniluk
de777afbc5 refactor: standardize doctype declaration to <!DOCTYPE html> (#51052)
This commit standardizes the doctype declaration across all HTML files in the project to use `<!DOCTYPE html>`

PR Close #51052
2024-02-01 19:29:46 +00:00
Renan Ferro
e86a13674f docs: add new component imports documentation structure (#52282)
PR Close #52282
2024-01-29 19:30:59 +00:00
Matthieu Riegler
d38238e478 docs: remove mention of providedIn module. This feature has been deprecated. (#54072)
PR Close #54072
2024-01-26 19:09:28 +00:00
oliv37
c634405a52 docs: fix add builder from package (#53154)
PR Close #53154
2024-01-25 23:31:01 +00:00
Andrea Canciani
ecbb47b208 refactor: fix a number of typos throughout the codebase (#52826)
Fix several typos, mostly in the `adev` site.

PR Close #52826
2024-01-25 22:54:59 +00:00
Sylvain DEDIEU
9bb1884304 docs: change the file of the provideHttpClient standalone example to match cli generated project (#52806)
The "Providing HttpClient through dependency injection" documentation now shows that in case of a standalone boostraped app, the provideHttpClient is to include in the app.config.ts file.

Also updated the http setup server communication example to align the new doc (adev) with the old one (aio).

PR Close #52806
2024-01-25 21:24:58 +00:00
Jessica Janiuk
d49333edc3 fix(migrations): cf migration - detect and error when result is invalid i18n nesting (#53638) (#53639)
This will gracefully error on templates when the resulting template would have invalid i18n nested structures.

PR Close #53638

PR Close #53639
2023-12-19 12:22:01 -08:00
Andrew Scott
44f9f0108e refactor(core): Update flaky test with wait condition (#53437)
The tests in this commit have been flaky commonly due to the elements
not being found. Hopefully using `ExpectedConditions` helps.

PR Close #53437
2023-12-12 09:09:09 -08:00
oliv37
2d98735084 docs: improve filter results example (#52838)
PR Close #52838
2023-11-13 23:24:28 +00:00
Alan Agius
6033504388 docs: update ssr docs to add information about CommonEngine (#52506)
This commit add contructor information about `CommonEngine`

PR Close #52506
2023-11-03 09:50:13 -07:00
Doug Parker
a6b875225a docs: update examples to use buildTarget instead of browserTarget (#52361)
`browserTarget` is deprecated and `buildTarget` is the newly preferred name.

PR Close #52361
2023-11-01 16:24:42 -07:00
Doug Parker
849523f1b1 docs: update examples to use application builder (#52361)
`application` builder is preferred over `browser` builder. This updates all the examples I could find to use `application` builder. A couple notes of fixes that needed to happen:
1.  The testing example was broken because it relied on `~` imports in CSS files, which is a Webpack-specific features. However I don't think we need those custom styles at all, so I just removed the import altogether.
2.  A few tests seemed to be affected and needed to be cleaned up.

PR Close #52361
2023-11-01 16:24:42 -07:00
Andrew Kushnir
07623caefe docs: update SSR docs (#52408)
This commit updates the `ssr.md` file to restructure (and simplify) SSR docs.

PR Close #52408
2023-10-27 15:16:14 -07:00
Alan Agius
cb8a741f14 docs: update SSR doc to reflect version 17 (#52398)
Changes to SSR doc

PR Close #52398
2023-10-26 12:30:59 -07:00
Andrea Canciani
fc9ba3978c refactor: fix a number of typos throughout the codebase (#52249)
Fix some typos such as `boostrap`, `propery` and more, both in
documentation and in code (comments, identifiers).

PR Close #52249
2023-10-25 16:51:24 -07:00
Etienne FRANK
cfd89b0833 docs(forms): replace fb with formBuilder (#52261)
Shorten variable names isn't a good practice. To avoid spreading it, we removed it from Angular's documentation.

PR Close #52261
2023-10-19 09:24:39 -07:00
Ward Bell
f2513c540a docs: Phase 2 Sample Code Conversions to Standalone (#51918)
Phase 2 sample code conversions per instructions in doc: https://docs.google.com/document/d/1QqnVK8Mc0O1gU9ctPrs-JJ42V9_dHCuEttD_01pXh34/edit

**Included**

1. ajs-quick-reference

Minor changes to remove references to NgModule. Converted sample to standalone.

2. architecture

Migrated the code sample. Made minor changes to remove references to NgModule. I explicitly deprecated the `architecture-module.md` page and removed it from the navigation.

4. deprecations / deprecations-guide

Migrated the code sample which required pulling NgModule and Reactive Forms material into a new `deprecated` folder. Made minor changes to clarify when advice was specific to NgModule (see `loadChildren` in particular).

5. displaying-data

Deleted this `displaying-data` sample entirely as there is no need for a sample app just to display a single, vanilla data binding in the deprecated `zone.md` page. Replaced reference in `zone.md` with an inline code snippet.

10. ngcontainer

Converted the code sample. There is no guide page for this sample. It can be displayed in Stackblitz

**Excluded**

3. cli-builder

Code sample is not an app; nothing to convert.

6-9 - related to getting-started and setup.

Waiting until Angular team is ready to proceed.

11. providers

This is in its own commit and PR 51918 because it may not make sense to convert. See that PR for details.

12. routing-with-urlmatcher

No work needed. Already Standalone.

13 schematics-for-libraries

Non-trivial (see doc notes) and Angular may decide to leave as is. Should have own PR.

14 setup

Non-trivial (see doc notes) and Angular may decide to leave as is. Should have own PR.

PR Close #51918
2023-10-13 11:20:08 +02:00
Linus Wieland
3434359f64 docs(animations): fix typo in state name of keyframes example (#52155)
PR Close #52155
2023-10-11 09:15:03 -07:00
Matthieu Riegler
a645ceca94 refactor(service-worker): Remove deprecated activated & available observables. (#49498)
`activated`and `available` were deprecated by #43535 in v13.

PR Close #49498
2023-10-10 11:54:07 -07:00
Matthieu Riegler
c2f270cf14 refactor(compiler): Delete the @angular/compiler/testing module. (#49872)
The package was removed in components, it can now be deleted here also.

PR Close #49872
2023-10-09 15:58:25 -07:00
Kristiyan Kostadinov
43e6fb0606 feat(core): enable block syntax (#51994)
Enables the new `@` block syntax by default by removing the `enabledBlockTypes` flags. There are still some internal flags that allow special use cases to opt out of the block syntax, like during XML parsing and when compiling older libraries (see #51979).

PR Close #51994
2023-10-03 15:26:05 -07:00
Kristiyan Kostadinov
e1b27b01a5 build: disable TS version checks on AIO (#51792)
Disables the checks for the version of TS in AIO to unblock the TS deprecation.

PR Close #51792
2023-09-19 12:04:09 +02:00
Ward Bell
9f3b549cf6 docs: Migrate Service Worker to Standalone (#51687)
Although there are several pages, only `service-worker-getting-started.md` has an example.
That example code was migrated.

Worked around the few references to NgModule.

Other changes as follows:

**Revised "Getting Started"**

The original service worker example page (`service-worker-getting-started.md`) is full of holes! I don’t know how anyone got this working just by following this page

- it doesn’t tell you where to get the example (and it isn’t generated by AIO)
- it doesn’t tell you that ng serve doesn’t support service worker apps
- it mentions http-server in passing but not what that is or where to get it.
- several commands tell you to supply the “project-name” but (a) it doesn’t tell you how to find that name and (b) you never actually have to provide a name at all. That includes on the command that gets http-server going.

**Hid section on `ngsw-config` tool**

Hid the discussion of the `ngsw-config` tool in `service-worker-config.md` because
(a) the command invoke it didn't seem to work and (b) it referenced `<project-name>`
without explaining what that is or where to find it.

Left the hidden text in the page in case someone wants to do something about this.

Meanwhile, you seem to be able to edit the `ngsw-config.json` and then rebuild.
That should suffice.

**Disabled E2E**

The AIO CI will no longer attempt to run the (thin) E2E tests.

These tests could lightly test the app with the dev server but couldn't test the Service Worker aspects; that would require launching the app with something other than `ng serve` and the AIO CI is not set up for that.

The existing tests appeared to pass when run locally with the dev server.
However, only one of them actually ran; test runner reported.
"There were tests whose specified size is too big."

Decided to bypass E2E testing of this project for now.

PR Close #51687
2023-09-19 12:01:16 +02:00
Angular Robot
a2681c7c9d build: update cross-repo angular dependencies (#51780)
See associated pull request for more information.

PR Close #51780
2023-09-14 19:35:45 +02:00
Mark Thompson
63b8108f66 docs: add revamped guide for dependency injection focused on standalone (#51572)
* Updates two of the md files to prioritize standalone components/architecture
* Updates three examples referenced in the guides
* Updates the svg diagram to reference the EnvironmentInjector instead of the ModuleInjector

PR Close #51572
2023-09-14 11:23:48 +02:00
Ben Hong
cbeef95c29 docs: migrate form-validation to standalone (#51709)
PR Close #51709
2023-09-12 12:24:03 -07:00
Ben Hong
65f7686769 docs: migrate reactive-forms to standalone (#51707)
PR Close #51707
2023-09-12 12:23:19 -07:00
Ben Hong
4e0a575262 docs: migrate forms-overview to standalone (#51699)
PR Close #51699
2023-09-12 12:22:46 -07:00
Ben Hong
7b0bfc1dd8 docs: migrate testing to standalone (#51684)
PR Close #51684
2023-09-12 12:22:14 -07:00
Ward Bell
b08323747e docs: Migrate 2nd set of template guide pages and code to Standalone (#51632)
Supplements PR 51364 Template Migration with overlooked pages and examples

Code migrated: `inputs-outputs`, `interpolation`, `property-binding`
Guide pages affected:
* `binding-overview.md`
* `event-binding.md` (already migrated; updated with link to explain passive events)
* `inputs-outputs.md`
* `interpolation.md`
* `property-binding-best-practices.md`
* `property-binding.md`
* `understanding-template-expr-overview.md` (archived)

E2E tests passed locally.

PR Close #51632
2023-09-12 12:21:32 -07:00
Ward Bell
f6ccb163aa docs: Migrate i18n guide pages and code to Standalone (#51589)
E2E tests passed locally

**Added `readme.md` to the example code**

This explains how to build and run the example for both English and French.

**Archived `i18n-optional-manual-runtime-locale.md`**

I was asked to cut out a substantial swath of this page by reviewer "zip-fa". All that remained was a brief paragraph.  I removed the page from the navigation after copying the remaining text to `i18n-optional-import-global-variants.md`. The page is still reachable by 3rd party links.

PR Close #51589
2023-09-12 12:20:45 -07:00
Ward Bell
44c7469495 docs: Migrate Universal guide and code to Standalone (#51564)
Heavily reworked with advice from Alan Agius.

FWIW
* `ng test` fails because there are no unit tests
* `yarn e2e` builds but fails - `Unable to start a WebDriver session.`

**Added `readme.md` to sample code**

Makes it easier for the casual downloader to try the example.

**Added `universal-ngmodule`**

The existing ngModule-based doc has a lot of guidance for developers who are still building with NgModule. Given that we are preserving the existing NgModule guidance (with modifications), it seems prudent to preserve the NgModule form of the Universal guidance. So I copied the existing guide and code to `universal-ngmodule` and added it to the left-side navigation under the "NgModules" sub-tree.

Warning: it retains all of the faults of the original guide ... faults that were addressed in the current revision.

PR Close #51564
2023-09-12 12:20:10 -07:00
Paul Gschwendtner
05762b9fff refactor(localize): ignore code duplication error with compiler package (#51500) (#51558)
The localize package intentionally duplicates some logic from the
compiler to avoid adding a dependency. This is now an error in the
packaging rule to prevent common pitfalls/code duplication. Here it's
an explicit decision though so we mark it as such and ask for the check
to be ignored for the particular import.

PR Close #51500

PR Close #51558
2023-09-08 14:49:07 -07:00
Mark Thompson
0d9fd6ddd5 docs: update dependency injection example to standalone (#51587)
PR Close #51587
2023-09-08 10:34:10 -07:00
Mark Thompson
429b76eacf docs: convert dependency-injection-in-action (#51602)
* removes unused modules
* converts all components to standalone

PR Close #51602
2023-09-07 12:55:08 -07:00
Ben Hong
d14560fa06 docs: migrate dynamic-form guide and code to standalone (#51540)
PR Close #51540
2023-09-07 10:07:03 -07:00
Ben Hong
763314f300 docs: migrate errors code example and guide to standalone (#51536)
PR Close #51536
2023-09-07 10:04:39 -07:00
Matthieu Riegler
3e0e6ed60f docs: update Dynamic Component loader docs to rely on ngComponentOutlet (#49915)
With #51148, the `ngComponentOutlet` directive now supports inputs.
This allows a less verbose and simpler API to instantiate components dynamicaly.

Fixes #49875

PR Close #49915
2023-09-07 10:03:22 -07:00
Ben Hong
3f2d783f65 docs: migrate toh-pt3 to standalone (#51581)
PR Close #51581
2023-09-07 10:02:40 -07:00
Ben Hong
52ff8a56d9 docs: migrate toh-pt2 to standalone (#51580)
PR Close #51580
2023-09-06 17:10:16 +00:00
Matthieu Riegler
3c0c53d4df docs: remove mention of the string based lazy loading (#51651)
String based lazy loading has been deprecated in v8 and remove in v13. We can safely remove it from the docs.

PR Close #51651
2023-09-05 16:53:29 +00:00
Ben Hong
3658e25f2e docs: migrate toh-pt0 to standalone (#51575)
PR Close #51575
2023-08-31 21:43:19 +00:00
Ward Bell
acd59ad037 docs: Migrate Observables guides & code examples to standalone (#51516)
None of the guide pages mentions ngModules. Only `observables-in-angular` needed conversion to Standalone.

However, some of the guide pages reflect old versions of RxJS, including signatures that are no longer valid. These have been corrected.

More significantly, *the existing guide is pretty bad at explaining RxJS and its usage*. It was written (by me I think) in the very early days of Angular and Angular RxJS instruction. I've taught numerous "RxJS in Angular" classes since and learned from that experience what does and does not work with students.

There was neither the time nor the charter to completely overhaul this guide. But this commit attempts to remove what flops with students and to bring the teaching closer to what seems more effectively. I hope reviewers agree that my revisions are an improvement.

**Revised Overview**

The overview doc, `observables.md`, had a few errors (ex: `next` is NOT REQUIRED) and deprecated patterns (you now must pass the Observer object to `subscribe`).

More importantly, it was wildly overcomplicated and scary, especially when it got into multi-casting.

Moved the multi-casting section to  "RxJS Library" and rewrote it (with working example) for simplicity and context.

I made other changes in an effort to make this an overview that is  more comprehensive and more clear. I paid particular attention to the "Basic usage and terms" section.

Finally, I relocated the "Naming conventions for observables" section here from `rx-library`. This is the section that describes the dollar-sign convention. It made more sense for it to be here.

**Revised "RxJS Library" page and code**

*RxJS no longer supports chaining* and hasn't for a very long time. Removed note in `rx-library.md` that suggested you could use operator chaining.

The RxJS `pipe` discussion in the "Operators" section was just weird. Almost no one calls the `pipe` function. We certainly should *start* there. We should start with how people actually use operators - by adding them to the argument list of the `Observable.pipe()` method.

I kept the original `pipe` function example but subordinated it in a "callout". Most readers will (and should) ignore it.

`Subject` is a *critically important RxJS mechanism for creating custom observables*. It was completely missing from the list of observable creators on this guide page. So I added it to the "Observable creation functions" section of the guide and wrote an accompanying `MessageService` code sample (see the new `rx-library/app/` folder).

The `MessageService` is a pretty common pattern in Angular apps - far more common than creating an observable from a counter or an event, two of the creation patterns currently on this page.

This new section also afforded an opportunity to show how RxJS helps with building loosely coupled applications. We will soon be talking about Signals. Many will wonder whether and when they should still use RxJS.

At least a partial answer is that RxJS is really good at progressively combining and enhancing streams of data as they cross component boundaries. Of course you can pass signals around; but they are not as rich in transformers as RxJS. This is where RxJS shines.

**Revised "Comparing observables"**

The Promises section in `comparing-observables.md` had many errors and misleading remarks.

The comparison of error handling was especially egregious; the code example for that was nonsense.

The "Chain" sub-section was really about transforming values. It also failed to demonstrate chaining promise `.then`s.

Reworked these sub-sections and improved the code samples to match.

PR Close #51516
2023-08-31 17:00:46 +00:00
Andrew Scott
92f478ea7d docs: update router reference to use standalone (#51560)
this commit updates the router reference to use standalone features.

PR Close #51560
2023-08-31 16:59:15 +00:00
Ben Hong
e4d2018f46 docs: migrate user-input code example to standalone (#51466)
PR Close #51466
2023-08-31 16:37:00 +00:00
Ben Hong
b710ab63b4 docs: migrate two-way-binding to standalone (#51574)
PR Close #51574
2023-08-31 16:36:29 +00:00
Joey Perrott
cfcd2e3aeb refactor(docs-infra): correct incomplete string replacement (#51585)
Find all usages of `\n` and replace them instead of just the first.

PR Close #51585
2023-08-31 16:35:51 +00:00
Luis Castro
6b5c812b6b docs(core): clarify InjectionToken usage (#51386)
- Emphasized the importance of using the same InjectionToken instance for both provider and injection call.
- Added examples to illustrate correct usages to prevent NullInjectorError.

PR Close #51386
2023-08-30 15:53:23 +00:00
Ben Hong
dad47bb720 docs: migrate security guide and example to standalone (#51446)
PR Close #51446
2023-08-30 15:50:57 +00:00