Currently the code sample displayed in this guide is not a valid.
The `trigger` is directly used in the `@Component` decorator.
It should instead be in the `animations` array of the `@Component` decorator.
PR Close#37262
This reverts commit 9f8ccd577f481a3ca4508287ec06cdf863561f69. The
PullApprove labeling is unfortunately removing labels rather than
adding them.
PR Close#40053
These tests started failing because they had type-check
errors in their templates, and a recent commit turned on
full template type-checking by default.\
This commit fixes those templates and updates the expected
files as necessary.
PR Close#40040
These tests do not pass the typecheck phase of the compiler and fail.
The option to disable typechecking was removed recently so these tests
need to be fixed to be valid applications.
PR Close#40033
A couple reasons to justify removing the flag:
* It adds code to the compiler that is only meant to support test cases
and not any production. We should avoid code in that's only
meant to support tests.
* The flag enables writing tests that do not mimic real-world behavior
because they allow invalid applications
PR Close#40013
Rather than returning `null`, we can provide some useful information to the Language Service
by returning a symbol for the `addEventListener` function call when the consumer
of a binding as an element.
PR Close#39312
With the migration to husky@5, the environment variable used to skip husky changed from
`HUSKY_SKIP_HOOKS` to `HUSKY`. To continue skipping husky during the merge process as
expected, the environment variable used is updated.
PR Close#40025
Previously, due to the way the AngularJS and Angular clean-up processes
interfere with each other when removing an AngularJS element that
contains a downgraded Angular component, the data associated with the
host element of the downgraded component was not removed. This data was
kept in an internal AngularJS cache, which prevented the element and
component instance from being garbage-collected, leading to memory
leaks.
This commit fixes this by ensuring the element data is explicitly
removed when cleaning up a downgraded component.
NOTE:
This is essentially the equivalent of #26209 but for downgraded (instead
of upgraded) components.
Fixes#39911Closes#39921
PR Close#39965
The prior usage of a ternary expression caused the code to be formatted
in a weird way, so this commit replaces the ternary with an `if` statement.
PR Close#39961
Prior to this change the interpolation config value was cast to
`[string, string]` without checking whether there really were two
string values available. This commit extracts the logic of parsing the
interpolation config into a separate function and adds a check that
the array contains exactly two strings.
PR Close#39961
This change allows the `AstObject` and `AstValue` types to provide
their represented type as a generic type argument, which is helpful
for documentation and discoverability purposes.
PR Close#39961
This allows the code generation to correspond with a type, which is
helpful for documentation and discoverability purposes. This does not
offer any type-safety with respect to the actually generated code.
PR Close#39961
When the compiler option `checkTypeOfAttributes` is `false`, we should
still be able to produce type information from the
`TemplateTypeChecker`. The current behavior ignores all attributes that
map to directive inputs. This commit includes those attribute bindings
in the TCB but adds the "ignore for diagnostics" marker so they do not
produce errors. This way, consumers of the TTC (the Language Service)
can still get valid information about these attributes even when the
user has configured the compiler to not produce diagnostics/errors for them.
PR Close#39537
The previous image referred to "Mr IQ". The example application
(and the content of the referring guide) actually uses "Dr IQ".
Closes#34823
PR Close#40022
The previous tutorial content referred to a `Routes` member of
`AppRoutingModule`, which is not correct. Instead there is a
`routes` variable that is passed to the `forRoot()` method when
configuring the `AppRoutingModule`.
Replaces #36583
PR Close#40023
1. In line 25 changed the word "components" to "component's".
2. In line 66 changed the phrase "you never refer to them" to "you should never refer to them".
3. Appended the paragraph containing the above phrase in a `div` with the class `alert is-helpful`.
PR Close#39246
Remove the statements where mentions the component in the `entryComponents`
array inside `NgModule` metadata.
This is not required since Angular version 9.
PR Close#39242
Aside from using the @input() decorator, we can use the @Attrbitute decorator too.
Of course, those two are different and support different causes.
I expected to see a working example on the Attribute Bindings section, but I didn't find one.
This PR depicts the usage of the Attribute decorator between two components
PR Close#38721
after angular version 8 string based lazy loading is not activated by default it is an opt in behaviour in which you have to add the lazy loaded routes in the tsconfig file for compilation. Aded a note too that it will be removed in version 11.
Fixes#35652
PR Close#35956
The golden files for the partial compliance tests need to be updated
with individual Bazel run invocations, which is not very ergonomic when
a large number of golden files need to updated. This commit adds a
script to query the Bazel targets that update the goldens and then runs
those targets sequentially.
PR Close#39989
This test migrates source-mapping tests to the new compliance test framework.
The original tests are found in the file at:
`packages/compiler-cli/test/ngtsc/template_mapping_spec.ts`.
These new tests also check the mappings resulting from partial compilation
followed by linking, after flattening the pair of source-maps that each
process generates.
Note that there are some differences between the mappings for full compile
and linked compile modes, due to how TypeScript and Babel use source-span
information on AST nodes. To accommodate this, there are two expectation
files for most of these source files.
PR Close#39939
This commit allows compliance test-cases to be written that specify
source-map mappings between the source and generated code.
To check a mapping, add a `// SOURCE:` comment to the end of a line:
```
<generated code> // SOURCE: "<source-url>" <source code>
```
The generated code will still be checked, stripped of the `// SOURCE` comment,
as normal by the `expectEmit()` helper.
In addition, the source-map segments are checked to ensure that there is a
mapping from `<generated code>` to `<source code>` found in the file at
`<source-url>`.
Note:
* The source-url should be absolute, with the directory containing the
TEST_CASES.json file assumed to be `/`.
* Whitespace is important and will be included when comparing the segments.
* There is a single space character between each part of the line.
* Newlines within a mapping must be escaped since the mapping and comment
must all appear on a single line of this file.
PR Close#39939
Previously one could set a flag in a `TEST_CASES.json` file to exclude
the test-cases from being run if the input files were being compiled
partially and then linked.
There are also scenarios where one might want to exclude test-cases
from "full compile" mode test runs.
This commit changes the compliance test tooling to support a new
property `compilationModeFilter`, which is an array containing one or
more of `"full compile"` and `"linked compile"`. Only the tests
whose `compilationModeFilter` array contains the current compilation
mode will be run.
PR Close#39939
Previously files were serialized with an extra newline seperator that
was not removed when parsing. This caused the parsed file to start with
an extra newline that invalidated its source-map.
Also, the splitting was producing an empty entry at the start of the extracted
golden files which is now ignored.
PR Close#39939
The schema accidentally included the `expectedErrors` and `extraCheck`
properties below the `files` property instead of below the `expectations`
property.
PR Close#39939
Add a TaggedTemplateExpr to represent tagged template literals in
Angular's syntax tree (more specifically Expression in output_ast.ts).
Also update classes that implement ExpressionVisitor to add support for
tagged template literals in different contexts, such as JIT compilation
and conversion to JS.
Partial support for tagged template literals had already been
implemented to support the $localize tag used by Angular's i18n
framework. Where applicable, this code was refactored to support
arbitrary tags, although completely replacing the i18n-specific support
for the $localize tag with the new generic support for tagged template
literals may not be completely trivial, and is left as future work.
PR Close#39122