In CLI version 12, we introduced the concept of production builds by default.
With this change we update the documentation to reflect the changes.
More information about the change can be found https://github.com/angular/angular-cli/pull/20128
PR Close#41173
BREAKING CHANGE:
Switching default of `emitDistinctChangesOnlyDefaultValue`
which changes the default behavior and may cause some applications which
rely on the incorrect behavior to fail.
`emitDistinctChangesOnly` flag has also been deprecated and will be
removed in a future major release.
The previous implementation would fire changes `QueryList.changes.subscribe`
whenever the `QueryList` was recomputed. This resulted in an artificially
high number of change notifications, as it is possible that recomputing
`QueryList` results in the same list. When the `QueryList` gets recomputed
is an implementation detail, and it should not be the thing that determines
how often change event should fire.
Unfortunately, fixing the behavior outright caused too many existing
applications to fail. For this reason, Angular considers this fix a
breaking fix and has introduced a flag in `@ContentChildren` and
`@ViewChildren`, that controls the behavior.
```
export class QueryCompWithStrictChangeEmitParent {
@ContentChildren('foo', {
// This option is the new default with this change.
emitDistinctChangesOnly: true,
})
foos!: QueryList<any>;
}
```
For backward compatibility before v12
`emitDistinctChangesOnlyDefaultValue` was set to `false. This change
changes the default to `true`.
PR Close#41121
Previously, the indentation of code snippets in the "Cheat sheet" guide
was done using `<br>` elements (for line breaks) and ` ` HTML
entities (for space). This was laborious and put the onus on the author
to remember to use these symbols (instead of regular whitespace
characters).
(Discussed in
https://github.com/angular/angular/pull/41051#discussion_r585651621.)
This commit changes the way `<code>` elements are styles inside the
"Cheat sheet" guide to allow using regular whitespace characters in code
snippets. It also changes all `<br>`/` ` occurrences to `\n`/` `
respectively to make code snippets more readable in the source code.
PR Close#41051
Previously, with the min width of 220px per item, several API list items
were truncated.
This commit increases the min width per item to 330px, which allows
almost all items to have their full text shown. It also increases the
API list page's max content width from 50em (800px) to 62.5em (1000px)
to allow items to be shown on three columns despite their increased
width. This increase in the content width shouldn't negatively affect
UX, since the API list page uses a multi-column layout (i.e. it does not
contain 1000px-lines of text.)
Before: ![api-list before][1]
After: ![api-list after][2]
[1]: https://user-images.githubusercontent.com/8604205/109396457-5f5e1f00-793a-11eb-80cf-1418f409325a.png
[2]: https://user-images.githubusercontent.com/8604205/109396659-499d2980-793b-11eb-95d3-f54250f7fab5.png
PR Close#41051
Previously, each marketing page used a different limit for its content's
width (if it had a limit at all) and implemented the width limiting in a
different way. Besides resulting in an inconsistent UX, this also made
it difficult to apply site-wide layout changes.
This commit makes the limit for most marketing pages consistent and uses
the same CSS class to make it easier to apply site-wide changes in the
future. The chosen limit is slightly larger than that of docs pages
(62.5em/1000px vs 50em/800px), because marketing pages have a different
type of content and layout (i.e. images, multi-column layout, etc.).
Finally, this commit also removes obsolete wrapper elements, CSS classes
and CSS styles, that are no longer necessary after the changes.
Notably, the homepage (`/`) and the "Contributors" page (`/about`) have
remained unchanged, because the former has its own layout that is
different from other marketing pages and the latter would offer a worse
UX with a small content width limit (as the one used on other marketing
pages).
The content widths of the rest of the marketing pages change slightly as
a result of the changes in this commit, but not in a way that would have
a negative impact on UX. More specifically:
| Page (URL) | Size before | Size after |
|:--------------|------------:|-----------:|
| `/contribute` | 880px | 1000px |
| `/events` | unlimited | 1000px |
| `/features` | 996px | 1000px |
| `/presskit` | 800px | 1000px |
| `/resources` | 800px | 1000px |
PR Close#41051
This commit removes an unnecessary wrapper `<div>` from the
"Cheat sheet" guide. The CSS styles that referenced the element's ID
(`#cheatsheet`) have been updated to use `.page-guide-cheatsheet`
instead.
PR Close#41051
setting the `hero` property as an optional property fixes the compilation
error: `Property 'hero' has no initializer and is not definitely assigned
in the constructor` when having the ts transpiler set to "strict" mode.
PR Close#40942
After my speaker meeting with the Geekle team, they communicated that
they moved the date to avoid colliding with ng-conf. Originally added
in#40697, per @mgechev.
PR Close#41050
Shifts colors to pass WebAIM contrast checker and adds media
query so that body padding is smaller at smaller widths.
Body padding responsiveness will help on StackBlitz and small
screens.
PR Close#40890
This commit replaces some outdated URLs in "Contribute" links (on the
"Contribute" page):
- `github.com/angular/material2` --> `github.com/angular/components`
- `github.com/angular/angularfire2` --> `github.com/angular/angularfire`
It also replaces the deprecated `md-button` attribute with `mat-button`.
PR Close#40944
This change fixes an incompatibility between the old `@angular/http` package
and its successor (`@angular/common/http`) by re-introducing the types that were supported before.
It now allows to use number and boolean directly as HTTP params, instead of having to convert it to string first.
Before:
this.http.get('/api/config', { params: { page: `${page}` } });
After:
this.http.get('/api/config', { params: { page }});
`HttpParams` has also been updated to have most of its methods accept number or boolean values.
Fixes#23856
BREAKING CHANGE:
The methods of the `HttpParams` class now accept `string | number | boolean`
instead of `string` for the value of a parameter.
If you extended this class in your application,
you'll have to update the signatures of your methods to reflect these changes.
PR Close#40663
The "Press kit" page has a "Terminology" section that lists a couple of
terms (currently AOT and JIT compilation).
This commit adds links to the corresponding entries in "Glossary" to
make it easier for people to find out what the terms mean.
PR Close#40945
Fixes error: `TS2564: Property 'heroes' has no initializer and is not definitely assigned in the constructor`
and makes `hero` property consistent with ch 3 (ref: #40942)
PR Close#40970
Increases contrast of example copy.
Explicitly references inputs from labels.
Updates screenshot of styles that aren't accessible.
Removes the term master.
Provides more detailed alternate text for the image.
Adds padding to input so it is an easier target for touch or pointer.
PR Close#40575
Previously, some of the links on the error pages had URLs prefixed with
`https://angular.io/`. This caused them to be treated as external URLs,
which had the following downsides:
- Links would always point to `angular.io` instead of the same version
as the error page (e.g. `next.angular.io` or `v11.angular.io`).
- Dgeni would not be able to check that the URLs are valid (i.e. point
to existing pages).
- An external link icon would incorrectly be shown next to the links on
`angular.io`.
This commit fixes the links to use relative URLs.
PR Close#40881
Our approach for handling cyclic imports results in code that is
not easy to tree-shake, so it is not suitable for publishing in a
library.
When compiling in partial compilation mode, we are targeting
such library publication, so we now create a fatal diagnostic
error instead of trying to handle the cyclic import situation.
Closes#40678
PR Close#40782
In #40419 we move the code that creates the `heroes` object
above the code that updates the message service. But this moved
that line of code outside of the docregion that is displayed in
the tutorial ealier on, making it non-sensical.
This commit ensures that this line of code is now rendered in the
tutorial be moving it within the correct docregion.
Closes#40788
PR Close#40789
Update the HTTP guide and associated example to demonstrate
how an interceptor can be used to provide a custom JSON parser.
Resolves#21079
PR Close#40645
After the docs UI redesign `h2` tags got a border top.
`border-top: 1px solid #dbdbdb;`;
In the sections of Getting Started guide in order to separate
`What's next` from above content an `<hr />` tag was used,
that now becomes unnecessary.
This commit removes unnecessary `<hr />` tags.
PR Close#40693
Initially raised due to #39509, this change updates our
"Support policy and schedule" with the same disclaimer
from the "Release frequency" section above.
PR Close#40770
The removed bit was copied and pasted from a previous section. Not relevent for the particular step of the tutorial.
The removed bit can we found as intended in __Adding Navigation__ section.
PR Close#40812
Observables are not the only async mechanism that Angular employs.
This change respects that application developers are not required to
use Observables in their own application architecture.
Closes#39155
PR Close#39237
This commit updates the documentation style guide
so that it is in line with current standards, those
of Google as well as those within the Angular docs.
PR Close#36281
This commit includes some general improvements to heading styles
(font-weight, margin/padding). It also adds a horizontal separator above
`<h2>` headings to segment important sections more easily.
(As a consequence, we can remove several `<hr />` elements right before
`<h2>` headings.)
Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>
PR Close#40427
This commit adds a warning in the Elements guide about using
`@Component.selector` as the tag name for the registered custom element.
See also #40452 for context.
PR Close#40510
The previous commit introduced extra checks to verify contributors.json data and this commit contains the necessary
fixes to the problems identified by the new set of checks.
PR Close#40369
Currently entries in the `contributors.json` file are not sorted and new entries are typically added at the very
end of the file, which is often causing merge conflicts. This commit updates the `contributors.json` to have all
entries sorted in alphabetical order (based on GitHub handles), which should reduce the number of merge conflicts.
PR Close#40369
Providing an array to `[style]` bindings is not supported and the behavior
of the rendered style attribute is not as one might expect.
This commit removes that array example from the table to discourage its
use.
Fixes#40147
PR Close#40334
In #37182 the in-memory-web-api module was moved into this repo.
Make links in the docs point to the new location of the in-memory-web-api.
Fixes#40190
PR Close#40203
PR #34934 switched the `getting-started` docs example from using the
index of a product in the `products` array to using the product's ID
property for indentifiying each product in the `ProductDetailsComponent`
component. However, some necessary changes in the example code and the
`start-routing.md` guide were missed in #34934, resulting in broken
instructions for the readers (see #40189).
This commit is essentially a follow-up to #34934, making the remaining
changes in the example code and the guide instructions.
Fixes#40189
PR Close#40197
This commit slightly refactors the code in the `get-product` docregion
of the `getting-started` docs example to make it easier to follow.
PR Close#40197
This commit does some minor clean-up in docregions of the
`getting-started` docs example. More specifically, it:
- Removes redundant docregion markers.
- Fixes whitespace inconsistencies.
- Adds `/* ... */` to indicate that there is more code before the end of
a docregion (in order to avoid confusion).
PR Close#40197
This commit aligns the code and style in the `getting-started-v0` docs
example with that of the `getting-started` example more closely (except
for the the parts that are intentionally different between the two).
PR Close#40197