Compare commits

..

126 Commits
9.0.5 ... 9.0.7

Author SHA1 Message Date
a90e82db3e release: cut the v9.0.7 release 2020-03-18 13:33:04 -07:00
647eb879ab docs: adding a note on extra text interpolations and HTML tags in translations to Ivy guide (#36029)
This commit updates Ivy compatibility guide with additional note on extra text interpolations and HTML tags in translations.

PR Close #36029
2020-03-18 10:01:01 -07:00
c8960f44eb docs(upgrade): remove outdated/non-applicable AOT section from upgrade guide (#36015)
The AOT compilation section of the `ngUpgrade` guide was
outdated/non-applicable. This commit hides the section to avoid confusion.
Fixing the section and re-introducing it is being tracked in #35989.

PR Close #36015
2020-03-18 10:00:05 -07:00
0bc14ff71b build(docs-infra): clean up dependencies and npm scripts in systemjs docs examples (#36015)
Previously, the `package.json` files added as boilerplate to docs
example projects of type `systemjs` were incorrect/outdated. They
contained unused dependencies and npm scripts and omitted used
dependencies.

This is not a big issue, because these examples are not offered as live
StackBlitz examples or downloadable ZIP archives, but having incorrect
`package.json` files is confusing and makes it more complicated to
update these examples.

This commit updates the `package.json` templates for the `systemjs` docs
examples and other configuration files to include used dependencies (and
remove unused ones). It also removes unused npm scripts.

PR Close #36015
2020-03-18 10:00:05 -07:00
b766ada8d3 build(docs-infra): update project structure to cli@9 12/12 (dependencies) (#36015)
Update dependencies.
Also, disable AOT tests for `systemjs`-type examples in Ivy mode,
because our current setup does not work with v9. See #35989 for details.

Fixes #34382
Fixes #34383

PR Close #36015
2020-03-18 10:00:05 -07:00
c4eaf26a16 build(docs-infra): update project structure to cli@9 11/12 (angular.json) (#36015)
Update `angular.json`.

PR Close #36015
2020-03-18 10:00:05 -07:00
b0e04b133a build(docs-infra): update project structure to cli@9 10/12 (tsconfig.json) (#36015)
Update `tsconfig[.*].json`.
Also, all make necessary changes to ensure the example apps can be
successfully built with the new, stricter type-checking options.

PR Close #36015
2020-03-18 10:00:05 -07:00
ff973f1200 build(docs-infra): update project structure to cli@9 9/12 (tslint.json) (#36015)
Update `tslint.json`.

PR Close #36015
2020-03-18 10:00:05 -07:00
ec6555c206 build(docs-infra): update project structure to cli@9 8/12 (favicon.ico) (#36015)
Update `favicon.ico`.

PR Close #36015
2020-03-18 10:00:05 -07:00
0108e75c15 build(docs-infra): update project structure to cli@9 7/12 (.gitignore, protractor.conf.js) (#36015)
Update configs (`.gitignore`, `protractor.conf.js`).

PR Close #36015
2020-03-18 10:00:05 -07:00
063e165bcc build(docs-infra): update project structure to cli@9 6/12 (index.html) (#36015)
Update `index.html` (mostly remove empty line).

PR Close #36015
2020-03-18 10:00:04 -07:00
1eb76f78aa build(docs-infra): update project structure to cli@9 5/12 (polyfills.ts) (#36015)
Update `polyfills.ts` (`import './zone-flags.ts'` --> `import './zone-flags'`).

PR Close #36015
2020-03-18 10:00:04 -07:00
1cd5739b60 build(docs-infra): update project structure to cli@9 4/12 (test.ts) (#36015)
Update `test.ts`.

PR Close #36015
2020-03-18 10:00:04 -07:00
cc40b7dc12 build(docs-infra): update project structure to cli@9 3/12 (title in a h1 tag) (#36015)
Make test description less implementation specific.

PR Close #36015
2020-03-18 10:00:04 -07:00
3440d0ba3b build(docs-infra): update project structure to cli@9 2/12 (fixture.debugElement.componentInstance) (#36015)
`fixture.debugElement.componentInstance` --> `fixture.componentInstance`

PR Close #36015
2020-03-18 10:00:04 -07:00
131767cd8d build(docs-infra): update project structure to cli@9 1/12 (app.po.ts) (#36015)
Update `app.po.ts`.

PR Close #36015
2020-03-18 10:00:04 -07:00
a2d8a2bec5 build(docs-infra): avoid Karma error when loading scripts from code.angularjs.org (#36015)
In the example apps used in the `ngUpgrade` guide, the AngularJS files
are loaded in `index.html` from `https://code.angularjs.org/`. Latest
browsers prevent loading the scripts from a page running on localhost
due to CORS:

```
Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin
'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
header is present on the requested resource.
```

NOTE:
Loading the files from `code.angularjs.org` is not mentioned in the
guide, therefore it is not needed to mention this config change there.

PR Close #36015
2020-03-18 10:00:04 -07:00
5f189533de build(docs-infra): remove obsolete content from example-config.json files (#36015)
The `build` and `run` properties in `example-config.json` are only used
in example projects of type `systemjs`. In CLI-type projects, `build`
and `run` are ignored.

PR Close #36015
2020-03-18 10:00:04 -07:00
6c8e781053 build(docs-infra): remove obsolete content from example-config.json in setup example (#36015)
The `unittesting` property in `example-config.json` is a remnant of the
setup (before `aio/` was moved into the `angular/angular` repo) and has
no effect any more.

PR Close #36015
2020-03-18 10:00:04 -07:00
f09eb50738 build(docs-infra): remove unused ngmodule-faq and visual-studio-2015 examples (#36015)
PR Close #36015
2020-03-18 10:00:03 -07:00
d98e4f41bd build(docs-infra): remove unused test.html file from testing example (#36015)
This file was from back when the `testing` example was not based on the
Angular CLI and is not used any more.

PR Close #36015
2020-03-18 10:00:03 -07:00
39bbb3b86a build(docs-infra): remove unused jsconfig.json file (#36015)
PR Close #36015
2020-03-18 10:00:03 -07:00
99c41659eb ci(docs-infra): use the regular (non-Ivy) Angular packages in test_docs_examples_ivy CI job (#36015)
The docs examples tests are run both with Ivy turned off and on. When
Ivy is turned on, ngcc is used to convert all dependencies (including
the Angular framework packages to Ivy).

Previously, in order to speed things up, the `test_docs_examples_ivy` CI
job would use Angular packages built with Ivy (from
`dist/packages-dist-ivy-aot`). This however was a deviation from what
happens in real-world applications.

This commit changes the `test_docs_examples_ivy` CI job to always use
the regular Angular packages (as published on npm) and use ngcc to
convert them to Ivy.

Relevant discussion:
https://github.com/angular/angular/pull/35091#discussion_r373775396

PR Close #36015
2020-03-18 10:00:03 -07:00
76d7188872 fix(ngcc): consistently delegate to TypeScript host for typing files (#36089)
When ngcc is compiling an entry-point, it uses a `ReflectionHost` that
is specific to its format, e.g. ES2015, ES5, UMD or CommonJS. During the
compilation of that entry-point however, the reflector may be used to
reflect into external libraries using their declaration files.

Up until now this was achieved by letting all `ReflectionHost` classes
consider their parent class for reflector queries, thereby ending up in
the `TypeScriptReflectionHost` that is a common base class for all
reflector hosts. This approach has proven to be prone to bugs, as
failing to call into the base class would cause incompatibilities with
reading from declaration files.

The observation can be made that there's only two distinct kinds of
reflection host queries:
1. the reflector query is about code that is part of the entry-point
   that is being compiled, or
2. the reflector query is for an external library that the entry-point
   depends on, in which case the information is reflected
   from the declaration files.

The `ReflectionHost` that was chosen for the entry-point should serve
only reflector queries for the first case, whereas a regular
`TypeScriptReflectionHost` should be used for the second case. This
avoids the problem where a format-specific `ReflectionHost` fails to
handle the second case correctly, as it isn't even considered for such
reflector queries.

This commit introduces a `ReflectionHost` that delegates to the
`TypeScriptReflectionHost` for AST nodes within declaration files,
otherwise delegating to the format-specific `ReflectionHost`.

Fixes #35078
Resolves FW-1859

PR Close #36089
2020-03-17 13:34:06 -07:00
daa2179bb2 test(ngcc): use "module" format property for ES5 bundles (#36089)
The format property for ES5 bundles should be "module" or "es5"/"esm5",
but was "main" instead. The "main" property is appropriate for CommonJS
and UMD bundles, not for ES5 bundles.

PR Close #36089
2020-03-17 13:34:06 -07:00
3c19a5d49f build: fix ts-api-guardian golden approval not working on windows (#36115)
Currently on Windows, it's not possible to approve goldens in
`ts-api-guardian`. This is because paths are resolved relatively
to the working directory. In Windows, golden files are resolved
to the actual workspace directory. The current logic tries to
compute a relative path to the runfile from the working directory.

This causes the file paths to have a lot of parent directory
path segments. Eventually, when joined with the build workspace
directory, the paths end up being incorrect. e.g.

```
fileName = ../../../../../../projects/angular/golden/<..>/common.d.ts`
outFile = BUILD_WORKSPACE_DIR + fileName;
```

To fix this, we no longer deal with confusing relative paths, but
instead always use absolute file system paths.

Additionally, this fixes that new goldens are generated at the wrong
location on all platforms.

PR Close #36115
2020-03-17 12:38:26 -07:00
ee4c9f05c7 build: update to latest @bazel/ibazel version (#36116)
Patch version of #36097

Updates to the latest `@bazel/ibazel` version that properly
resolves local `@bazel/bazelisk` installations.

The support for this temporarily broke from `0.12.0` to `0.12.2`.
https://github.com/bazelbuild/bazel-watcher/issues/352.

PR Close #36116
2020-03-17 12:37:30 -07:00
48fa89f5f1 build: fix saucelabs jobs that were broken by bazelisk change (#36109)
PR Close #36109
2020-03-17 12:28:04 -07:00
f1ed672a0d build: watch for sauce service failures when waiting for it to start (#36109)
Also add two targets to make it more convienent to tail & dump the sauce service logs: //tools/saucelabs:sauce_service_tail & //tools/saucelabs:sauce_service_log

PR Close #36109
2020-03-17 12:28:03 -07:00
c21dd54776 ci: run ts-circular-deps check in lint job on ci (#35647)
PR Close #35647
2020-03-17 12:27:08 -07:00
545126e41f ci: set up golden file for typescript circular dependencies (#35647)
Sets up a golden file for the TypeScript circular dependencies for
source files inside of the `packages/` folder.

Also sets up the appropriate Yarn shorthand scripts, and a codeowner
group that is soley responsible for verifying changes to the golden.

PR Close #35647
2020-03-17 12:27:08 -07:00
79b012bf30 build: remove rollup packaging from dev-infra (#35647)
The dev-infra package currently uses rollup for packaging. This has been
done initially as a way to workaround manifest paths being used in the
AMD JavaScript output.

The actual solution to this problem is setting module names that match
the `package.json` name. This ensures that the package can be consumed
correctly in Bazel, and through NPM. This allows us to get rid of the
rollup bundling, and we don't need to hard-code which dependencies
should be external or included.

Additionally, tools that are part of `dev-infra` can now specify
their external dependencies simply in the `package.json`. To reduce
version duplication, and out-of-sync versions, a new genrule has been
created that syncs the versions with the top-level project
`package.json`.

PR Close #35647
2020-03-17 12:27:08 -07:00
f3db26aa13 refactor: move ts-circular-dependencies tool to dev-infra (#35647)
PR Close #35647
2020-03-17 12:27:08 -07:00
264bbded09 build: create tool for validating typescript circular dependencies (#35647)
Creates a tool for validating TypeScript circular dependencies. The tool
has been designed in a way that allows us to slowly burn down the amount
of circular dependencies while ensuring that we don't regress.

The tool doesn't rely on Madge since it doesn't provide a programmatic
way for doing path mapping. We need path mapping since we also want to
check for cycles across different entry-points or packages. The tool
uses the TypeScript AST to manually collect cycles. This code is not
a lot of bloat and also gives us more flexibility (if we ever need it).

Closes #35041.

PR Close #35647
2020-03-17 12:27:08 -07:00
70425d2a3c Revert "build: fix ts-api-guardian golden approval not working on windows (#36096)" (#36113)
This reverts commit f862536ec4.

Reverted due to test failures that have shown up in the Windows CI Jobs
that don't run on pull requests. A follow-up will be sent that re-adds
the changes w/ fixes for the windows test job.

PR Close #36113
2020-03-17 11:18:08 -07:00
35d94e9d08 build: fix ts-api-guardian golden approval not working on windows (#36096)
Currently on Windows, it's not possible to approve goldens in
`ts-api-guardian`. This is because paths are resolved relatively
to the working directory. In Windows, golden files are resolved
to the actual workspace directory. The current logic tries to
compute a relative path to the runfile from the working directory.

This causes the file paths to have a lot of parent directory
path segments. Eventually, when joined with the build workspace
directory, the paths end up being incorrect. e.g.

```
fileName = ../../../../../../projects/angular/golden/<..>/common.d.ts`
outFile = BUILD_WORKSPACE_DIR + fileName;
```

To fix this, we no longer deal with confusing relative paths, but
instead always use absolute file system paths.

Additionally, this fixes that new goldens are generated at the wrong
location on all platforms.

PR Close #36096
2020-03-17 10:42:10 -07:00
36c6f94279 build(zone.js): Update zone.js release process to use google-wombot (#36110)
Updated the docs to use the `google-wombot` release process.

PR Close #36110
2020-03-17 10:40:35 -07:00
8da4adc4dd feat(dev-infra): create common config file loading util (#36091)
Create a common config file loading utility function and the
necessary util directory.  This util directory can provide common
utility functions for usage inside of the dev-infra package.

PR Close #36091
2020-03-17 09:30:32 -07:00
2e83391b78 docs: remove browserstack badge from readme (#35684)
We don't run tests on Browserstack for this repository. Also the
badge was referring to a non-existent project.

This removes the badge since we don't need it anymore, and rather
we should generate a new one for repositories like `angular/components`
where browserstack is actually used, and where the badge can provide
useful information.

Closes #28287.

PR Close #35684
2020-03-17 09:29:45 -07:00
ec750caff0 refactor(core): misc refactoring to support upcoming changes to improve synthetic host bindings (#35884)
This commit performs a few updates to internal functions that would be required in upcoming changes to support synthetic host bindings in Directives.

* the `elementPropertyInternal` function was refactored to accept renderer as an argument (prior to that, there was a function that loads the renderer in some specific way for animation bindings)
* `elementPropertyInternal`, `elementAttributeInternal` and `listenerInternal` functions were updated to have a fixed set of arguments (for better performance)
* `elementPropertyInternal` and `elementAttributeInternal` functions were updated to take `tNode` as an argument instead of passing node index (that was used to retrieve `tNode` internally), in some cases we already have `tNode` available or we can retrieve it from the state

The refactoring was triggered by the need to pass different renderers to the `elementPropertyInternal` to support synthetic host bindings in Directives (see this comment for additional context: https://github.com/angular/angular/pull/35568/files#r388034584).

PR Close #35884
2020-03-16 16:44:05 -07:00
a52b5680cb fix(compiler): do not recurse to find static symbols of same module (#35262)
To create the symbols of a module, the static symbol resolver first gets
all the symbols loaded in the module by an export statement. For `export
* from './module'`-like statements, all symbols from `./module` must be
loaded. In cases where the exporting module is actually the same module
that the export statement is in, this causes an unbounded recursive
resolution of the same module.

Exports of the same module are not needed, as their symbols will be
resolved when the symbols in the module metadata's `metadata` key is
explored.

This commit resolves the unbounded recursion by loading exporting
modules only if they differ from the module currently being resolved.

Closes https://github.com/angular/vscode-ng-language-service/issues/593

PR Close #35262
2020-03-16 10:52:25 -07:00
a6bf31b30e fix(compiler): support directive inputs with interpolations on <ng-template>s (#35984)
Prior to this commit, Ivy compiler didn't handle directive inputs with interpolations located on `<ng-template>` elements (e.g. `<ng-template dir="{{ field }}">`). That was the case for regular inputs as well as inputs that should be processed via i18n subsystem (e.g. `<ng-template i18n-dir dir="Hello {{ name }}">`). This commit adds support for such expressions for explicit `<ng-template>`s as well as a number of tests to confirm the behavior.

Fixes #35752.

PR Close #35984
2020-03-16 10:51:19 -07:00
1342668fd1 fix(zone.js): zone.js patches rxjs should check null for unsubscribe (#35990)
Close #31687, #31684

Zone.js patches rxjs internal `_subscribe` and `_unsubscribe` methods, but zone.js doesn't do null check, so in some operator such as `retryWhen`, the `_unsubscribe` will be set to null, and will cause
zone patched version throw error.

In this PR, if `_subscribe` and `_unsubscribe` is null, will not do the patch.

PR Close #35990
2020-03-16 09:01:18 -07:00
a24eddbcfd test(core): Update transplanted views benchpress test to support VE (#36058)
Remove uses of render3 internal `detectChanges` calls to allow test to
be run against VE code as well as Ivy.

PR Close #36058
2020-03-13 12:35:12 -07:00
9e698b7cca fix(docs-infra): remove routerLink from top-bar (#35951)
Closes #35947

PR Close #35951
2020-03-13 08:25:40 -07:00
a8cc6a2ea2 build: enable forms tests on IE (#35971)
Enables running the `forms` unit tests against IE on Saucelabs. It seems like original failures have been resolved.

PR Close #35971
2020-03-13 08:01:23 -07:00
4ce90985e7 perf(ngcc): store the position of SegmentMarkers to avoid unnecessary computation (#36027)
Previously, calculations related to the position of and difference between
SegmentMarkers required extensive computation based around the line,
line start positions and columns of each segment.

PR Close #36027
2020-03-13 08:00:30 -07:00
a0fa63b7ca perf(ngcc): link segment markers for faster traversal (#36027)
The merging algorithm needs to find, for a given segment, what the next
segment in the source file is. This change modifies the `generatedSegment`
properties in the mappings so that they have a link directly to the following
segment.

PR Close #36027
2020-03-13 08:00:30 -07:00
daa2a08b99 perf(ngcc): use line start positions for computing offsets in source-map flattening (#36027)
By computing and caching the start of each line, rather than the length
of each line, we can save a lot of duplicated computation in the `segmentDiff()`
and `offsetSegment()` functions.

PR Close #36027
2020-03-13 08:00:30 -07:00
e6167cfe57 fix(ngcc): handle multiple original sources when flattening source-maps (#36027)
Previously the list of original segments that was searched for incoming
mappings did not differentiate between different original source files.

Now there is a separate array of segments to search for each of the
original source files.

PR Close #36027
2020-03-13 08:00:30 -07:00
8768fc4de4 perf(ngcc): use binary search when flattening mappings (#36027)
The `@angular/core` package has a large number of source files
and mappings which exposed performance issues in the new source-map
flattening algorithm.

This change uses a binary search (rather than linear) when finding
matching mappings to merge. Initial measurements indicate that this
reduces processing time for `@angular/core` by about 50%.

PR Close #36027
2020-03-13 08:00:30 -07:00
d03da9c041 test(ngcc): remove unused FileSystem variable (#36027)
PR Close #36027
2020-03-13 08:00:30 -07:00
9cd115d153 fix(core): verify parsed ICU expression at runtime before executing it (#35923)
Prior to this commit, i18n runtime logic relied on the assumption that provided translation is syntactically correct, specifically around ICU syntax. However provided translations might contain some errors that lead to parsing failure. Specifically when translation contains curly braces, runtime i18n logic tries to parse them as an ICU expression and fails. This commit validates ICU parsing result (making sure it was parsed correctly) and throws an error if parsing error happens. The error that is thrown also contains translated message text for easier debugging.

Note: the check and the error message introduced in this PR is a safeguard against the problem that led to unhandled i18n runtime logic crash. So the framework behavior remains the same, we just improve the error message and it should be safe to merge to the patch branch.

Resolves #35689.

PR Close #35923
2020-03-13 07:58:54 -07:00
f699c962bb test(core): Add benchpress test for transplanted view change detection (#36001)
Adds a performance benchmark for transplanted views (those which are declared in one component and inserted into another).

PR Close #36001
2020-03-12 12:14:41 -07:00
dec80b0e35 revert: "ci: prevent api golden tests on windows CI (#36025)" (#36034)
This reverts commit 3112b1b00a.

PR Close #36034
2020-03-12 09:49:01 -07:00
13abbeb289 build: provide full paths to ts_api_guardian_test_npm_package and ts_api_guardian_test (#36034)
ts-api-guardian uses `require.resolve` to resolve the actual and golden files under bazel. In Windows for these files to be resolved correct the full path including the workspace name as per the MANIFEST entries is required.

This used to be the case until the recent changes done to use npm_integration tests

83c74ceacf/tools/public_api_guard/public_api_guard.bzl (L19)
83c74ceacf/tools/public_api_guard/public_api_guard.bzl (L28)

```
bazel test //packages/... --test_tag_filters=api_guard

//packages/animations:animations_api                            (cached) PASSED in 18.4s
//packages/common:common_api                                    (cached) PASSED in 25.5s
//packages/compiler-cli:compiler_options_api                    (cached) PASSED in 12.4s
//packages/compiler-cli:error_code_api                          (cached) PASSED in 11.6s
//packages/core:core_api                                        (cached) PASSED in 20.6s
//packages/core:ng_global_utils_api                             (cached) PASSED in 13.5s
//packages/elements:elements_api                                (cached) PASSED in 11.9s
//packages/forms:forms_api                                      (cached) PASSED in 13.9s
//packages/http:http_api                                        (cached) PASSED in 14.8s
//packages/localize:localize_api                                (cached) PASSED in 6.3s
//packages/platform-browser:platform-browser_api                (cached) PASSED in 18.1s
//packages/platform-browser-dynamic:platform-browser-dynamic_api (cached) PASSED in 14.0s
//packages/platform-server:platform-server_api                  (cached) PASSED in 13.9s
//packages/platform-webworker:platform-webworker_api            (cached) PASSED in 13.7s
//packages/platform-webworker-dynamic:platform-webworker-dynamic_api (cached) PASSED in 11.7s
//packages/router:router_api                                    (cached) PASSED in 19.9s
//packages/service-worker:service-worker_api                    (cached) PASSED in 18.1s
//packages/upgrade:upgrade_api                                  (cached) PASSED in 13.5s
```

Reference: DEV-71

PR Close #36034
2020-03-12 09:49:01 -07:00
13d85e10a2 docs: add developer survey 2020 (#35655)
PR Close #35655
2020-03-11 16:10:48 -07:00
7af0648207 build: remove legacy integration test runner (#35985)
* integration tests target definitions in integration/BUILD.bazel updated to use a single dict
* payload tracking for integration tests updated to work under Bazel
* legacy integration_test CI job removed
* integration/run_tests.sh script no longer used in CI so it has been updated for running integration tests locally in the legacy way

PR Close #35985
2020-03-11 15:12:34 -07:00
1dca5e4748 fix(zone.js): fix zone-patch-rxjs bundle to refer to rxjs (rather than include) it. (#35983)
Close #35878.

Before zone.js 0.10, the rollup config would refer to `rxjs` when bundling `zone-patch-rxjs.js`
From zone.js 0.10, we started to use bazel to build `zone-patch-rxjs.js` and the configuration was wrongly defined to include a copy of `rxjs` in the `zone-patch-rxjs.js`.

PR Close #35983
2020-03-11 15:09:04 -07:00
2c5dd3fe71 refactor(ngcc): remove unused LockFileWithSignalHandlers (#35934)
PR Close #35934
2020-03-11 15:07:10 -07:00
743ce7b964 fix(ngcc): a new LockFile implementation that uses a child-process (#35934)
This version of `LockFile` creates an "unlocker" child-process that monitors
the main ngcc process and deletes the lock file if it exits unexpectedly.

This resolves the issue where the main process could not be killed by pressing
Ctrl-C at the terminal.

Fixes #35761

PR Close #35934
2020-03-11 15:07:09 -07:00
f2295448f3 refactor(ngcc): move locking code into its own folder (#35934)
PR Close #35934
2020-03-11 15:07:09 -07:00
3f930fd186 refactor(ngcc): separate SyncLocker and LockFile (#35934)
The previous implementation mixed up the management
of locking a piece of code with the management of writing
and removing the lockFile that is used as the flag for
which process has locked the code.

This change splits these two concepts up, allowing the `LockFile`
implementation to be replaced cleanly.

PR Close #35934
2020-03-11 15:07:09 -07:00
1d04f98170 refactor(ngcc): expose logging level on the logger (#35934)
PR Close #35934
2020-03-11 15:07:09 -07:00
e262962b12 fix(docs-infra): add boilerplate path and project type for elements example project (#33484)
Fixes #31332

PR Close #33484
2020-03-11 14:52:59 -04:00
f5e44108b2 fix(language-service): infer $implicit value for ngIf template contexts (#35941)
Today, the language service infers the type of variables bound to the
"ngIf" template context member of an NgIf directive, but does not do the
same for the the "$implicit" context member. This commit adds support
for that.

Fixes https://github.com/angular/vscode-ng-language-service/issues/676

PR Close #35941
2020-03-11 14:52:28 -04:00
4659bca69b fix(dev-infra): sort contributors alphabetically in get-data.ts script (#35997)
The `contributing-stats/get-data.ts` script, which is used to retrieve
org-wide contribution data, returned the contributors in retrieval
order.

This commit ensures contributors are ordered alphabetically, which makes
it easier to find the stats for a specific contributor.

PR Close #35997
2020-03-11 14:49:18 -04:00
65e0595c55 refactor(docs-infra): merge .api-body style blocks (#31574)
This commit merges the two `.api-body` style blocks, removing duplicate
styles and re-ordering sub-blocks (to group relevant styles together).
It should not affect styling.

PR Close #31574
2020-03-11 14:47:17 -04:00
2ff4d11e58 refactor(docs-infra): remove duplicate .github-links styles (#31574)
PR Close #31574
2020-03-11 14:47:16 -04:00
7b0a1d2df4 fix(docs-infra): make API member name bold (#31574)
- Return API member name bold font weight
- SCSS formatting cleanup

Closes #31494

PR Close #31574
2020-03-11 14:47:16 -04:00
4a1f115d65 docs: change grammar in architecture guide (#35541)
grammar change for better understanding

PR Close #35541
2020-03-11 14:46:45 -04:00
17921157b5 build: add more info to SauceLabs README (#35704)
This commit adds a debugging section to the existing
SauceLabs README. It lays out tips to debug and resolve
a few issues that I encountered while running SauceLabs
locally this morning. It also adds some clarification
to the steps in the beginning.

PR Close #35704
2020-03-11 14:46:16 -04:00
510e3bfe7e fix(dev-infra): do not run the lock-closed GitHub action on forks (#36000)
Previously, the `lock-closed` GitHub action, which runs daily and locks
closed inactive issues, was run on each fork of the `angular/angular`
repo. While the action is a [no-op on forks][1], it make still fail from
time to time, generating a confusing notification e-mail for the fork
owner.

This commit configures the `lock-closed` action to only run on the main
`angular/angular` repository (using the method suggested [here][2]).

[1]: https://github.com/angular/dev-infra/blob/13b25d383/github-actions/lock-closed/src/main.ts#L117
[2]: https://github.community/t5/GitHub-Actions/Do-not-run-cron-workflows-in-forks/td-p/46756

PR Close #36000
2020-03-11 14:45:47 -04:00
5dccb65b67 build(dev-infra): handle async failures in get-data.ts (#36007)
Wrap the await block in a try/catch so not to have unhandled promise rejections.

PR Close #36007
2020-03-11 14:45:17 -04:00
c773816a65 docs: Added ngVikings 2020 on angular.io events (#35129)
PR Close #35129
2020-03-11 14:43:47 -04:00
3112b1b00a ci: prevent api golden tests on windows CI (#36025)
PR Close #36025
2020-03-11 13:53:18 -04:00
8bf26c67c9 docs(dev-infra): update triage and contributing docs for dev-infra (#35995)
PR Close #35995
2020-03-10 21:02:18 -04:00
479ee684b3 refactor(core): Take advantage of 'assert functions' for ngDevMode asserts (#35964)
As of TypeScript 3.7, TypeScript supports [Assert Functions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions). This change adds assert types to our `assert*` functions.

We can't fully take advantage of this due to [Assert functions do not constraint type when they are guarded by a truthy expression.](https://github.com/microsoft/TypeScript/issues/37295)

PR Close #35964
2020-03-10 21:01:26 -04:00
04ef34ca10 ci: move public-api goldens to goldens directory (#35768)
Moves the public api .d.ts files from tools/public_api_guard to
goldens/public-api.

Additionally, provides a README in the goldens directory and a script
assist in testing the current state of the repo against the goldens as
well as a command for accepting all changes to the goldens in a single
command.

PR Close #35768
2020-03-10 20:58:40 -04:00
3fa632b705 fix(core): don't re-invoke pure pipes that throw and arguments are the same (#35827)
Pure pipes are not invoked again until their arguments are modified. The same
rule should apply to pure pipes that throw an exception. This fix ensures that
a pure pipe is not re-invoked if it throws an exception and arguments are not
changed.

PR Close #35827
2020-03-10 20:58:08 -04:00
5b39a36597 docs: fix CHANGELOG.md date for v9.0.6 2020-03-10 17:49:25 -07:00
ecac8c032b release: cut the v9.0.6 release 2020-03-10 17:32:16 -07:00
ce728dd323 build: adding a script to compare commits in master and stable branches (#35130)
Adding a script that compares commits in master and patch branches and finds a delta between them. This is useful for release reviews, to make sure all the necessary commits are included into the patch branch and there is no discrepancy.

PR Close #35130
2020-03-10 17:40:56 -04:00
20dd0ac4f2 build: Add pullapprove verification tool to dev-infra-private package (#35911)
Migrates pullapprove verification tool to be available in the dev-infra-private
package

PR Close #35911
2020-03-10 14:17:56 -04:00
0f4d424da9 build: creates a script to get contributor stats from across the angular org (#35834)
This script gets all of the current users for the organization and retrieves
information about PR/Issue contributions/authorship since a provided date.
Returning this information as a CSV.

PR Close #35834
2020-03-10 14:17:25 -04:00
6f2fd6e4b4 fix(compiler): process imports first and declarations second while calculating scopes (#35850)
Prior to this commit, while calculating the scope for a module, Ivy compiler processed `declarations` field first and `imports` after that. That results in a couple issues:

* for Pipes with the same `name` and present in `declarations` and in an imported module, Pipe from imported module was selected. In View Engine the logic is opposite: Pipes from `declarations` field receive higher priority.
* for Directives with the same selector and present in `declarations` and in an imported module, we first invoked the logic of a Directive from `declarations` field and after that - imported Directive logic. In View Engine, it was the opposite and the logic of a Directive from the `declarations` field was invoked last.

In order to align Ivy and View Engine behavior, this commit updates the logic in which we populate module scope: we first process all imports and after that handle `declarations` field. As a result, in Ivy both use-cases listed above work similar to View Engine.

Resolves #35502.

PR Close #35850
2020-03-10 14:16:59 -04:00
8a68a7c490 build: fix elements test failures on IE (#35940)
Fixes the following issues which caused the `elements` unit tests to break on IE:
1. `core.js` wasn't included which caused an error about `Promise` and `Symbol` to be thrown.
2. We were using a version of `@webcomponents/custom-elements` which was shipping ES6 code to npm. As a result, IE was throwing a syntax error.

PR Close #35940
2020-03-10 14:16:34 -04:00
800e31b6d3 build: set dev-infra package to be private (#35910)
Setting the dev-infra package to private will prevent us
from accidentally publishing the package to npm.

PR Close #35910
2020-03-10 14:15:58 -04:00
0d784e0b00 test(compiler): add a public API guard for the public compiler options (#35885)
This commit adds a public API test which guards against unintentional
changes to the accepted keys in `angularCompilerOptions`.

PR Close #35885
2020-03-10 14:15:29 -04:00
8b0e26f786 refactor(compiler): split core/api.ts into multiple files (#35885)
This commit splits the ngtsc `core` package's api entrypoint, which
previously was a single `api.ts` file, into an api/ directory with multiple
files. This is done to isolate the parts of the API definitions pertaining
to the public-facing `angularCompilerOptions` field in tsconfig.json into a
single file, which will enable a public API guard test to be added in a
future commit.

PR Close #35885
2020-03-10 14:15:29 -04:00
6ff6159e32 ci: update components-repo-unit-tests job commit (#35961)
Updates the commit that the `components-repo-unit-tests` job runs
against to the latest available commit at time of writing.

The motivation for updating is that a lot of changes have been made, and
that a upcoming framework PR that fixes check no changes for OnPush
components exposed a test failure in `angular/components`.

See: eae5cf886d

PR Close #35961
2020-03-10 13:29:03 -04:00
db9704a433 fix(platform-browser): add missing peerDependency on @angular/animations (#35949)
`@angular/platform-browser/animations` has a dependency on `@angular/animations` however, this is not listed in `peerDependencies`

With this change we add this package as an optional peerDependency as it's only required when using the `@angular/platform-browser/animations` entrypoint.

Fixes #35888

PR Close #35949
2020-03-10 13:28:33 -04:00
add3e18e9d test(router): use pageYOffset in testing when scrollY is not available (#35976)
IE 9, 10, and 11 use the non-standard name `pageYOffset` instead of
`scrollY`.

PR Close #35976
2020-03-10 13:28:04 -04:00
b71cdf99fc refactor(compiler): optionalOperator -> consumeOptionalOperator (#35980)
PR Close #35980
2020-03-10 13:27:37 -04:00
f882ff01f3 fix(language-service): resolve the variable from the template context first (#35982)
PR Close #35982
2020-03-10 13:27:04 -04:00
2184ad5436 feat(dev-infra): add dev-infra to the commit message scopes (#35992)
Adds dev-infra to the commit message scopes.  Also, sets the scope to be ignored
in changelogs.

PR Close #35992
2020-03-10 13:26:14 -04:00
83d7819bfc fix(localize): merge translation from all XLIFF <file> elements (#35936)
XLIFF translation files can contain multiple `<file>` elements,
each of which contains translations. In ViewEngine all these
translations are merged into a single translation bundle.

Previously in Ivy only the translations from the last `<file>`
element were being loaded. Now all the translations from each
`<file>` are merged into a single translation bundle.

Fixes #35839

PR Close #35936
2020-03-09 13:06:05 -04:00
4cc519eb10 refactor(benchpress): remove benchmarks_external from ..pullapprove.yml (#35670)
PR Close #35670
2020-03-09 12:19:25 -04:00
8bcb0784bc refactor(benchpress): delete unused code (#35670)
PR Close #35670
2020-03-09 12:19:25 -04:00
9f68ff9e5b fix(localize): improve matching and parsing of XTB translation files (#35793)
This commit improves the `canParse()` method to check that the file is
valid XML and has the expected root node. Previously it was relying upon
a regular expression to do this.

PR Close #35793
2020-03-09 12:12:00 -04:00
689964b20f fix(localize): improve matching and parsing of XLIFF 2.0 translation files (#35793)
Previously, the `Xliff2TranslationParser` only matched files that had a narrow
choice of extensions (e.g. `xlf`) and also relied upon a regular expression
match of an optional XML namespace directive.

This commit relaxes the requirement on both of these and, instead, relies
upon parsing the file into XML and identifying an element of the form
`<xliff version="2.0">` which is the minimal requirement for such files.

PR Close #35793
2020-03-09 12:11:59 -04:00
677d666a20 fix(localize): improve matching and parsing of XLIFF 1.2 translation files (#35793)
Previously, the `Xliff1TranslationParser` only matched files that had a narrow
choice of extensions (e.g. `xlf`) and also relied upon a regular expression
match of an optional XML namespace directive.

This commit relaxes the requirement on both of these and, instead, relies
upon parsing the file into XML and identifying an element of the form
`<xliff version="1.2">` which is the minimal requirement for such files.

PR Close #35793
2020-03-09 12:11:59 -04:00
4d7b176329 refactor(localize): allow hints from canParse() to parse() (#35793)
This enables complex work to be done in `TranslationParser.canParse()`
without duplicating the work in `TranslationParser.parse()`.

PR Close #35793
2020-03-09 12:11:59 -04:00
6b0e247412 refactor(localize): add support for TranslationParser diagnostics (#35793)
This modifies the internal (but shared with CLI) API for loading/parsing
translation files. Now the parsers will return a new `Diagnostics` object
along with any translations and locale extracted from the file.

It is up to the caller to decide what to do about this, if there are errors
it is suggested that an error is thrown, which is what the `TranslationLoader`
class does.

PR Close #35793
2020-03-09 12:11:59 -04:00
9e23a69d1b refactor: export silentLogger not SilentLoggerFn (#34079)
Export SilentLogger object instead of the SilentLoggerFn and capitalise silentLoggerFn instead of the SilentLoggerFn
PR Close #34079
2020-03-06 17:37:12 -05:00
63bde80ca7 fix(zone.js): tickOptions's processNewMacroTasksSynchronously should default to true when flag omitted (#35814)
Calling `tick(0, null)` defaults `processNewMacroTasksSynchronously` flag to `true`, however calling  `tick(0, null, {})` defaults `processNewMacroTasksSynchronously` to `undefined`. This is undesirable behavior since unless the flag is set explicitly it should still default to `true`.

PR Close #35814
2020-03-06 17:33:57 -05:00
5ea9a61a87 fix(bazel): do not use manifest paths for generated imports within compilation unit (#35841)
Currently, the `ng_module` rule incorrectly uses manifest paths for
generated imports from the Angular compiler.

This breaks packaging as prodmode output (i.e. `esnext`) is copied in
various targets (`es5` and `es2015`) to the npm package output.

e.g. imports are generated like:

_node_modules/my-pkg/es2015/imports/public-api.js_
```ts
import * as i1 from "angular/packages/bazel/test/ng_package/example/imports/second";
```

while it should be actually:

```ts
import * as i1 from "./second";
```

The imports can, and should be relative so that the files are
self-contained and do not rely on custom module resolution.

PR Close #35841
2020-03-06 17:31:11 -05:00
5a09ea328f test: add entry-point with generated imports to ng_package test (#35841)
PR Close #35841
2020-03-06 17:31:11 -05:00
000c834554 fix(core): remove side effects from ɵɵgetInheritedFactory() (#35769) (#35846)
`ɵɵgetInheritedFactory()` is called from generated code for a component which extends another class. This function is detected by Closure to have a side effect and is not able to tree shake the component as a result. Marking it with `noSideEffects()` tells Closure it can remove this function under the relevant tree shaking conditions.

PR Close #35769

(cherry picked from commit c195d22f68)

PR Close #35846
2020-03-06 17:30:47 -05:00
d24ce21c45 fix(core): remove side effects from ɵɵNgOnChangesFeature() (#35769) (#35846)
`ɵɵNgOnChangesFeature()` would set `ngInherit`, which is a side effect and also not necessary. This was pulled out to module scope so the function itself can be pure. Since it only curries another function, the call is entirely unnecessary. Updated the compiler to only generate a reference to this function, rather than a call to it, and removed the extra curry indirection.

PR Close #35769

(cherry picked from commit 9cf85d2177)

PR Close #35846
2020-03-06 17:30:47 -05:00
68ca32fe51 fix(core): add noSideEffects() to ɵɵdefineComponent() (#35769) (#35846)
This marks the function are "pure" and eligible to be tree shaken by Closure. Without this, initializing `ngDevMode` is considered a side effect which prevents this function from being tree shaken and also any component which calls it.

PR Close #35769

(cherry picked from commit ba3612774f)

PR Close #35846
2020-03-06 17:30:47 -05:00
4fe3f37b3c fix(core): add noSideEffects() to make*Decorator() functions (#35769) (#35846)
This causes all the `make*Decorator()` functions to be considered pure and to be eligible for associated tree shaking by Closure.

PR Close #35769

(cherry picked from commit dc6a7918e3)

PR Close #35846
2020-03-06 17:30:47 -05:00
e0cf3ad4b3 refactor(core): update noSideEffects() to return the result of the inner function (#35769) (#35846)
This is useful for propagating return values without them being converted to a string. It still provides the same guarantees to Closure, which will assume that the function invoked is pure and can be tree-shaken accordingly.

PR Close #35769

(cherry picked from commit 4052dd8188)

PR Close #35846
2020-03-06 17:30:47 -05:00
5abf068b23 build(docs-infra): use local version of Zone.js when testing against local packages (#35858)
In some cases, we want to test the AIO app or docs examples against the
locally built Angular packages (for example to ensure that the changes
in a commit do not introduce a breaking change). In order to achieve
this, we have the `ng-packages-installer` script that handles updating
a project's `package.json` file to use the locally built Angular
packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, `ng-packages-installer` would only consider the locally
built Angular packages (from `dist/packages-dist/`). However, given that
Zone.js is now part of the `angular/angular` repo, it makes sense to
also use the locally built Zone.js package (from `dist/zone.js-dist/`).
Otherwise, the tests might fail for commits that update both the Angular
packages (and related docs examples) and the Zone.js package. An example
of such a simultaneous change (that would have broken tests) is #33838.

This commit updates the script to install the locally built Zone.js
package (in addition to the Angular ones). The commit ensures that the
Zone.js package will always be available alongside the Angular packages
(i.e. that the Zone.js package will be built by the same script that
builds the Angular packages and that the `dist/zone.js-dist/` directory
will be cached on CI).

Note: This problem was discovered while enabling docs examples unit
tests in #34374.

PR Close #35858
2020-03-06 17:30:20 -05:00
28d2bf7d7c docs(zone.js): update comment and chapter format of ngzone doc. (#35738)
PR Close #35738
2020-03-06 16:51:44 -05:00
51c1911c56 docs: markup mini fix (#35883)
PR Close #35883
2020-03-06 16:50:10 -05:00
eaf5b5856d fix(core): undecorated-classes-with-di migration should handle libraries generated with CLI versions past v6.2.0 (#35824)
The options for `flatModuleId` and `flatModuleOutFile` had been removed in the CLI
from generated libraries with 718ee15b9a.

This has been done because `ng-packagr` (which is used to build the
libraries) automatically set these options in-memory when it compiles the library.
No migration has been created for this because there was no actual need to get rid of
this. Keeping the options in the library `tsconfig` does not cause any problems unless
the `tsconfig` is used outside of `ng-packagr`. This was not anticipated, but is now
commonly done in `ng update` migrations.

The `ng update` migrations try to create an instance of the `AngularCompilerProgram` by
simply parsing the `tsconfig`. The migrations make the valid assumption that `tsconfig` files
are not incomplete/invalid. They _definitely_ are in the file system though. It just works for
libraries because `ng-packagr` in-memory completes the invalid `tsconfig` files, so that they
can be passed to the `@angular/compiler-cli`.

We can't have this logic in the `ng update` migrations because it's
out-of-scope for individual migrations to distinguish between libraries
and applications. Also it would be out-of-scope to parse the
`ng-packagr` configuration and handle the tsconfig in-memory completion.

As a workaround though, we can remove the flat-module bundle options
in-memory when creating the compiler program. This is acceptable since
we don't emit the program and the flat module bundles are not needed.

Fixes #34985.

PR Close #35824
2020-03-06 12:40:18 -05:00
9a9cc01be1 refactor(compiler): rename _ParseAST.optionalCharacter TemplateBinding.expression (#35886)
This commit renames
1. _ParseAST.optionalCharacter -> consumeOptionalCharacter
2. TemplateBinding.expression -> value

PR Close #35886
2020-03-06 12:39:49 -05:00
6330200004 docs: move ngIndia 2020 to past events on events page (#35901)
ng india was an outdated event removed it from upcoming events on the events page and added to already presented events

PR Close #35901
2020-03-06 12:39:25 -05:00
645fa40571 docs: add missing closing bracket (#35890)
Closes #35887
PR Close #35890
2020-03-06 12:38:30 -05:00
2cccf59415 build: create dev-infra-private npm package (#35862)
Creates the scaffolding for an @angular/dev-infra-private package
which will not be published to npm but will be pushed to
https://github.com/angular/dev-infra-private-builds repo for each
commit to master.

The contents of this npm package will then be depended on via
package.json dependency for angular/angular angular/angular-cli and
angular/components.

PR Close #35862
2020-03-05 18:55:40 -05:00
2a9b254ca5 refactor(compiler): Break up parseTemplateBindings() for microsyntax (#35812)
This commit is purely a refactoring of the logic in
`parseTemplateBindings` method for parsing the microsyntax expression.
This is done to enable the introduction of `keySpan` and `valueSpan` in
subsequent PR.

For a detailed explanation of this work and the subsequent work items,
please see https://docs.google.com/document/d/1mEVF2pSSMSnOloqOPQTYNiAJO0XQxA1H0BZyESASOrE/edit?usp=sharing

PR Close #35812
2020-03-05 16:04:42 -05:00
78f968b7dd fix(docs-infra): in 404 page some text is not visible (#35866)
In pr #34978 colors were not properly set, if we type wrong url in the browser and we are directed to the 404 page there some text is set to white color which as not visible set it to dark gray for visibility

PR Close #35866
2020-03-05 16:00:53 -05:00
2eaf420bdf perf(ngcc): reduce directory traversing (#35756)
This reduces the time that `findEntryPoints` takes from 9701.143ms to 4177.278ms, by reducing the file operations done.

Reference: #35717

PR Close #35756
2020-03-05 15:57:31 -05:00
07efe2a6aa build: fix integration tests flakes using local yarn cache for bazel-schematics & ng_elements_schematics demos (#35877)
ng_update_migrations will still access the global yarn cache on its `ng update` call and there is no way to avoid this that I can see but if no other integration tests access the global yarn cache then that one test can have free reign over it.

PR Close #35877
2020-03-05 15:30:20 -05:00
773d7b86aa fix(router): state data missing in routerLink (#33203)
Fixes 33173

PR Close #33203
2020-03-04 16:51:14 -05:00
405 changed files with 20427 additions and 6131 deletions

View File

@ -29,7 +29,7 @@ var_4_win: &cache_key_win_fallback v5-angular-win-node-12-
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
var_5: &components_repo_unit_tests_cache_key v5-angular-components-2ec7254f88c4865e0de251f74c27e64c9d00d40a
var_5: &components_repo_unit_tests_cache_key v5-angular-components-598db096e668aa7e9debd56eedfd127b7a55e371
var_6: &components_repo_unit_tests_cache_key_fallback v5-angular-components-
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
@ -275,6 +275,7 @@ jobs:
(echo -e "\n.bzl files have lint errors. Please run ''yarn bazel:lint-fix''"; exit 1)'
- run: yarn lint
- run: yarn ts-circular-deps:check
- run: node tools/pullapprove/verify.js
test:
@ -346,7 +347,7 @@ jobs:
# See /tools/saucelabs/README.md for more info
command: |
yarn bazel run //tools/saucelabs:sauce_service_setup
TESTS=$(./node_modules/.bin/bazel query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
yarn bazel test --config=saucelabs ${TESTS}
yarn bazel run //tools/saucelabs:sauce_service_stop
no_output_timeout: 40m
@ -370,7 +371,7 @@ jobs:
# See /tools/saucelabs/README.md for more info
command: |
yarn bazel run //tools/saucelabs:sauce_service_setup
TESTS=$(./node_modules/.bin/bazel query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
yarn bazel run //tools/saucelabs:sauce_service_stop
no_output_timeout: 40m
@ -462,15 +463,6 @@ jobs:
- install_chrome_libs
# Install aio
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
- when:
condition: << parameters.ivy >>
steps:
# Rename the Ivy packages dist folder to "dist/packages-dist" as the AIO
# package installer picks up the locally built packages from that location.
# *Note*: We could also adjust the packages installer, but given we won't have
# two different folders of Angular distributions in the future, we should keep
# the packages installer unchanged.
- run: mv dist/packages-dist-ivy-aot dist/packages-dist
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
@ -552,22 +544,7 @@ jobs:
root: *workspace_location
paths:
- ng/dist/packages-dist-ivy-aot
# We run a subset of the integration tests outside of Bazel that track
# payload size.
# See comments inside the integration/run_tests.sh script.
# TODO(gregmagolan): move payload size tracking to Bazel and remove this job.
integration_test:
executor: default-executor
parallelism: 3
steps:
- custom_attach_workspace
- init_environment
- install_chrome_libs
- install_java
# Runs the integration tests in parallel across multiple CircleCI container instances. The
# amount of container nodes for this job is controlled by the "parallelism" option.
- run: ./integration/run_tests.sh ${CIRCLE_NODE_INDEX} ${CIRCLE_NODE_TOTAL}
- ng/dist/zone.js-dist-ivy-aot
# This job creates compressed tarballs (`.tgz` files) for all Angular packages and stores them as
# build artifacts. This makes it easy to try out changes from a PR build for testing purposes.
@ -842,7 +819,7 @@ workflows:
name: test_docs_examples_ivy
ivy: true
requires:
- build-ivy-npm-packages
- build-npm-packages
- aio_preview:
# Only run on PR builds. (There can be no previews for non-PR builds.)
<<: *only_on_pull_requests
@ -851,9 +828,6 @@ workflows:
- test_aio_preview:
requires:
- aio_preview
- integration_test:
requires:
- build-npm-packages
- publish_packages_as_artifacts:
requires:
- build-npm-packages
@ -866,7 +840,6 @@ workflows:
# Only publish if tests and integration tests pass
- test
- test_ivy_aot
- integration_test
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
- test_aio_local
- test_aio_local_viewengine

View File

@ -68,7 +68,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
setPublicVar COMPONENTS_REPO_BRANCH "master"
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
setPublicVar COMPONENTS_REPO_COMMIT "2ec7254f88c4865e0de251f74c27e64c9d00d40a"
setPublicVar COMPONENTS_REPO_COMMIT "598db096e668aa7e9debd56eedfd127b7a55e371"
####################################################################################################
@ -82,6 +82,22 @@ openssl aes-256-cbc -d -in "${projectDir}/.circleci/gcp_token" \
####################################################################################################
cp "${projectDir}/.circleci/bazel.linux.rc" "$HOME/.bazelrc";
####################################################################################################
# Create shell script in /tmp for Bazel actions to access CI envs without
# busting the cache. Used by payload-size.sh script in integration tests.
####################################################################################################
readonly bazelVarEnv="/tmp/bazel-ci-env.sh"
echo "# Setup by /.circle/env.sh" > $bazelVarEnv
echo "export PROJECT_ROOT=\"${PROJECT_ROOT}\";" >> $bazelVarEnv
echo "export CI_BRANCH=\"${CI_BRANCH}\";" >> $bazelVarEnv
echo "export CI_BUILD_URL=\"${CI_BUILD_URL}\";" >> $bazelVarEnv
echo "export CI_COMMIT=\"${CI_COMMIT}\";" >> $bazelVarEnv
echo "export CI_COMMIT_RANGE=\"${CI_COMMIT_RANGE}\";" >> $bazelVarEnv
echo "export CI_PULL_REQUEST=\"${CI_PULL_REQUEST}\";" >> $bazelVarEnv
echo "export CI_REPO_NAME=\"${CI_REPO_NAME}\";" >> $bazelVarEnv
echo "export CI_REPO_OWNER=\"${CI_REPO_OWNER}\";" >> $bazelVarEnv
echo "export CI_SECRET_PAYLOAD_FIREBASE_TOKEN=\"${CI_SECRET_PAYLOAD_FIREBASE_TOKEN}\";" >> $bazelVarEnv
####################################################################################################
####################################################################################################
## Source `$BASH_ENV` to make the variables available immediately. ##

View File

@ -7,6 +7,7 @@ on:
jobs:
lock_closed:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@66462f6

View File

@ -258,7 +258,6 @@ groups:
'aio/content/examples/ngmodules/**',
'aio/content/guide/ngmodule-api.md',
'aio/content/guide/ngmodule-faq.md',
'aio/content/examples/ngmodule-faq/**',
'aio/content/guide/ngmodule-vs-jsmodule.md',
'aio/content/guide/module-types.md',
'aio/content/guide/template-syntax.md',
@ -546,7 +545,6 @@ groups:
conditions:
- >
contains_any_globs(files, [
'modules/benchmarks_external/**',
'modules/benchmarks/**'
])
reviewers:
@ -902,8 +900,7 @@ groups:
'aio/content/guide/docs-style-guide.md',
'aio/content/examples/docs-style-guide/**',
'aio/content/images/guide/docs-style-guide/**',
'aio/content/guide/visual-studio-2015.md',
'aio/content/examples/visual-studio-2015/**'
'aio/content/guide/visual-studio-2015.md'
])
reviewers:
users:
@ -928,6 +925,7 @@ groups:
'.github/**',
'.vscode/**',
'.yarn/**',
'dev-infra/**',
'docs/BAZEL.md',
'docs/CARETAKER.md',
'docs/COMMITTER.md',
@ -939,6 +937,7 @@ groups:
'docs/SAVED_REPLIES.md',
'docs/TOOLS.md',
'docs/TRIAGE_AND_LABELS.md',
'goldens/*',
'modules/e2e_util/e2e_util.ts',
'modules/e2e_util/perf_util.ts',
'modules/*',
@ -952,13 +951,12 @@ groups:
'tools/browsers/**',
'tools/build/**',
'tools/circular_dependency_test/**',
'tools/contributing-stats/**',
'tools/gulp-tasks/**',
'tools/ng_rollup_bundle/**',
'tools/ngcontainer/**',
'tools/npm/**',
'tools/npm_integration_test/**',
'tools/public_api_guard/BUILD.bazel',
'tools/public_api_guard/public_api_guard.bzl',
'tools/pullapprove/**',
'tools/rxjs/**',
'tools/saucelabs/**',
@ -993,7 +991,7 @@ groups:
conditions:
- >
contains_any_globs(files, [
'tools/public_api_guard/**',
'goldens/public-api/**',
'docs/NAMING.md',
'aio/content/guide/glossary.md',
'aio/content/guide/styleguide.md',
@ -1025,6 +1023,24 @@ groups:
- ~framework-global-approvers
# ================================================
# Circular dependencies
# ================================================
circular-dependencies:
conditions:
- >
contains_any_globs(files, [
'goldens/packages-circular-deps.json'
])
reviewers:
users:
- IgorMinar
- josephperrott
- kara
teams:
- ~framework-global-approvers
####################################################################################
# Special Cases
####################################################################################

View File

@ -5,6 +5,10 @@ exports_files([
"protractor-perf.conf.js",
"karma-js.conf.js",
"browser-providers.conf.js",
"scripts/ci/track-payload-size.sh",
"scripts/ci/payload-size.sh",
"scripts/ci/payload-size.js",
"package.json",
])
alias(

View File

@ -1,3 +1,56 @@
<a name="9.0.7"></a>
## [9.0.7](https://github.com/angular/angular/compare/9.0.6...9.0.7) (2020-03-18)
### Bug Fixes
* **compiler:** do not recurse to find static symbols of same module ([#35262](https://github.com/angular/angular/issues/35262)) ([a52b568](https://github.com/angular/angular/commit/a52b568))
* **compiler:** support directive inputs with interpolations on `<ng-template>`s ([#35984](https://github.com/angular/angular/issues/35984)) ([a6bf31b](https://github.com/angular/angular/commit/a6bf31b)), closes [#35752](https://github.com/angular/angular/issues/35752)
* **core:** don't re-invoke pure pipes that throw and arguments are the same ([#35827](https://github.com/angular/angular/issues/35827)) ([3fa632b](https://github.com/angular/angular/commit/3fa632b))
* **core:** verify parsed ICU expression at runtime before executing it ([#35923](https://github.com/angular/angular/issues/35923)) ([9cd115d](https://github.com/angular/angular/commit/9cd115d)), closes [#35689](https://github.com/angular/angular/issues/35689)
* **language-service:** infer $implicit value for ngIf template contexts ([#35941](https://github.com/angular/angular/issues/35941)) ([f5e4410](https://github.com/angular/angular/commit/f5e4410))
* **ngcc:** a new LockFile implementation that uses a child-process ([#35934](https://github.com/angular/angular/issues/35934)) ([743ce7b](https://github.com/angular/angular/commit/743ce7b)), closes [#35761](https://github.com/angular/angular/issues/35761)
* **ngcc:** consistently delegate to TypeScript host for typing files ([#36089](https://github.com/angular/angular/issues/36089)) ([76d7188](https://github.com/angular/angular/commit/76d7188)), closes [#35078](https://github.com/angular/angular/issues/35078)
* **ngcc:** handle multiple original sources when flattening source-maps ([#36027](https://github.com/angular/angular/issues/36027)) ([e6167cf](https://github.com/angular/angular/commit/e6167cf))
### Performance Improvements
* **ngcc:** link segment markers for faster traversal ([#36027](https://github.com/angular/angular/issues/36027)) ([a0fa63b](https://github.com/angular/angular/commit/a0fa63b))
* **ngcc:** store the position of SegmentMarkers to avoid unnecessary computation ([#36027](https://github.com/angular/angular/issues/36027)) ([4ce9098](https://github.com/angular/angular/commit/4ce9098))
* **ngcc:** use binary search when flattening mappings ([#36027](https://github.com/angular/angular/issues/36027)) ([8768fc4](https://github.com/angular/angular/commit/8768fc4))
* **ngcc:** use line start positions for computing offsets in source-map flattening ([#36027](https://github.com/angular/angular/issues/36027)) ([daa2a08](https://github.com/angular/angular/commit/daa2a08))
<a name="9.0.6"></a>
## [9.0.6](https://github.com/angular/angular/compare/9.0.5...9.0.6) (2020-03-10)
### Bug Fixes
* **bazel:** do not use manifest paths for generated imports within compilation unit ([#35841](https://github.com/angular/angular/issues/35841)) ([5ea9a61](https://github.com/angular/angular/commit/5ea9a61))
* **compiler:** process `imports` first and `declarations` second while calculating scopes ([#35850](https://github.com/angular/angular/issues/35850)) ([6f2fd6e](https://github.com/angular/angular/commit/6f2fd6e)), closes [#35502](https://github.com/angular/angular/issues/35502)
* **core:** add `noSideEffects()` to `make*Decorator()` functions ([#35769](https://github.com/angular/angular/issues/35769)) ([#35846](https://github.com/angular/angular/issues/35846)) ([4fe3f37](https://github.com/angular/angular/commit/4fe3f37))
* **core:** add `noSideEffects()` to `ɵɵdefineComponent()` ([#35769](https://github.com/angular/angular/issues/35769)) ([#35846](https://github.com/angular/angular/issues/35846)) ([68ca32f](https://github.com/angular/angular/commit/68ca32f))
* **core:** remove side effects from `ɵɵgetInheritedFactory()` ([#35769](https://github.com/angular/angular/issues/35769)) ([#35846](https://github.com/angular/angular/issues/35846)) ([000c834](https://github.com/angular/angular/commit/000c834))
* **core:** remove side effects from `ɵɵNgOnChangesFeature()` ([#35769](https://github.com/angular/angular/issues/35769)) ([#35846](https://github.com/angular/angular/issues/35846)) ([d24ce21](https://github.com/angular/angular/commit/d24ce21))
* **core:** undecorated-classes-with-di migration should handle libraries generated with CLI versions past v6.2.0 ([#35824](https://github.com/angular/angular/issues/35824)) ([eaf5b58](https://github.com/angular/angular/commit/eaf5b58)), closes [#34985](https://github.com/angular/angular/issues/34985)
* **language-service:** resolve the variable from the template context first ([#35982](https://github.com/angular/angular/issues/35982)) ([f882ff0](https://github.com/angular/angular/commit/f882ff0))
* **localize:** improve matching and parsing of XLIFF 1.2 translation files ([#35793](https://github.com/angular/angular/issues/35793)) ([677d666](https://github.com/angular/angular/commit/677d666))
* **localize:** improve matching and parsing of XLIFF 2.0 translation files ([#35793](https://github.com/angular/angular/issues/35793)) ([689964b](https://github.com/angular/angular/commit/689964b))
* **localize:** improve matching and parsing of XTB translation files ([#35793](https://github.com/angular/angular/issues/35793)) ([9f68ff9](https://github.com/angular/angular/commit/9f68ff9))
* **localize:** merge translation from all XLIFF `<file>` elements ([#35936](https://github.com/angular/angular/issues/35936)) ([83d7819](https://github.com/angular/angular/commit/83d7819)), closes [#35839](https://github.com/angular/angular/issues/35839)
* **platform-browser:** add missing peerDependency on `[@angular](https://github.com/angular)/animations` ([#35949](https://github.com/angular/angular/issues/35949)) ([db9704a](https://github.com/angular/angular/commit/db9704a)), closes [#35888](https://github.com/angular/angular/issues/35888)
* **router:** state data missing in routerLink ([#33203](https://github.com/angular/angular/issues/33203)) ([773d7b8](https://github.com/angular/angular/commit/773d7b8))
### Performance Improvements
* **ngcc:** reduce directory traversing ([#35756](https://github.com/angular/angular/issues/35756)) ([2eaf420](https://github.com/angular/angular/commit/2eaf420)), closes [#35717](https://github.com/angular/angular/issues/35717)
<a name="9.0.5"></a>
## [9.0.5](https://github.com/angular/angular/compare/9.0.4...9.0.5) (2020-03-04)

View File

@ -206,6 +206,8 @@ The scope should be the name of the npm package affected (as perceived by the pe
The following is the list of supported scopes:
* **animations**
* **bazel**
* **benchpress**
* **common**
* **compiler**
* **compiler-cli**
@ -214,6 +216,7 @@ The following is the list of supported scopes:
* **forms**
* **http**
* **language-service**
* **localize**
* **platform-browser**
* **platform-browser-dynamic**
* **platform-server**
@ -232,6 +235,7 @@ There are currently a few exceptions to the "use package name" rule:
* **changelog**: used for updating the release notes in CHANGELOG.md
* **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the
repo
* **dev-infra**: used for dev-infra related changes within the directories /scripts, /tools and /dev-infra
* **ngcc**: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)
* **ve**: used for changes specific to ViewEngine (legacy compiler/renderer).
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all

View File

@ -1,5 +1,4 @@
[![CircleCI](https://circleci.com/gh/angular/angular/tree/master.svg?style=shield)](https://circleci.com/gh/angular/workflows/angular/tree/master)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)](https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06)
[![Join the chat at https://gitter.im/angular/angular](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![npm version](https://badge.fury.io/js/%40angular%2Fcore.svg)](https://www.npmjs.com/@angular/core)
@ -21,7 +20,6 @@ Angular is a development platform for building mobile and desktop web applicatio
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
[browserstack]: https://www.browserstack.com/automate/public-build/LzF3RzBVVGt6VWE2S0hHaC9uYllOZz09LS1BVjNTclBKV0x4eVRlcjA4QVY1M0N3PT0=--eb4ce8c8dc2c1c5b2b5352d473ee12a73ac20e06
[contributing]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md
[quickstart]: https://angular.io/start
[changelog]: https://github.com/angular/angular/blob/master/CHANGELOG.md

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Accessibility Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>AttributeBinding</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -13,17 +13,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>NgmoduleDemo</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>BuiltInDirectives</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,7 +10,7 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
});

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Built-in Template Functions Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -158,11 +158,11 @@ export class Provider6bComponent {
// #docregion silent-logger
// An object in the shape of the logger service
export function SilentLoggerFn() {}
function silentLoggerFn() {}
const silentLogger = {
export const SilentLogger = {
logs: ['Silent logger says "Shhhhh!". Provided via "useValue"'],
log: SilentLoggerFn
log: silentLoggerFn
};
// #enddocregion silent-logger
@ -171,7 +171,7 @@ const silentLogger = {
template: template,
providers:
// #docregion providers-7
[{ provide: Logger, useValue: silentLogger }]
[{ provide: Logger, useValue: SilentLogger }]
// #enddocregion providers-7
})
export class Provider7Component {

View File

@ -0,0 +1,3 @@
{
"projectType": "elements"
}

View File

@ -39,7 +39,7 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
`]
})
export class PopupComponent {
private state: 'opened' | 'closed' = 'closed';
state: 'opened' | 'closed' = 'closed';
@Input()
set message(message: string) {

View File

@ -10,12 +10,12 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'Featured product:'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('Featured product:');
}));
it('should render title in a p tag', async(() => {

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>EventBinding</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -1,4 +0,0 @@
{
"build": "build:cli",
"run": "serve:cli"
}

View File

@ -13,17 +13,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Feature Modules</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -16,12 +16,12 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Forms Overview</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -2,4 +2,4 @@
<h1>My Store</h1>
</a>
<a [routerLink]="['/cart']" class="button fancy-button"><i class="material-icons">shopping_cart</i>Checkout</a>
<a class="button fancy-button"><i class="material-icons">shopping_cart</i>Checkout</a>

View File

@ -2,6 +2,8 @@
<h1>My Store</h1>
</a>
<a [routerLink]="['/cart']" class="button fancy-button">
<!-- #docregion cart-route -->
<a routerLink="/cart" class="button fancy-button">
<i class="material-icons">shopping_cart</i>Checkout
</a>
<!-- #enddocregion cart-route -->

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>HttpClient Demo</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Inputs and Outputs</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,7 +10,7 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
});

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Interpolation</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -1,4 +0,0 @@
{
"build": "build:cli",
"run": "serve:cli"
}

View File

@ -17,17 +17,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'customer-app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('customer-app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Lazy loading feature modules</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -1,41 +0,0 @@
// #docplaster
// #docregion
/* Angular Imports */
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
/* App Imports */
// #enddocregion
import { AppComponent } from './app.component.3';
/*
// #docregion
import { AppComponent } from './app.component';
// #enddocregion
*/
// #docregion
import { HighlightDirective } from './highlight.directive.1';
import { TitleComponent } from './title.component.1';
import { UserService } from './user.service';
/* Routing Module */
// #enddocregion
import { AppRoutingModule } from './app-routing.module.3';
/*
// #docregion
import { AppRoutingModule } from './app-routing.module';
// #enddocregion
*/
// #docregion
@NgModule({
// #docregion imports
imports: [
BrowserModule,
AppRoutingModule
],
// #enddocregion imports
providers: [ UserService ],
declarations: [ AppComponent, HighlightDirective, TitleComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@ -1,15 +0,0 @@
// #docplaster
// #docregion
import { Directive, ElementRef } from '@angular/core';
// Highlight the host element in gold
@Directive({ selector: '[highlight]' })
export class HighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'gold';
// #enddocregion
console.log(`* AppRoot highlight called for ${el.nativeElement.tagName}`);
// #docregion
}
}
// #enddocregion

View File

@ -1,10 +0,0 @@
<!-- #docregion -->
<!-- #docregion v1 -->
<h1 highlight>{{title}}</h1>
<!-- #enddocregion v1 -->
<!-- #docregion ngIf -->
<p *ngIf="user">
<i>Welcome, {{user}}</i>
<p>
<!-- #enddocregion ngIf -->

View File

@ -1,23 +0,0 @@
// #docplaster
// #docregion
// #docregion v1
import { Component } from '@angular/core';
// #enddocregion v1
import { UserService } from './user.service';
// #docregion v1
@Component({
selector: 'app-title',
templateUrl: './title.component.1.html'
})
export class TitleComponent {
title = 'Angular Modules';
// #enddocregion v1
user = '';
constructor(userService: UserService) {
this.user = userService.userName;
}
// #docregion v1
}
// #enddocregion v1

View File

@ -1,4 +0,0 @@
{
"build": "build:cli",
"run": "serve:cli"
}

View File

@ -13,17 +13,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>NgmodulesExample</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>PropertyBinding</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>providers vs. viewProviders</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -1,4 +0,0 @@
{
"build": "build:cli",
"run": "serve:cli"
}

View File

@ -13,17 +13,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Providers</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>DI Resolution Modifiers Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>SchematicsForLibraries</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('Service Workers');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -1,14 +1,15 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<title>
Setting The Document Title Using The Title Service
</title>
</head>
</head>
<body>
<h1>

View File

@ -1,3 +0,0 @@
{
"unittesting": true
}

View File

@ -72,8 +72,8 @@
<h2>Non-null assertion operator (<code>!</code>)</h2>
<div>
<!-- #docregion non-null -->
<!--No color, no error -->
<p *ngIf="item">The item's color is: {{item!.color}}</p>
<!-- Assert color is defined, even if according to the `Item` type it could be undefined. -->
<p>The item's color is: {{item.color!.toUpperCase()}}</p>
<!-- #enddocregion non-null -->

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -1,6 +1,13 @@
import { Component } from '@angular/core';
interface Item {
name: string;
manufactureDate: Date;
color?: string | null;
price: number;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
@ -9,10 +16,11 @@ import { Component } from '@angular/core';
export class AppComponent {
title = 'Template Expression Operators';
item = {
item: Item = {
name : 'Telephone',
manufactureDate : new Date(1980, 1, 25),
price: 98
color: 'orange',
price: 98,
};
nullItem = null;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Template Expression Operators Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Template Reference Variables Example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -21,15 +21,15 @@ describe('AppComponent (initial CLI version)', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;

View File

@ -26,7 +26,7 @@ describe('CanvasComponent', () => {
it('should be able to generate blob data from canvas', fakeAsync(() => {
const fixture = TestBed.createComponent(CanvasComponent);
const canvasComp = fixture.debugElement.componentInstance;
const canvasComp = fixture.componentInstance;
fixture.detectChanges();
expect(canvasComp.blobSize).toBe(0);

View File

@ -1,58 +0,0 @@
<!-- Run application specs in a browser -->
<!-- #docregion -->
<!DOCTYPE html>
<html>
<head>
<base href="/">
<title>Sample App Specs</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
</head>
<body>
<!-- Polyfills -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/zone.js/dist/zone-testing.js"></script>
<script>
var __spec_files__ = [
'app/about/about.component.spec',
'app/app-initial.component.spec',
'app/app.component.router.spec',
'app/app.component.spec',
'app/banner/banner-initial.component.spec',
'app/banner/banner.component.spec',
'app/banner/banner.component.detect-changes.spec',
'app/banner/banner-external.component.spec',
'app/dashboard/dashboard-hero.component.spec',
'app/dashboard/dashboard.component.no-testbed.spec',
'app/dashboard/dashboard.component.spec',
'app/hero/hero-detail.component.no-testbed.spec',
'app/hero/hero-detail.component.spec',
'app/hero/hero-list.component.spec',
'app/model/hero.service.spec',
'app/shared/highlight.directive.spec',
'app/shared/title-case.pipe.spec',
'app/twain/twain.component.spec',
// 'app/twain/twain.component.marbles.spec',
'app/welcome/welcome.component.spec',
'app/demo/async-helper.spec',
'app/demo/demo.spec',
'app/demo/demo.testbed.spec',
];
</script>
<script src="browser-test-shim.js"></script>
</body>
</html>

View File

@ -13,17 +13,17 @@ describe('AppComponent', () => {
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -6,7 +6,6 @@
<!-- #docregion base-href -->
<base href="/">
<!-- #enddocregion base-href -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -10,15 +10,15 @@ describe('AppComponent', () => {
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
const app = fixture.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
it('should render title', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Two-way Binding</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>AngularJS Hybrid</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>

View File

@ -16,6 +16,15 @@ module.exports = function(config) {
'**/*.spec.js'
],
// This is needed, because the AngularJS files are loaded from `https://code.angularjs.org/`.
// Without this, latest browsers prevent loading the scripts from localhost with:
// ```
// Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin
// 'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
// header is present on the requested resource.
// ```
crossOriginAttribute: false,
autoWatch: true,
frameworks: ['jasmine'],

View File

@ -44,12 +44,21 @@ module.exports = function(config) {
// #enddocregion files
],
// This is needed, because the AngularJS files are loaded from `https://code.angularjs.org/`.
// Without this, latest browsers prevent loading the scripts from localhost with:
// ```
// Access to script at 'https://code.angularjs.org/1.5.5/angular.js' from origin
// 'http://localhost:9876' has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
// header is present on the requested resource.
// ```
crossOriginAttribute: false,
// #docregion html
// proxied base paths for loading assets
proxies: {
// required for component assets fetched by Angular's compiler
"/phone-detail": '/base/app/phone-detail',
"/phone-list": '/base/app/phone-list'
'/phone-detail': '/base/app/phone-detail',
'/phone-list': '/base/app/phone-list'
},
// #enddocregion html

View File

@ -1,5 +1,4 @@
// #docregion
import rollup from 'rollup'
import nodeResolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify'

View File

@ -1,20 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"node_modules/@types"
]
},
"compileOnSave": true,
"angularCompilerOptions": {
"enableIvy": false
}
}

View File

@ -1,6 +1,6 @@
# Introduction to Angular concepts
Angular is a platform and framework for building single-page client applications in HTML and TypeScript.
Angular is a platform and framework for building single-page client applications using HTML and TypeScript.
Angular is written in TypeScript.
It implements core and optional functionality as a set of TypeScript libraries that you import into your apps.

View File

@ -185,7 +185,7 @@ searchHeroes(term: string): Observable {
let heroesURL = `${this.heroesURL}?${term}`;
return this.http.jsonp(heroesUrl, 'callback').pipe(
catchError(this.handleError('searchHeroes', []) // then handle the error
catchError(this.handleError('searchHeroes', [])) // then handle the error
);
};
```

View File

@ -75,6 +75,10 @@ Please note that these constants are not meant to be used by 3rd party library o
* ICU parsing happens at runtime, so only text, HTML tags and text bindings are allowed inside ICU cases (previously, directives were also permitted inside ICUs).
* Adding text bindings into i18n translations that are not present in the source template itself will throw a runtime error (previously, including extra bindings in translations was permitted).
* Extra HTML tags in i18n translations that are not present in the source template itself will be rendered as plain text (previously, these tags would render as HTML).
* Providers formatted as `{provide: X}` without a `useValue`, `useFactory`, `useExisting`, or `useClass` property are treated like `{provide: X, useClass: X}` (previously, it defaulted to `{provide: X, useValue: undefined}`).
* `DebugElement.attributes` returns `undefined` for attributes that were added and then subsequently removed (previously, attributes added and later removed would have a value of `null`).

View File

@ -2256,22 +2256,20 @@ It works perfectly with long property paths such as `a?.b?.c?.d`.
### The non-null assertion operator ( `!` )
As of Typescript 2.0, you can enforce [strict null checking](http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html "Strict null checking in TypeScript") with the `--strictNullChecks` flag. TypeScript then ensures that no variable is unintentionally null or undefined.
As of Typescript 2.0, you can enforce [strict null checking](http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html "Strict null checking in TypeScript") with the `--strictNullChecks` flag. TypeScript then ensures that no variable is unintentionally `null` or `undefined`.
In this mode, typed variables disallow `null` and `undefined` by default. The type checker throws an error if you leave a variable unassigned or try to assign `null` or `undefined` to a variable whose type disallows `null` and `undefined`.
The type checker also throws an error if it can't determine whether a variable will be `null` or undefined at runtime. You tell the type checker not to throw an error by applying the postfix
The type checker also throws an error if it can't determine whether a variable will be `null` or `undefined` at runtime. You tell the type checker not to throw an error by applying the postfix
[non-null assertion operator, !](http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator "Non-null assertion operator").
The Angular non-null assertion operator, `!`, serves the same purpose in
an Angular template. For example, after you use [*ngIf](guide/template-syntax#ngIf)
to check that `item` is defined, you can assert that
`item` properties are also defined.
an Angular template. For example, you can assert that `item` properties are also defined.
<code-example path="template-expression-operators/src/app/app.component.html" region="non-null" header="src/app/app.component.html"></code-example>
When the Angular compiler turns your template into TypeScript code,
it prevents TypeScript from reporting that `item` might be `null` or `undefined`.
it prevents TypeScript from reporting that `item.color` might be `null` or `undefined`.
Unlike the [_safe navigation operator_](guide/template-syntax#safe-navigation-operator "Safe navigation operator (?)"),
the non-null assertion operator does not guard against `null` or `undefined`.

View File

@ -960,6 +960,12 @@ angular.module('myHybridApp', [...])
Once you introduce the Angular Router, using the Angular Router triggers navigations through the unified location service, still providing a single source for navigating with AngularJS and Angular.
<!--
TODO:
Correctly document how to use AOT with SystemJS-based `ngUpgrade` apps (or better yet update the
`ngUpgrade` examples/guides to use `@angular/cli`).
See https://github.com/angular/angular/issues/35989.
## Using Ahead-of-time compilation with hybrid apps
You can take advantage of Ahead-of-time (AOT) compilation on hybrid apps just like on any other
@ -979,6 +985,7 @@ bootstrap the hybrid app:
</code-example>
And that's all you need do to get the full benefit of AOT for Angular apps!
-->
## PhoneCat Upgrade Tutorial
@ -1364,7 +1371,7 @@ You also need to make a couple of adjustments
to the `systemjs.config.js` file installed during [upgrade setup](guide/upgrade-setup).
Point the browser to the project root when loading things through SystemJS,
instead of using the `<base>` URL.
instead of using the `<base>` URL.
Install the `upgrade` package via `npm install @angular/upgrade --save`
and add a mapping for the `@angular/upgrade/static` package.

View File

@ -218,7 +218,7 @@ zone.run(() => {
This new context, `zoneThis`, can be retrieved from the `setTimeout()` callback function, and this context is the same when the `setTimeout()` is scheduled.
To get the context, you can call [`Zone.current`](https://github.com/angular/angular/blob/master/packages/zone.js/lib/zone.ts).
### Zones and async lifecycle hooks
## Zones and async lifecycle hooks
Zone.js can create contexts that persist across asynchronous operations as well as provide lifecycle hooks for asynchronous operations.
@ -303,7 +303,7 @@ This service creates a zone named `angular` to automatically trigger change dete
### NgZone `run()`/`runOutsideOfAngular()`
`Zone` handles most asynchronous APIs such as `setTimeout()`, `Promise.then(),and `addEventListener()`.
`Zone` handles most asynchronous APIs such as `setTimeout()`, `Promise.then()`, and `addEventListener()`.
For the full list, see the [Zone Module document](https://github.com/angular/angular/blob/master/packages/zone.js/MODULE.md).
Therefore in those asynchronous APIs, you don't need to trigger change detection manually.
@ -315,12 +315,12 @@ This function, and all asynchronous operations in that function, trigger change
export class AppComponent implements OnInit {
constructor(private ngZone: NgZone) {}
ngOnInit() {
// new async API is not handled by Zone, so you need to
// use ngZone.run to make the asynchronous operation in angular zone
// and trigger change detection automatically
// New async API is not handled by Zone, so you need to
// use ngZone.run() to make the asynchronous operation in the angular zone
// and trigger change detection automatically.
this.ngZone.run(() => {
someNewAsyncAPI(() => {
// update data of component
// update the data of the component
});
});
}
@ -335,19 +335,20 @@ In that situation, you can use another NgZone method: [runOutsideAngular()](api/
export class AppComponent implements OnInit {
constructor(private ngZone: NgZone) {}
ngOnInit() {
// you know no data will be updated
// you don't want to do change detection in this
// specified operation, you can call runOutsideAngular
// You know no data will be updated,
// so you don't want to trigger change detection in this
// specified operation. Instead, call ngZone.runOutsideAngular()
this.ngZone.runOutsideAngular(() => {
setTimeout(() => {
// do something will not update component data
// update component data
// but don't trigger change detection.
});
});
}
}
```
### Seting up Zone.js
### Setting up Zone.js
To make Zone.js available in Angular, you need to import the zone.js package.
If you are using the Angular CLI, this step is done automatically, and you will see the following line in the `src/polyfills.ts`:

View File

@ -13,18 +13,17 @@
</tr>
</thead>
<tbody>
<!-- ngIndia 2020 -->
<tr>
<th><a href="https://www.ng-ind.com/" title="ngIndia">ngIndia</a></th>
<td>Delhi, India</td>
<td>Feb 29, 2020</td>
</tr>
<!-- ng-conf 2020 -->
<tr>
<th><a href="https://ng-conf.org/" title="ng-conf">ng-conf</a></th>
<td>Salt Lake City, Utah</td>
<td>April 1-3, 2020</td>
</tr>
<tr>
<th><a href="https://ngvikings.org/" title="ngVikings">ngVikings</a></th>
<td>Oslo, Norway</td>
<td>May 25-26 conference, 27 workshops, 2020</td>
</tr>
</tbody>
</table>
@ -38,6 +37,12 @@
</tr>
</thead>
<tbody>
<!-- ngIndia 2020 -->
<tr>
<th><a href="https://www.ng-ind.com/" title="ngIndia">ngIndia</a></th>
<td>Delhi, India</td>
<td>Feb 29, 2020</td>
</tr>
<!-- ReactiveConf 2019 -->
<tr>
<th><a href="https://reactiveconf.com/" title="ReactiveConf">ReactiveConf</a></th>

View File

@ -141,19 +141,22 @@ Create the cart page in two steps:
<code-example header="src/app/app.module.ts" path="getting-started/src/app/app.module.ts" region="cart-route">
</code-example>
1. Update the "Checkout" button so that it routes to the `/cart` url.
Open `top-bar.component.html` and add a `routerLink` directive pointing to `/cart`.
<code-example
header="src/app/top-bar/top-bar.component.html"
path="getting-started/src/app/top-bar/top-bar.component.html"
region="cart-route">
</code-example>
1. To see the new cart component, click the "Checkout" button. You can see the "cart works!" default text, and the URL has the pattern `https://getting-started.stackblitz.io/cart`, where `getting-started.stackblitz.io` may be different for your StackBlitz project.
<div class="alert is-helpful">
The starter code for the "Checkout" button already includes a `routerLink` for `/cart` the top-bar component.
</div>
<div class="lightbox">
<img src='generated/images/guide/start/cart-works.png' alt="Display cart page before customizing">
</div>
### Display the cart items
You can use services to share data across components:

View File

@ -6,8 +6,8 @@
<mat-toolbar color="primary" class="app-toolbar no-print" [class.transitioning]="isTransitioning">
<mat-toolbar-row class="notification-container">
<aio-notification notificationId="survey-february-2019" expirationDate="2019-03-01" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
<a href="http://bit.ly/angular-survey-2019">
<aio-notification notificationId="survey-march-2020" expirationDate="2020-04-01" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
<a href="https://goo.gle/angular-survey-2020">
<mat-icon class="icon" svgIcon="insert_comment" aria-label="Announcement"></mat-icon>
<span class="message">Help Angular by taking a <b>1 minute survey</b>!</span>
<span class="action-button">Go to survey</span>

View File

@ -1,176 +1,9 @@
.api-body {
max-width: 1200px;
table {
margin: 12px 0 24px;
th {
text-transform: none;
@include font-size(16);
font-weight: bold;
}
tr {
border-bottom: 1px solid $lightgray;
}
td {
vertical-align: middle;
}
// This is overriding a style here:
// https://github.com/angular/angular/blob/95993e1/aio/src/styles/2-modules/_table.scss#L58-L62
tbody > tr > td tr td:first-child {
@media screen and (max-width: 480px) {
background-color: inherit;
}
}
hr {
margin: 16px 0;
}
tr:last-child {
border-bottom: none;
}
&.item-table {
td {
padding: 32px;
}
}
&.list-table {
td {
padding: 16px 24px;
}
}
.short-description {
margin-left: 0;
}
&.parameters-table {
margin-top: 0;
@include font-size(14);
box-shadow: none;
tr {
@media screen and (max-width: 480px) {
display: flex;
flex-direction: column;
}
td:first-child {
font-weight: 600;
padding-left: 16px;
width: 20%;
}
}
td {
padding: 8px 8px 8px 0;
border: 0;
vertical-align: top;
}
}
&.property-table {
td {
vertical-align: top;
}
}
}
.class-overview {
position: relative;
code-example {
clear: left;
}
}
.short-description {
margin-top: 8px;
}
h1 {
margin-top: -4px;
}
}
.github-links {
float: right;
.material-icons {
border-radius: 4px;
padding: 4px;
@include font-size(20);
&:hover {
background-color: $mist;
}
}
}
.api-body {
.class-overview {
position: relative;
code-example {
clear: left;
}
}
.method-table,
.option-table,
.list-table {
td > code {
background-color: inherit;
white-space: pre-wrap;
}
.with-github-links {
align-items: center;
display: flex;
justify-content: space-between;
.github-links {
a {
color: $mediumgray;
.material-icons:hover {
background: none;
color: $blue;
}
}
}
}
h3 {
margin: 6px 0;
font-weight: 500;
clear: left;
}
h4 {
@include font-size(14);
font-weight: bold;
margin-top: 12px;
}
}
.api-heading {
@include font-size(14);
margin: 16px;
}
.parameters-table {
margin-top: 0;
@include font-size(14);
td:nth-child(1) {
width: 20%;
}
}
details.overloads {
box-shadow: none;
@ -229,6 +62,145 @@
margin: 0;
}
table {
margin: 12px 0 24px;
&.item-table {
td {
padding: 32px;
}
}
&.list-table {
td {
padding: 16px 24px;
}
}
&.parameters-table {
margin-top: 0;
@include font-size(14);
box-shadow: none;
tr {
@media screen and (max-width: 480px) {
display: flex;
flex-direction: column;
}
td:first-child {
font-weight: 600;
padding-left: 16px;
width: 20%;
}
}
td {
padding: 8px 8px 8px 0;
border: 0;
vertical-align: top;
}
}
&.property-table {
td {
vertical-align: top;
}
}
&.method-table,
&.option-table,
&.list-table {
td > code {
background-color: inherit;
white-space: pre-wrap;
}
.with-github-links {
align-items: center;
display: flex;
justify-content: space-between;
.github-links {
a {
color: $mediumgray;
.material-icons:hover {
background: none;
color: $blue;
}
}
}
}
h3 {
margin: 6px 0;
font-weight: 500;
clear: left;
}
h4 {
@include font-size(14);
font-weight: bold;
margin-top: 12px;
}
}
th {
text-transform: none;
@include font-size(16);
font-weight: bold;
}
tr {
border-bottom: 1px solid $lightgray;
&:last-child {
border-bottom: none;
}
}
td {
vertical-align: middle;
}
// This is overriding a style here:
// https://github.com/angular/angular/blob/95993e1/aio/src/styles/2-modules/_table.scss#L58-L62
tbody > tr > td tr td:first-child {
@media screen and (max-width: 480px) {
background-color: inherit;
}
}
hr {
margin: 16px 0;
}
.short-description {
margin-left: 0;
}
}
.class-overview {
position: relative;
code-example {
clear: left;
}
}
.member-name .pln {
font-weight: 700;
}
.short-description {
margin-top: 8px;
}
.api-heading {
@include font-size(14);
margin: 16px;
}
.from-constructor,
.read-only-property,
@ -269,6 +241,20 @@
}
}
.github-links {
float: right;
.material-icons {
border-radius: 4px;
padding: 4px;
@include font-size(20);
&:hover {
background-color: $mist;
}
}
}
.breadcrumb-container {
display: flex;
flex-direction: row;
@ -290,18 +276,6 @@
}
}
.github-links {
float: right;
.material-icons {
border-radius: 4px;
padding: 4px;
font-size: 20px;
&:hover {
background-color: $mist;
}
}
}
.deprecated-api-item {
text-decoration: line-through;
}

View File

@ -32,6 +32,7 @@ aio-notification {
.content {
max-width: calc(100% - #{$notificationHeight});
background: $darkgray;
text-transform: none;
padding: 0;

View File

@ -106,7 +106,7 @@ aio-search-results {
}
}
.not-found {
.no-results {
color: $darkgray;
}

View File

@ -13,32 +13,47 @@
{ "name": "serve:upgrade" },
{ "name": "build:aot" },
{ "name": "serve:aot" },
{ "name": "build:babel" },
{ "name": "copy-dist-files" },
{ "name": "i18n" }
{ "name": "copy-dist-files" }
],
"dependencies": [
"systemjs"
"@angular/animations",
"@angular/common",
"@angular/compiler",
"@angular/core",
"@angular/forms",
"@angular/platform-browser",
"@angular/platform-browser-dynamic",
"@angular/router",
"@angular/upgrade",
"rxjs",
"systemjs",
"tslib",
"zone.js"
],
"devDependencies": [
"@angular/compiler-cli",
"@types/angular",
"@types/angular-animate",
"@types/angular-cookies",
"@types/angular-mocks",
"@types/angular-resource",
"@types/angular-route",
"@types/angular-sanitize",
"babel-cli",
"babel-preset-angular2",
"babel-preset-es2015",
"canonical-path",
"http-server",
"@types/jasmine",
"@types/jasminewd2",
"@types/node",
"concurrently",
"http-server",
"jasmine-core",
"karma",
"karma-chrome-launcher",
"karma-jasmine",
"karma-jasmine-html-reporter",
"lite-server",
"protractor",
"rollup",
"rollup-plugin-commonjs",
"rollup-plugin-node-resolve",
"rollup-plugin-uglify",
"source-map-explorer"
"tslint",
"typescript"
]
}

View File

@ -30,6 +30,8 @@ const BOILERPLATE_PATHS = {
// This maps the CLI files that exists in a parent folder
const cliRelativePath = BOILERPLATE_PATHS.cli.map(file => `../cli/${file}`);
BOILERPLATE_PATHS.elements = [...cliRelativePath, 'package.json'];
BOILERPLATE_PATHS.i18n = [...cliRelativePath, 'angular.json', 'package.json'];
BOILERPLATE_PATHS['service-worker'] = [...cliRelativePath, 'angular.json', 'package.json'];

View File

@ -183,7 +183,9 @@ function runE2eTestsSystemJS(appDir, outputFile) {
let run = runProtractorSystemJS(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
if (fs.existsSync(appDir + '/aot/index.html')) {
// Only run AOT tests in ViewEngine mode. The current AOT setup does not work in Ivy.
// See https://github.com/angular/angular/issues/35989.
if (!argv.ivy && fs.existsSync(appDir + '/aot/index.html')) {
run = run.then((ok) => ok && runProtractorAoT(appDir, outputFile));
}
return run;

View File

@ -12,45 +12,43 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^8.0.0",
"@angular/common": "^8.0.0",
"@angular/compiler": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/forms": "^8.0.0",
"@angular/platform-browser": "^8.0.0",
"@angular/platform-browser-dynamic": "^8.0.0",
"@angular/router": "^8.0.0",
"angular": "1.7.8",
"angular-in-memory-web-api": "^0.8.0",
"angular-route": "1.7.8",
"core-js": "^2.5.4",
"rxjs": "^6.5.1",
"@angular/animations": "~9.0.6",
"@angular/common": "~9.0.6",
"@angular/compiler": "~9.0.6",
"@angular/core": "~9.0.6",
"@angular/forms": "~9.0.6",
"@angular/platform-browser": "~9.0.6",
"@angular/platform-browser-dynamic": "~9.0.6",
"@angular/router": "~9.0.6",
"angular": "1.7.9",
"angular-in-memory-web-api": "~0.9.0",
"angular-route": "1.7.9",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"web-animations-js": "^2.3.1",
"zone.js": "~0.10.2"
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.800.0",
"@angular/cli": "^8.0.0",
"@angular/compiler-cli": "^8.0.0",
"@angular/language-service": "^8.0.0",
"@types/angular": "^1.6.47",
"@types/angular-route": "^1.3.5",
"@types/jasmine": "~3.3.8",
"@angular-devkit/build-angular": "~0.900.6",
"@angular/cli": "~9.0.6",
"@angular/compiler-cli": "~9.0.6",
"@angular/language-service": "~9.0.6",
"@types/angular": "^1.6.57",
"@types/angular-route": "^1.7.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~5.0.0",
"jasmine-core": "~2.99.1",
"jasmine-marbles": "^0.5.0",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-marbles": "~0.6.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.4"
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
}

View File

@ -11,8 +11,8 @@
/node_modules
# profiling files
chrome-profiler-events.json
speed-measure-plugin.json
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea

View File

@ -49,6 +49,11 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}

View File

@ -13,7 +13,7 @@ exports.config = {
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',

Some files were not shown because too many files have changed in this diff Show More