Compare commits
499 Commits
10.0.0-nex
...
9.1.10
Author | SHA1 | Date | |
---|---|---|---|
99c41d6db0 | |||
1aae94a421 | |||
f0f319b1d6 | |||
454e073918 | |||
76d64331bd | |||
6855396449 | |||
0b96908225 | |||
65f52f3761 | |||
9ce55d08f8 | |||
765c1c5b17 | |||
ccfa3426f7 | |||
83379fa0bb | |||
2ffd44ad96 | |||
4a84842bbb | |||
daa715a1ca | |||
31bce80771 | |||
711e4d4cc2 | |||
fdc5941fe7 | |||
ae10a541bf | |||
b797913d10 | |||
1465372a0e | |||
a33cb2d39b | |||
1202d17b4c | |||
d837828317 | |||
dc210bc75b | |||
75ead94ed5 | |||
6ac0042aef | |||
3eee53603c | |||
5c94fa97c1 | |||
468f4a3f9e | |||
a2393bef02 | |||
5bd1c7bbf7 | |||
19313f7dad | |||
4e2500278c | |||
2c4cfa6f2c | |||
c8f0c3b637 | |||
cf4883240b | |||
6f3157fe6d | |||
12d8af50dd | |||
94fc8463cc | |||
87b9f08d3b | |||
1c8f1799d4 | |||
d98d0dbf17 | |||
7e56222afb | |||
2ed66acdd9 | |||
fa073bafbd | |||
363f14c893 | |||
a9edbc3a4e | |||
e62fa67440 | |||
57236f1e11 | |||
14ffecdf09 | |||
9ae3e1199d | |||
947f542185 | |||
353195c9c5 | |||
72505dfd6f | |||
a63f634592 | |||
18d08a3857 | |||
c4234577db | |||
4830d664da | |||
e26879ad1d | |||
c5c3113f00 | |||
178a78f9ed | |||
7de7871dd9 | |||
784cf46a93 | |||
ba9e63a278 | |||
83231f2174 | |||
62e3196849 | |||
127a06c031 | |||
d4e00ee5a1 | |||
6db8e7eb8f | |||
ee1ef8512f | |||
efef04487c | |||
74d8b2308b | |||
7543e5925e | |||
5ca8ba3be9 | |||
3f70e3df3b | |||
0b68189051 | |||
b811212013 | |||
4d0b831d09 | |||
2cf6b809ae | |||
639fab2c14 | |||
0912be47ff | |||
9548c7cb94 | |||
de5449380f | |||
5ffa4f12e5 | |||
9022091dc6 | |||
74878984b2 | |||
6a6fbc3890 | |||
cb888afd0c | |||
48cf61cf45 | |||
d808333047 | |||
f872b69d3b | |||
9cca82ed70 | |||
e3d33958d2 | |||
4de546eef5 | |||
719ca5283b | |||
3813f54bec | |||
92590693e6 | |||
ef9da2f619 | |||
23f380d6b9 | |||
92b97f7d60 | |||
d12ef0c0a7 | |||
4827dbe308 | |||
04cd4187ce | |||
bb5e455ab2 | |||
96787f2e40 | |||
4f1b7a4a6a | |||
d113bfa14f | |||
a8aa2caeb6 | |||
f20c725406 | |||
caafd7e0a3 | |||
f59f5a2ab3 | |||
b91b3d7462 | |||
a235daee71 | |||
77218d6974 | |||
928dc8f263 | |||
468aeb454a | |||
b9dd2b45af | |||
2ab32c870f | |||
53897d4a84 | |||
efe1713371 | |||
24b9e12383 | |||
ad3fbe1ea0 | |||
f0ce3c2ce5 | |||
ae989b8cb7 | |||
edcc8b8acf | |||
790af88288 | |||
6eef7dbdbe | |||
ba1dfd0cf3 | |||
b37071c22f | |||
b6cba54821 | |||
451e7e2364 | |||
99b63b677e | |||
00b9de56f5 | |||
4423ab5109 | |||
0fc0d9bb3d | |||
00cc02fb0c | |||
0783d482a7 | |||
6cce05e2c5 | |||
bf446cb2d5 | |||
04fd90e32a | |||
be06a44861 | |||
d4a14697ec | |||
35e0d8311b | |||
964d8679b3 | |||
6cbde69e8f | |||
6da2a28dc0 | |||
fbdd282e7c | |||
d1b3af697c | |||
dcf1dcb757 | |||
c6e5225ec3 | |||
3361f59a4f | |||
7e9d5f5e82 | |||
654868f584 | |||
b6c042d0a3 | |||
4becc1bc95 | |||
5bddeea559 | |||
65337fb8b8 | |||
4abd60361a | |||
9d13ee0052 | |||
be1a83337e | |||
0be3792b5c | |||
4edd5fc694 | |||
c88ba02d83 | |||
8719ccdcfb | |||
36083c7c3c | |||
44c350236c | |||
8a85c31667 | |||
293557c80b | |||
e61f094a19 | |||
244f736e47 | |||
9307bc063f | |||
64453e42ff | |||
9e755f30f0 | |||
d0e024ec2d | |||
a576852ad9 | |||
4573a9997b | |||
4af10c6bb0 | |||
eabeb574cf | |||
a297fa9ecd | |||
ea51b62786 | |||
701016d6c4 | |||
e5317d5eaf | |||
389ff894ee | |||
d6417f02af | |||
a239decc91 | |||
a11542ab6f | |||
723fb492ce | |||
971c6f8d3b | |||
e8efd67e71 | |||
75370107c2 | |||
48ae3a0639 | |||
b6d0e215f9 | |||
5ea51b21fd | |||
ebb473368c | |||
7ff9050c25 | |||
ec0c6b3dcc | |||
e92d53f157 | |||
2dbed5e8f5 | |||
a0342763b8 | |||
0d747337a3 | |||
decacd5f74 | |||
c8c2272a9f | |||
e5f459d32b | |||
901b980b8e | |||
186373300a | |||
f30307a2de | |||
166a4553dc | |||
465215b11c | |||
a0eed742b4 | |||
4775f63847 | |||
304816e573 | |||
d70cf76962 | |||
3800455c6f | |||
c635123fc8 | |||
15e1bfc026 | |||
9b961a410a | |||
420c73c722 | |||
62930aac7b | |||
d7433316b0 | |||
c440165384 | |||
0ce96f1d78 | |||
d3deaf9a99 | |||
5c88a9fcfe | |||
0bd7517c73 | |||
d669429bd2 | |||
6a9b2c9a67 | |||
0f389fa5ae | |||
2a27f69522 | |||
180a32894e | |||
00724dcdbb | |||
cc71116ba6 | |||
ddfcf082ca | |||
c7e4f5eb4d | |||
b3fe9017f7 | |||
d3a77ea91a | |||
1b5a931d63 | |||
d840503d35 | |||
b49a734f0d | |||
695f83529d | |||
f898c9ab57 | |||
5337e138e3 | |||
e33047454f | |||
858fa45556 | |||
b97211ee2b | |||
25d4238371 | |||
7743c43529 | |||
54883cb477 | |||
91cef8cfc7 | |||
d40bcce84e | |||
7a18fb2448 | |||
ec39bdcc15 | |||
b7070b0ad6 | |||
aa94cd505c | |||
cc6ccf28a6 | |||
e1071615c6 | |||
8bd5374cfd | |||
b9b9cc2ba8 | |||
a6e10ef869 | |||
9724169bf4 | |||
c0ed57db76 | |||
0bd50e2e50 | |||
0ceb27041f | |||
ec2affe104 | |||
c590e8ca7a | |||
254b9ea44c | |||
2a53f47159 | |||
722d9397b0 | |||
03de31a78e | |||
b22c5a953d | |||
24222e0c1f | |||
95f45e8070 | |||
18be33a9d1 | |||
a22d4f6c98 | |||
5ae8473c6b | |||
fd7c39e3cf | |||
d85d91df66 | |||
15930d21c7 | |||
61a7f98b98 | |||
c3c7bf6509 | |||
b2e7ce47ec | |||
94e518e3c7 | |||
0fa5ac8d0d | |||
f2fca3e243 | |||
5bab49828d | |||
db4e93d0ca | |||
479a59be43 | |||
52aab63dd9 | |||
506beeddc1 | |||
0075078179 | |||
bb7edc52aa | |||
ed2b0e945e | |||
da159bde83 | |||
06a9809e32 | |||
1e4fb74ec8 | |||
797c306306 | |||
972fc06135 | |||
a9117061d0 | |||
fe1d9bacc3 | |||
08b8b51486 | |||
1d4af3f734 | |||
609d81c65e | |||
af30efddc5 | |||
15115f6179 | |||
eec9b6bbb5 | |||
45fd77ead1 | |||
f16587e9b7 | |||
4f9991534e | |||
51a0ed2222 | |||
a5ea100e7c | |||
0429c7f5e9 | |||
1756cced4a | |||
793a001d7c | |||
5c3774cfe6 | |||
12266b2042 | |||
e385abc83c | |||
933cbfb828 | |||
c5e725111d | |||
93993864b1 | |||
26f49151e7 | |||
4b3f9ac739 | |||
80604d3a76 | |||
e615a10371 | |||
c8f2ca2349 | |||
a67afcc932 | |||
fd7698253e | |||
32de025dce | |||
a4e1768a74 | |||
b336871303 | |||
92fa6399f7 | |||
3992341d34 | |||
8c559ef104 | |||
0bac2b062c | |||
58d028178f | |||
e06512b22f | |||
603b0944d5 | |||
918e628f9b | |||
468cf69c55 | |||
c8f3fa9f3e | |||
78136cc3a7 | |||
66724fd159 | |||
8e7f9033a3 | |||
c8f9092364 | |||
bc995835b9 | |||
1bfa908ab3 | |||
2479f7d7ef | |||
333b8679ad | |||
5da621d3dd | |||
cbed582a1a | |||
d5aa6b5bd6 | |||
33eee43263 | |||
72053b0f27 | |||
d20ef47b16 | |||
bdc05aef64 | |||
798d959bee | |||
3570aaa363 | |||
421b6a97d6 | |||
b28a5f6eef | |||
52ab9397a0 | |||
b99e539b0e | |||
fd2ef74a31 | |||
cbc25bbf31 | |||
7385b2cf25 | |||
0daa48800e | |||
ffa4e11db1 | |||
41a41e741d | |||
c5384aee58 | |||
b02c950aac | |||
2eaa304aba | |||
9faf2e4a96 | |||
0e7a89a391 | |||
af4269471d | |||
915a6c17b9 | |||
93b32d3023 | |||
bd82b34f79 | |||
c626e90ab0 | |||
c6bbb0d8e5 | |||
f48a065db0 | |||
aeb6d0d0f7 | |||
655c9e386b | |||
2ad20b953f | |||
7059eaf2d2 | |||
939fda410f | |||
35ab6acab3 | |||
f4ee067cb8 | |||
068e28381d | |||
dff52ecb11 | |||
56af303dc3 | |||
136596ddb4 | |||
e515c913d9 | |||
31eaf78035 | |||
b0d680daa0 | |||
93cbef26c7 | |||
e2b221b8fa | |||
7a33c456d3 | |||
61db817eed | |||
4894220acf | |||
74b7a8eaf5 | |||
bfa55162de | |||
776f991c1a | |||
d9d1a1e682 | |||
867ff14a4a | |||
879457ca05 | |||
efbe4ad28a | |||
64f72c0600 | |||
81c05bfa01 | |||
56abcf088d | |||
6818432cd0 | |||
79bfb037df | |||
0fce20d79d | |||
9f486c31d2 | |||
d36066dd6c | |||
a631b99c69 | |||
78211c42ea | |||
5ff5a11509 | |||
e80047e897 | |||
eee5eeae76 | |||
c3ce1903b6 | |||
21da0346c7 | |||
af2d74fde9 | |||
8de62a9811 | |||
26e28453d6 | |||
8ea30b662f | |||
cb0a2a055d | |||
14ae3c0a21 | |||
90cae34c05 | |||
7bb35889fa | |||
03a3c753bb | |||
74b1464dff | |||
ff523c9ec9 | |||
392ef93c2b | |||
29dcb5bf68 | |||
de594ca221 | |||
3545a49a79 | |||
f4681b6e40 | |||
fb16557381 | |||
61c9da5542 | |||
dbb1eb0ffe | |||
002b81c0b0 | |||
beb3f19dc0 | |||
e8f3c47b03 | |||
c58e6ba13a | |||
61e5ab4703 | |||
10385c27da | |||
0ab244f39e | |||
eafa5260db | |||
15cffa210c | |||
df8e45a193 | |||
bb8744db94 | |||
43bad87ae1 | |||
c3b297a318 | |||
6ea232eb3c | |||
0baab0f3db | |||
e53b686375 | |||
5c28af0e74 | |||
60adc35d30 | |||
024cc3b84a | |||
ac17142001 | |||
8d7066223f | |||
0cb3c04128 | |||
2649794e65 | |||
bf426c5f0d | |||
aa6b9f0382 | |||
822b420a11 | |||
294c6297d7 | |||
58fc65d198 | |||
b6bd8d7572 | |||
b08168bb90 | |||
407fa42679 | |||
aef432384a | |||
fb70083339 | |||
c9c2408176 | |||
e066bddfe9 | |||
447a600477 | |||
70f9bfff43 | |||
57c02b044c | |||
6defe962c8 | |||
267bcb3e9c | |||
b0b66881b4 | |||
9ff8d78bcd | |||
563b707497 | |||
5357e643b3 | |||
f71d132f7c | |||
ba3edda230 | |||
0767d37c07 | |||
8ba24578bc | |||
133a97ad67 | |||
4e67a3ab3f | |||
377f0010fc | |||
6e09129e4c | |||
d80e51a6b1 | |||
feb66b00da | |||
cb19eac105 | |||
6e0564ade6 | |||
05eeb7d279 | |||
2ce5fa3cce | |||
e140cdcb34 | |||
14b2db1d43 | |||
2afc7e982e |
@ -12,7 +12,7 @@ We use this as a symmetric AES encryption key to encrypt tokens like
|
|||||||
a GitHub token that enables publishing snapshots.
|
a GitHub token that enables publishing snapshots.
|
||||||
|
|
||||||
To create the github_token file, we take this approach:
|
To create the github_token file, we take this approach:
|
||||||
- Find the angular-builds:token in http://valentine
|
- Find the angular-builds:token in the internal pw database
|
||||||
- Go inside the CircleCI default docker image so you use the same version of openssl as we will at runtime: `docker run --rm -it circleci/node:10.12`
|
- Go inside the CircleCI default docker image so you use the same version of openssl as we will at runtime: `docker run --rm -it circleci/node:10.12`
|
||||||
- echo "https://[token]:@github.com" > credentials
|
- echo "https://[token]:@github.com" > credentials
|
||||||
- openssl aes-256-cbc -e -in credentials -out .circleci/github_token -k $KEY
|
- openssl aes-256-cbc -e -in credentials -out .circleci/github_token -k $KEY
|
||||||
|
@ -22,17 +22,17 @@ version: 2.1
|
|||||||
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
|
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
|
||||||
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
||||||
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
||||||
var_3: &cache_key v7-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3: &cache_key v6-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
|
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
|
||||||
# folder will contain all previously used versions and ultimately cause the cache restoring to
|
# folder will contain all previously used versions and ultimately cause the cache restoring to
|
||||||
# be slower due to its growing size.
|
# be slower due to its growing size.
|
||||||
var_4: &cache_key_fallback v7-angular-node-12-{{ checksum ".bazelversion" }}
|
var_4: &cache_key_fallback v6-angular-node-12-{{ checksum ".bazelversion" }}
|
||||||
var_3_win: &cache_key_win v7-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3_win: &cache_key_win v6-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
var_4_win: &cache_key_win_fallback v7-angular-win-node-12-{{ checksum ".bazelversion" }}
|
var_4_win: &cache_key_win_fallback v6-angular-win-node-12-{{ checksum ".bazelversion" }}
|
||||||
|
|
||||||
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
|
# 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.
|
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
|
||||||
var_5: &components_repo_unit_tests_cache_key v7-angular-components-448523bffffecd2b53a3d2854c3051b6b7a3934f
|
var_5: &components_repo_unit_tests_cache_key v7-angular-components-caad0b54ed41949f0ee529c152508749875bc9af
|
||||||
var_6: &components_repo_unit_tests_cache_key_fallback v7-angular-components-
|
var_6: &components_repo_unit_tests_cache_key_fallback v7-angular-components-
|
||||||
|
|
||||||
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
|
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
|
||||||
|
@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
|
|||||||
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
|
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
|
||||||
setPublicVar COMPONENTS_REPO_BRANCH "master"
|
setPublicVar COMPONENTS_REPO_BRANCH "master"
|
||||||
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
|
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
|
||||||
setPublicVar COMPONENTS_REPO_COMMIT "448523bffffecd2b53a3d2854c3051b6b7a3934f"
|
setPublicVar COMPONENTS_REPO_COMMIT "caad0b54ed41949f0ee529c152508749875bc9af"
|
||||||
|
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
"commitMessage": {
|
|
||||||
"maxLength": 120,
|
|
||||||
"minBodyLength": 100,
|
|
||||||
"types": [
|
|
||||||
"build",
|
|
||||||
"ci",
|
|
||||||
"docs",
|
|
||||||
"feat",
|
|
||||||
"fix",
|
|
||||||
"perf",
|
|
||||||
"refactor",
|
|
||||||
"release",
|
|
||||||
"style",
|
|
||||||
"test"
|
|
||||||
],
|
|
||||||
"scopes": [
|
|
||||||
"animations",
|
|
||||||
"bazel",
|
|
||||||
"benchpress",
|
|
||||||
"changelog",
|
|
||||||
"common",
|
|
||||||
"compiler",
|
|
||||||
"compiler-cli",
|
|
||||||
"core",
|
|
||||||
"dev-infra",
|
|
||||||
"docs-infra",
|
|
||||||
"elements",
|
|
||||||
"forms",
|
|
||||||
"http",
|
|
||||||
"language-service",
|
|
||||||
"localize",
|
|
||||||
"ngcc",
|
|
||||||
"packaging",
|
|
||||||
"platform-browser",
|
|
||||||
"platform-browser-dynamic",
|
|
||||||
"platform-server",
|
|
||||||
"platform-webworker",
|
|
||||||
"platform-webworker-dynamic",
|
|
||||||
"router",
|
|
||||||
"service-worker",
|
|
||||||
"upgrade",
|
|
||||||
"ve",
|
|
||||||
"zone.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"format": {
|
|
||||||
"clang-format": {
|
|
||||||
"matchers": [
|
|
||||||
"dev-infra/**/*.{js,ts}",
|
|
||||||
"packages/**/*.{js,ts}",
|
|
||||||
"!packages/zone.js",
|
|
||||||
"!packages/common/locales/**/*.{js,ts}",
|
|
||||||
"!packages/common/src/i18n/available_locales.ts",
|
|
||||||
"!packages/common/src/i18n/currencies.ts",
|
|
||||||
"!packages/common/src/i18n/locale_en.ts",
|
|
||||||
"modules/benchmarks/**/*.{js,ts}",
|
|
||||||
"modules/playground/**/*.{js,ts}",
|
|
||||||
"tools/**/*.{js,ts}",
|
|
||||||
"!tools/gulp-tasks/cldr/extract.js",
|
|
||||||
"!tools/public_api_guard/**/*.d.ts",
|
|
||||||
"!tools/ts-api-guardian/test/fixtures/**",
|
|
||||||
"./*.{js,ts}",
|
|
||||||
"!**/node_modules/**",
|
|
||||||
"!**/dist/**",
|
|
||||||
"!**/built/**",
|
|
||||||
"!shims_for_IE.js"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"buildifier": true
|
|
||||||
}
|
|
||||||
}
|
|
123
.ng-dev-config.ts
Normal file
123
.ng-dev-config.ts
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
import {MergeConfig} from './dev-infra/pr/merge/config';
|
||||||
|
|
||||||
|
// The configuration for `ng-dev commit-message` commands.
|
||||||
|
const commitMessage = {
|
||||||
|
'maxLength': 120,
|
||||||
|
'minBodyLength': 100,
|
||||||
|
'types': [
|
||||||
|
'build',
|
||||||
|
'ci',
|
||||||
|
'docs',
|
||||||
|
'feat',
|
||||||
|
'fix',
|
||||||
|
'perf',
|
||||||
|
'refactor',
|
||||||
|
'release',
|
||||||
|
'style',
|
||||||
|
'test',
|
||||||
|
],
|
||||||
|
'scopes': [
|
||||||
|
'animations',
|
||||||
|
'bazel',
|
||||||
|
'benchpress',
|
||||||
|
'changelog',
|
||||||
|
'common',
|
||||||
|
'compiler',
|
||||||
|
'compiler-cli',
|
||||||
|
'core',
|
||||||
|
'dev-infra',
|
||||||
|
'docs-infra',
|
||||||
|
'elements',
|
||||||
|
'forms',
|
||||||
|
'http',
|
||||||
|
'language-service',
|
||||||
|
'localize',
|
||||||
|
'ngcc',
|
||||||
|
'packaging',
|
||||||
|
'platform-browser',
|
||||||
|
'platform-browser-dynamic',
|
||||||
|
'platform-server',
|
||||||
|
'platform-webworker',
|
||||||
|
'platform-webworker-dynamic',
|
||||||
|
'router',
|
||||||
|
'service-worker',
|
||||||
|
'upgrade',
|
||||||
|
've',
|
||||||
|
'zone.js',
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// The configuration for `ng-dev format` commands.
|
||||||
|
const format = {
|
||||||
|
'clang-format': {
|
||||||
|
'matchers': [
|
||||||
|
'dev-infra/**/*.{js,ts}',
|
||||||
|
'packages/**/*.{js,ts}',
|
||||||
|
'!packages/zone.js',
|
||||||
|
'!packages/common/locales/**/*.{js,ts}',
|
||||||
|
'!packages/common/src/i18n/available_locales.ts',
|
||||||
|
'!packages/common/src/i18n/currencies.ts',
|
||||||
|
'!packages/common/src/i18n/locale_en.ts',
|
||||||
|
'modules/benchmarks/**/*.{js,ts}',
|
||||||
|
'modules/playground/**/*.{js,ts}',
|
||||||
|
'tools/**/*.{js,ts}',
|
||||||
|
'!tools/gulp-tasks/cldr/extract.js',
|
||||||
|
'!tools/public_api_guard/**/*.d.ts',
|
||||||
|
'!tools/ts-api-guardian/test/fixtures/**',
|
||||||
|
'*.{js,ts}',
|
||||||
|
'!**/node_modules/**',
|
||||||
|
'!**/dist/**',
|
||||||
|
'!**/built/**',
|
||||||
|
'!shims_for_IE.js',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'buildifier': true
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Github metadata information for `ng-dev` commands. */
|
||||||
|
const github = {
|
||||||
|
owner: 'angular',
|
||||||
|
name: 'angular',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Configuration for the `ng-dev pr merge` command. The command can be used
|
||||||
|
// for merging upstream pull requests into branches based on a PR target label.
|
||||||
|
const merge = () => {
|
||||||
|
// TODO: resume dynamically determining patch branch
|
||||||
|
const patch = '10.0.x';
|
||||||
|
const config: MergeConfig = {
|
||||||
|
githubApiMerge: false,
|
||||||
|
claSignedLabel: 'cla: yes',
|
||||||
|
mergeReadyLabel: /^PR action: merge(-assistance)?/,
|
||||||
|
commitMessageFixupLabel: 'commit message fixup',
|
||||||
|
labels: [
|
||||||
|
{
|
||||||
|
pattern: 'PR target: master-only',
|
||||||
|
branches: ['master'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: 'PR target: patch-only',
|
||||||
|
branches: [patch],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: 'PR target: master & patch',
|
||||||
|
branches: ['master', patch],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
requiredBaseCommits: {
|
||||||
|
// PRs that target either `master` or the patch branch, need to be rebased
|
||||||
|
// on top of the latest commit message validation fix.
|
||||||
|
'master': '4341743b4a6d7e23c6f944aa9e34166b701369a1',
|
||||||
|
[patch]: '2a53f471592f424538802907aca1f60f1177a86d'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Export function to build ng-dev configuration object.
|
||||||
|
module.exports = {
|
||||||
|
commitMessage,
|
||||||
|
format,
|
||||||
|
github,
|
||||||
|
merge,
|
||||||
|
};
|
@ -351,6 +351,7 @@ groups:
|
|||||||
users:
|
users:
|
||||||
- alxhub
|
- alxhub
|
||||||
- AndrewKushnir
|
- AndrewKushnir
|
||||||
|
- atscott
|
||||||
- kara
|
- kara
|
||||||
- mhevery
|
- mhevery
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
@ -366,6 +367,7 @@ groups:
|
|||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
'packages/common/http/**',
|
'packages/common/http/**',
|
||||||
|
'packages/http/**',
|
||||||
'packages/examples/http/**',
|
'packages/examples/http/**',
|
||||||
'aio/content/guide/http.md',
|
'aio/content/guide/http.md',
|
||||||
'aio/content/examples/http/**',
|
'aio/content/examples/http/**',
|
||||||
@ -493,8 +495,6 @@ groups:
|
|||||||
'packages/router/**',
|
'packages/router/**',
|
||||||
'packages/examples/router/**',
|
'packages/examples/router/**',
|
||||||
'aio/content/guide/router.md',
|
'aio/content/guide/router.md',
|
||||||
'aio/content/guide/router-tutorial.md',
|
|
||||||
'aio/content/examples/router-tutorial/**',
|
|
||||||
'aio/content/examples/router/**',
|
'aio/content/examples/router/**',
|
||||||
'aio/content/images/guide/router/**'
|
'aio/content/images/guide/router/**'
|
||||||
])
|
])
|
||||||
@ -568,7 +568,7 @@ groups:
|
|||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files.exclude('packages/compiler-cli/**'), [
|
||||||
'**/testing/**',
|
'**/testing/**',
|
||||||
'aio/content/guide/testing.md',
|
'aio/content/guide/testing.md',
|
||||||
'aio/content/examples/testing/**',
|
'aio/content/examples/testing/**',
|
||||||
@ -777,10 +777,10 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
|
- aikidave
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- StephenFluin
|
- StephenFluin
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Docs: Observables
|
# Docs: Observables
|
||||||
# =========================================================
|
# =========================================================
|
||||||
@ -947,7 +947,7 @@ groups:
|
|||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files.exclude("CHANGELOG.md"), [
|
||||||
'*',
|
'*',
|
||||||
'.circleci/**',
|
'.circleci/**',
|
||||||
'.devcontainer/**',
|
'.devcontainer/**',
|
||||||
@ -1019,6 +1019,7 @@ groups:
|
|||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
'goldens/public-api/**',
|
'goldens/public-api/**',
|
||||||
|
'CHANGELOG.md',
|
||||||
'docs/NAMING.md',
|
'docs/NAMING.md',
|
||||||
'aio/content/guide/glossary.md',
|
'aio/content/guide/glossary.md',
|
||||||
'aio/content/guide/styleguide.md',
|
'aio/content/guide/styleguide.md',
|
||||||
@ -1028,6 +1029,7 @@ groups:
|
|||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- kara
|
||||||
|
|
||||||
|
|
||||||
# ================================================
|
# ================================================
|
||||||
|
315
CHANGELOG.md
315
CHANGELOG.md
@ -1,77 +1,58 @@
|
|||||||
<a name="10.0.0-next.6"></a>
|
<a name="9.1.10"></a>
|
||||||
# [10.0.0-next.6](https://github.com/angular/angular/compare/10.0.0-next.5...10.0.0-next.6) (2020-05-07)
|
## [9.1.10](https://github.com/angular/angular/compare/9.1.9...9.1.10) (2020-06-09)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **bazel:** ng_package rule should update "package.json" of ts_library targets ([#36944](https://github.com/angular/angular/issues/36944)) ([d5293d2](https://github.com/angular/angular/commit/d5293d2))
|
* **elements:** fire custom element output events during component initialization ([454e073](https://github.com/angular/angular/commit/454e073)), closes [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L167-L170](https://github.com//github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts/issues/L167-L170) [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts#L164](https://github.com//github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/create-custom-element.ts/issues/L164) [/github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts#L158](https://github.com//github.com/angular/angular/blob/c0143cb2abdd172de1b95fd1d2c4cfc738640e28/packages/elements/src/component-factory-strategy.ts/issues/L158) [#36141](https://github.com/angular/angular/issues/36141)
|
||||||
* **compiler:** remove outdated and invalid warning for unresolved DI parameters ([#36985](https://github.com/angular/angular/issues/36985)) ([d0280a0](https://github.com/angular/angular/commit/d0280a0))
|
|
||||||
* **compiler:** switch to 'referencedFiles' for shim generation ([#36211](https://github.com/angular/angular/issues/36211)) ([4213e8d](https://github.com/angular/angular/commit/4213e8d))
|
|
||||||
* **compiler-cli:** `isCaseSensitive()` returns correct value ([#36859](https://github.com/angular/angular/issues/36859)) ([fc4741f](https://github.com/angular/angular/commit/fc4741f))
|
|
||||||
* **compiler-cli:** don't try to tag non-ts files as shims ([#36987](https://github.com/angular/angular/issues/36987)) ([42d1091](https://github.com/angular/angular/commit/42d1091))
|
|
||||||
* **compiler-cli:** ensure `getRootDirs()` handles case-sensitivity ([#36859](https://github.com/angular/angular/issues/36859)) ([3f3e9b7](https://github.com/angular/angular/commit/3f3e9b7))
|
|
||||||
* **compiler-cli:** ensure `MockFileSystem` handles case-sensitivity ([#36859](https://github.com/angular/angular/issues/36859)) ([26eacd4](https://github.com/angular/angular/commit/26eacd4))
|
|
||||||
* **compiler-cli:** ensure LogicalFileSystem handles case-sensitivity ([#36859](https://github.com/angular/angular/issues/36859)) ([53a8459](https://github.com/angular/angular/commit/53a8459))
|
|
||||||
* **compiler-cli:** fix bug tracking indirect NgModule dependencies ([#36211](https://github.com/angular/angular/issues/36211)) ([bab90a7](https://github.com/angular/angular/commit/bab90a7))
|
|
||||||
* **compiler-cli:** fix case-sensitivity issues in NgtscCompilerHost ([#36859](https://github.com/angular/angular/issues/36859)) ([0ec0ff3](https://github.com/angular/angular/commit/0ec0ff3))
|
|
||||||
* **compiler-cli:** normalize mock Windows file paths correctly ([#36859](https://github.com/angular/angular/issues/36859)) ([b682bd1](https://github.com/angular/angular/commit/b682bd1))
|
|
||||||
* **compiler-cli:** use CompilerHost to ensure canonical file paths ([#36859](https://github.com/angular/angular/issues/36859)) ([a10c126](https://github.com/angular/angular/commit/a10c126))
|
|
||||||
* **core:** handle pluralize functions that expect a number ([#36901](https://github.com/angular/angular/issues/36901)) ([2ff4b35](https://github.com/angular/angular/commit/2ff4b35)), closes [#36888](https://github.com/angular/angular/issues/36888)
|
|
||||||
* **core:** properly get root nodes from embedded views with <ng-content> ([#36051](https://github.com/angular/angular/issues/36051)) ([e30e132](https://github.com/angular/angular/commit/e30e132)), closes [#35967](https://github.com/angular/angular/issues/35967)
|
|
||||||
* **forms:** handle numeric values properly in the validator ([#36157](https://github.com/angular/angular/issues/36157)) ([88a235d](https://github.com/angular/angular/commit/88a235d)), closes [#35591](https://github.com/angular/angular/issues/35591)
|
|
||||||
* **forms:** number input fires valueChanges twice ([#36087](https://github.com/angular/angular/issues/36087)) ([97d6d90](https://github.com/angular/angular/commit/97d6d90)), closes [#12540](https://github.com/angular/angular/issues/12540)
|
|
||||||
* **localize:** ensure `getLocation()` works ([#36853](https://github.com/angular/angular/issues/36853)) ([70b25a3](https://github.com/angular/angular/commit/70b25a3))
|
|
||||||
* **ngcc:** support ModuleWithProviders functions that delegate ([#36948](https://github.com/angular/angular/issues/36948)) ([fafa50d](https://github.com/angular/angular/commit/fafa50d)), closes [#36892](https://github.com/angular/angular/issues/36892)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
|
|
||||||
* **bazel:** simplify ng_package by dropping esm5 and fesm5 ([#36944](https://github.com/angular/angular/issues/36944)) ([9dbb30f](https://github.com/angular/angular/commit/9dbb30f))
|
|
||||||
* **compiler-cli:** report error if undecorated class with Angular features is discovered ([#36921](https://github.com/angular/angular/issues/36921)) ([4c92cf4](https://github.com/angular/angular/commit/4c92cf4))
|
|
||||||
* **core:** undecorated-classes-with-decorated-fields migration should handle classes with lifecycle hooks ([#36921](https://github.com/angular/angular/issues/36921)) ([c6ecdc9](https://github.com/angular/angular/commit/c6ecdc9))
|
|
||||||
* **ngcc:** support for new APF where `module` points to esm2015 output ([#36944](https://github.com/angular/angular/issues/36944)) ([c98a4d6](https://github.com/angular/angular/commit/c98a4d6))
|
|
||||||
* **language-service:** [ivy] Parse Angular compiler options ([#36922](https://github.com/angular/angular/issues/36922)) ([dbd0f8e](https://github.com/angular/angular/commit/dbd0f8e))
|
|
||||||
* remove TypeScript 3.6 and 3.7 support ([#36329](https://github.com/angular/angular/issues/36329)) ([fbd281c](https://github.com/angular/angular/commit/fbd281c))
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
|
|
||||||
* **compiler-cli:** perform template type-checking incrementally ([#36211](https://github.com/angular/angular/issues/36211)) ([ecffc35](https://github.com/angular/angular/commit/ecffc35))
|
* **ngcc:** cache parsed tsconfig between runs ([1aae94a](https://github.com/angular/angular/commit/1aae94a)), closes [#37417](https://github.com/angular/angular/issues/37417) [#36882](https://github.com/angular/angular/issues/36882)
|
||||||
* **compiler-cli:** split Ivy template type-checking into multiple files ([#36211](https://github.com/angular/angular/issues/36211)) ([b861e9c](https://github.com/angular/angular/commit/b861e9c))
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* TypeScript versions 3.6 and 3.7 are no longer supported, please update to TypeScript 3.8
|
<a name="9.1.9"></a>
|
||||||
|
## [9.1.9](https://github.com/angular/angular/compare/9.1.8...9.1.9) (2020-05-20)
|
||||||
|
|
||||||
* **forms:** Number inputs no longer listen to the `change` event.
|
This release contains a re-submit of the following 3 commits with fixes for TS 3.8.
|
||||||
|
|
||||||
Tests which trigger `change` events need to be updated to trigger `input` events instead.
|
### Bug Fixes
|
||||||
|
|
||||||
The `change` event was in place to support IE9, as we found that `input` events were not fired with backspace or cut actions. If you need to maintain IE9 support, you will need to add a change event listener to number inputs and call the `onChange` method of `NumberValueAccessor` manually.
|
* **elements:** capture input properties set before upgrading the element ([#36114](https://github.com/angular/angular/issues/36114)) ([#37226](https://github.com/angular/angular/issues/37226)) ([a33cb2d](https://github.com/angular/angular/commit/a33cb2d)), closes [#30848](https://github.com/angular/angular/issues/30848) [#31416](https://github.com/angular/angular/issues/31416)
|
||||||
|
* **elements:** correctly handle getting/setting properties before connecting the element ([#36114](https://github.com/angular/angular/issues/36114)) ([#37226](https://github.com/angular/angular/issues/37226)) ([6ac0042](https://github.com/angular/angular/commit/6ac0042)), closes [/github.com/angular/angular/pull/31416/files#r300326698](https://github.com//github.com/angular/angular/pull/31416/files/issues/r300326698)
|
||||||
|
* **elements:** do not break when the constructor of an Angular Element is not called ([#36114](https://github.com/angular/angular/issues/36114)) ([#37226](https://github.com/angular/angular/issues/37226)) ([1465372](https://github.com/angular/angular/commit/1465372))
|
||||||
|
|
||||||
Lastly, old versions of WebDriver would synthetically trigger the `change` event on `WebElement.clear` and `WebElement.sendKeys`. If you are using an old version of WebDriver, you may need to update tests to ensure `input` events are triggered. For example, you could use `element.sendKeys(Keys.chord(Keys.CONTROL, "a"), Keys.BACK_SPACE);` in place of `element.clear()`.
|
|
||||||
* **forms:** The `minLength` and `maxLength` validators now verify that the form control's value has a
|
|
||||||
numeric `length` property, and only validate for length if that's the case.
|
|
||||||
|
|
||||||
Previously, falsey values without the length property (such as `0` or
|
|
||||||
`false` values) were triggering validation errors. If your code relies on
|
|
||||||
the old behavior, you can include other validators such as [min][1] or
|
|
||||||
[requiredTrue][2] to the list of validators for a particular field.
|
|
||||||
|
|
||||||
[1]: https://angular.io/api/forms/Validators#min
|
<a name="9.1.8"></a>
|
||||||
[2]: https://angular.io/api/forms/Validators#requiredTrue
|
## [9.1.8](https://github.com/angular/angular/compare/9.1.6...9.1.8) (2020-05-20)
|
||||||
* **bazel:** esm5 and fesm5 format is no longer distributed in
|
|
||||||
Angular's npm packages e.g. @angular/core
|
|
||||||
|
|
||||||
If you are not using Angular CLI to build your application or library,
|
|
||||||
and you need to be able to build es5 artifacts, then you will need to
|
|
||||||
downlevel the distributed Angular code to es5 on your own.
|
|
||||||
|
|
||||||
Angular CLI will automatically downlevel the code to es5 if differential
|
### Bug Fixes
|
||||||
loading is enabled in the Angular project, so no action is required from
|
|
||||||
Angular CLI users.
|
* **core:** Host classes should not be fed back into `@Input` ([#35889](https://github.com/angular/angular/issues/35889)) ([f872b69](https://github.com/angular/angular/commit/f872b69)), closes [#35383](https://github.com/angular/angular/issues/35383)
|
||||||
|
* **core:** inheritance delegate ctor regex updated to work on minified code ([#36962](https://github.com/angular/angular/issues/36962)) ([e3d3395](https://github.com/angular/angular/commit/e3d3395))
|
||||||
|
* **elements:** capture input properties set before upgrading the element ([#36114](https://github.com/angular/angular/issues/36114)) ([1c8f179](https://github.com/angular/angular/commit/1c8f179)), closes [#30848](https://github.com/angular/angular/issues/30848) [#31416](https://github.com/angular/angular/issues/31416)
|
||||||
|
* **elements:** correctly handle getting/setting properties before connecting the element ([#36114](https://github.com/angular/angular/issues/36114)) ([363f14c](https://github.com/angular/angular/commit/363f14c)), closes [/github.com/angular/angular/pull/31416/files#r300326698](https://github.com//github.com/angular/angular/pull/31416/files/issues/r300326698)
|
||||||
|
* **elements:** do not break when the constructor of an Angular Element is not called ([#36114](https://github.com/angular/angular/issues/36114)) ([87b9f08](https://github.com/angular/angular/commit/87b9f08))
|
||||||
|
* **router:** update type for routerLink to include null and undefined ([#37018](https://github.com/angular/angular/issues/37018)) ([7de7871](https://github.com/angular/angular/commit/7de7871)), closes [#13380](https://github.com/angular/angular/issues/13380) [#36544](https://github.com/angular/angular/issues/36544)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.1.7"></a>
|
||||||
|
## [9.1.7](https://github.com/angular/angular/compare/9.1.6...9.1.7) (2020-05-13)
|
||||||
|
|
||||||
|
This release contains various API docs improvements.
|
||||||
|
|
||||||
|
|
||||||
|
<a name="9.1.6"></a>
|
||||||
|
## [9.1.6](https://github.com/angular/angular/compare/9.1.5...9.1.6) (2020-05-08)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler-cli**: Revert "fix(compiler-cli): fix case-sensitivity issues in NgtscCompilerHost (#36968)" (#37003)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.5"></a>
|
<a name="9.1.5"></a>
|
||||||
@ -106,96 +87,6 @@ Angular CLI users.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.0-next.5"></a>
|
|
||||||
# [10.0.0-next.5](https://github.com/angular/angular/compare/10.0.0-next.4...10.0.0-next.5) (2020-05-04)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **core:** log error instead of warning for unknown properties and elements ([#36399](https://github.com/angular/angular/issues/36399)) ([9d9d46f](https://github.com/angular/angular/commit/9d9d46f)), closes [#35699](https://github.com/angular/angular/issues/35699)
|
|
||||||
* **core:** Refresh transplanted views at insertion point only ([#35968](https://github.com/angular/angular/issues/35968)) ([1786586](https://github.com/angular/angular/commit/1786586)), closes [#35400](https://github.com/angular/angular/issues/35400) [#21324](https://github.com/angular/angular/issues/21324)
|
|
||||||
* **ngcc:** do not run in parallel mode if there are less than 3 CPU cores ([#36626](https://github.com/angular/angular/issues/36626)) ([4c63241](https://github.com/angular/angular/commit/4c63241))
|
|
||||||
* **ngcc:** give up re-spawning crashed worker process after 3 attempts ([#36626](https://github.com/angular/angular/issues/36626)) ([793cb32](https://github.com/angular/angular/commit/793cb32))
|
|
||||||
* **ngcc:** handle `ENOMEM` errors in worker processes ([#36626](https://github.com/angular/angular/issues/36626)) ([4779c4b](https://github.com/angular/angular/commit/4779c4b))
|
|
||||||
* **ngcc:** provide a unique exit code for timeouts ([#36838](https://github.com/angular/angular/issues/36838)) ([d805526](https://github.com/angular/angular/commit/d805526))
|
|
||||||
* **ngcc:** support recovering when a worker process crashes ([#36626](https://github.com/angular/angular/issues/36626)) ([966598c](https://github.com/angular/angular/commit/966598c)), closes [#36278](https://github.com/angular/angular/issues/36278)
|
|
||||||
* **ngcc:** support TS 3.9 wrapped ES2015 classes ([#36884](https://github.com/angular/angular/issues/36884)) ([db4c59d](https://github.com/angular/angular/commit/db4c59d))
|
|
||||||
* **router:** cancel navigation when at least one resolver completes with no "next" emission ([#24621](https://github.com/angular/angular/issues/24621)) ([d9c4840](https://github.com/angular/angular/commit/d9c4840)), closes [#24195](https://github.com/angular/angular/issues/24195)
|
|
||||||
|
|
||||||
|
|
||||||
### Code Refactoring
|
|
||||||
|
|
||||||
* **common:** remove WrappedValue from AsyncPipe ([#36633](https://github.com/angular/angular/issues/36633)) ([49be32c](https://github.com/angular/angular/commit/49be32c)), closes [#29927](https://github.com/angular/angular/issues/29927)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **localize:** support merging multiple translation files ([#36792](https://github.com/angular/angular/issues/36792)) ([72f534f](https://github.com/angular/angular/commit/72f534f))
|
|
||||||
* **ngcc:** allow async locking timeouts to be configured ([#36838](https://github.com/angular/angular/issues/36838)) ([38f805c](https://github.com/angular/angular/commit/38f805c))
|
|
||||||
* **ngcc:** support marking an in-progress task as unprocessed ([#36626](https://github.com/angular/angular/issues/36626)) ([4665c35](https://github.com/angular/angular/commit/4665c35))
|
|
||||||
* **ngcc:** support reverting a file written by `FileWriter` ([#36626](https://github.com/angular/angular/issues/36626)) ([772ccf0](https://github.com/angular/angular/commit/772ccf0))
|
|
||||||
* **service-worker:** include `CacheQueryOptions` options in ngsw-config ([#34663](https://github.com/angular/angular/issues/34663)) ([dc9f4b9](https://github.com/angular/angular/commit/dc9f4b9)), closes [#28443](https://github.com/angular/angular/issues/28443)
|
|
||||||
* **service-worker:** use `ignoreVary: true` when retrieving responses from cache ([#34663](https://github.com/angular/angular/issues/34663)) ([ee35e22](https://github.com/angular/angular/commit/ee35e22)), closes [#36638](https://github.com/angular/angular/issues/36638)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **ngcc:** only compute basePaths in TargetedEntryPointFinder when needed ([#36881](https://github.com/angular/angular/issues/36881)) ([ec6b9cc](https://github.com/angular/angular/commit/ec6b9cc)), closes [#36874](https://github.com/angular/angular/issues/36874)
|
|
||||||
* **ngcc:** speed up the `getBasePaths()` computation ([#36881](https://github.com/angular/angular/issues/36881)) ([e037840](https://github.com/angular/angular/commit/e037840))
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **core:** Warnings about unknown elements are now logged as errors. This won't break your app, but it may trip up tools that expect nothing to be logged via `console.error`.
|
|
||||||
* **router:** Any resolver which return EMPTY will cancel navigation.
|
|
||||||
If you want to allow the navigation to continue, you will need to update the resolvers to emit
|
|
||||||
some value, (i.e. defaultIfEmpty(...), of(...), etc).
|
|
||||||
* **service-worker:** Previously, [Vary](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary)
|
|
||||||
headers would be taken into account when retrieving resources from the
|
|
||||||
cache, completely preventing the retrieval of cached assets (due to
|
|
||||||
ServiceWorker implementation details) and leading to unpredictable
|
|
||||||
behavior due to inconsistent/buggy implementations in different
|
|
||||||
browsers.
|
|
||||||
|
|
||||||
Now, `Vary` headers are ignored when retrieving resources from the
|
|
||||||
ServiceWorker caches, which can result in resources being retrieved even
|
|
||||||
when their headers are different. If your application needs to
|
|
||||||
differentiate its responses based on request headers, please make sure
|
|
||||||
the Angular ServiceWorker is [configured](https://angular.io/guide/service-worker-config)
|
|
||||||
to avoid caching the affected resources.
|
|
||||||
* **common:** This change could result in ExpressionChangedAfterItHasBeenChecked errors that
|
|
||||||
were not detected before. The error could previously have gone undetected
|
|
||||||
because two WrappedValues are considered "equal" in all cases for the purposes
|
|
||||||
of the check, even if their respective unwrapped values are not.
|
|
||||||
|
|
||||||
Additionally, `[val]=(observable | async).someProperty` will no longer
|
|
||||||
trigger change detection if the value of `someProperty` is identical to
|
|
||||||
the value in the previous emit. If you need to force change detection,
|
|
||||||
either update the binding to use an object whose reference changes or
|
|
||||||
subscribe to the observable and call markForCheck as needed.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.0-next.4"></a>
|
|
||||||
# [10.0.0-next.4](https://github.com/angular/angular/compare/10.0.0-next.3...10.0.0-next.4) (2020-04-29)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **compiler:** normalize line endings in ICU expansions ([#36741](https://github.com/angular/angular/issues/36741)) ([70dd27f](https://github.com/angular/angular/commit/70dd27f)), closes [#36725](https://github.com/angular/angular/issues/36725)
|
|
||||||
* **core:** attempt to recover from user errors during creation ([#36381](https://github.com/angular/angular/issues/36381)) ([3d82aa7](https://github.com/angular/angular/commit/3d82aa7)), closes [#31221](https://github.com/angular/angular/issues/31221)
|
|
||||||
* **core:** handle synthetic props in Directive host bindings correctly ([#35568](https://github.com/angular/angular/issues/35568)) ([f27deea](https://github.com/angular/angular/commit/f27deea)), closes [#35501](https://github.com/angular/angular/issues/35501)
|
|
||||||
* **language-service:** disable update the `[@angular](https://github.com/angular)/core` module ([#36783](https://github.com/angular/angular/issues/36783)) ([dd049ca](https://github.com/angular/angular/commit/dd049ca))
|
|
||||||
* **localize:** include legacy ids when describing messages ([#36761](https://github.com/angular/angular/issues/36761)) ([47f9867](https://github.com/angular/angular/commit/47f9867))
|
|
||||||
* **ngcc:** recognize enum declarations emitted in JavaScript ([#36550](https://github.com/angular/angular/issues/36550)) ([89c5890](https://github.com/angular/angular/commit/89c5890)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **router:** allow CanLoad guard to return UrlTree ([#36610](https://github.com/angular/angular/issues/36610)) ([00e6cb1](https://github.com/angular/angular/commit/00e6cb1)), closes [#26521](https://github.com/angular/angular/issues/26521) [#28306](https://github.com/angular/angular/issues/28306)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.4"></a>
|
<a name="9.1.4"></a>
|
||||||
## [9.1.4](https://github.com/angular/angular/compare/9.1.3...9.1.4) (2020-04-29)
|
## [9.1.4](https://github.com/angular/angular/compare/9.1.3...9.1.4) (2020-04-29)
|
||||||
|
|
||||||
@ -210,42 +101,6 @@ subscribe to the observable and call markForCheck as needed.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.0-next.3"></a>
|
|
||||||
# [10.0.0-next.3](https://github.com/angular/angular/compare/10.0.0-next.2...10.0.0-next.3) (2020-04-22)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** format day-periods that cross midnight ([#36611](https://github.com/angular/angular/issues/36611)) ([c6e5fc4](https://github.com/angular/angular/commit/c6e5fc4)), closes [#36566](https://github.com/angular/angular/issues/36566)
|
|
||||||
* **compiler:** avoid generating i18n attributes in plain form ([#36422](https://github.com/angular/angular/issues/36422)) ([88b0985](https://github.com/angular/angular/commit/88b0985))
|
|
||||||
* **core:** do not use unbound attributes as inputs to structural directives ([#36441](https://github.com/angular/angular/issues/36441)) ([acf6075](https://github.com/angular/angular/commit/acf6075))
|
|
||||||
* **core:** handle empty translations correctly ([#36499](https://github.com/angular/angular/issues/36499)) ([b1f1d3f](https://github.com/angular/angular/commit/b1f1d3f)), closes [#36476](https://github.com/angular/angular/issues/36476)
|
|
||||||
* **core:** missing-injectable migration should not migrate `@NgModule` classes ([#36369](https://github.com/angular/angular/issues/36369)) ([28995db](https://github.com/angular/angular/commit/28995db)), closes [#35700](https://github.com/angular/angular/issues/35700)
|
|
||||||
* **core:** pipes injecting viewProviders when used on a component host node ([#36512](https://github.com/angular/angular/issues/36512)) ([81d23b3](https://github.com/angular/angular/commit/81d23b3)), closes [#36146](https://github.com/angular/angular/issues/36146)
|
|
||||||
* **core:** prevent unknown property check for AOT-compiled components ([#36072](https://github.com/angular/angular/issues/36072)) ([4a9f0be](https://github.com/angular/angular/commit/4a9f0be)), closes [#35945](https://github.com/angular/angular/issues/35945)
|
|
||||||
* **core:** properly identify modules affected by overrides in TestBed ([#36649](https://github.com/angular/angular/issues/36649)) ([942b986](https://github.com/angular/angular/commit/942b986)), closes [#36619](https://github.com/angular/angular/issues/36619)
|
|
||||||
* **language-service:** properly evaluate types in comparable expressions ([#36529](https://github.com/angular/angular/issues/36529)) ([8be0972](https://github.com/angular/angular/commit/8be0972))
|
|
||||||
* **ngcc:** display unlocker process output in sync mode ([#36637](https://github.com/angular/angular/issues/36637)) ([cabf997](https://github.com/angular/angular/commit/cabf997)), closes [/github.com/nodejs/node/issues/3596#issuecomment-250890218](https://github.com//github.com/nodejs/node/issues/3596/issues/issuecomment-250890218)
|
|
||||||
* **ngcc:** do not use cached file-system ([#36687](https://github.com/angular/angular/issues/36687)) ([0c2ed4c](https://github.com/angular/angular/commit/0c2ed4c)), closes [/github.com/angular/angular-cli/issues/16860#issuecomment-614694269](https://github.com//github.com/angular/angular-cli/issues/16860/issues/issuecomment-614694269)
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **common:** format day-periods that cross midnight
|
|
||||||
|
|
||||||
When formatting a time with the `b` or `B` format codes, the rendered
|
|
||||||
string was not correctly handling day periods that spanned midnight.
|
|
||||||
Instead the logic was falling back to the default case of `AM`.
|
|
||||||
|
|
||||||
Now the logic has been updated so that it matches times that are within
|
|
||||||
a day period that spans midnight, so it will now render the correct
|
|
||||||
output, such as `at night` in the case of English.
|
|
||||||
|
|
||||||
Applications that are using either `formatDate()` or `DatePipe` and any
|
|
||||||
of the `b` or `B` format codes will be affected by this change.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.3"></a>
|
<a name="9.1.3"></a>
|
||||||
## [9.1.3](https://github.com/angular/angular/compare/9.1.2...9.1.3) (2020-04-22)
|
## [9.1.3](https://github.com/angular/angular/compare/9.1.2...9.1.3) (2020-04-22)
|
||||||
|
|
||||||
@ -265,32 +120,6 @@ subscribe to the observable and call markForCheck as needed.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.0-next.2"></a>
|
|
||||||
# [10.0.0-next.2](https://github.com/angular/angular/compare/10.0.0-next.1...10.0.0-next.2) (2020-04-15)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** `locales/global/*.js` are not ES5 compliant ([#36342](https://github.com/angular/angular/issues/36342)) ([078b0be](https://github.com/angular/angular/commit/078b0be)), closes [angular/angular-cli#16394](https://github.com/angular/angular-cli/issues/16394)
|
|
||||||
* **compiler:** handle type references to namespaced symbols correctly ([#36106](https://github.com/angular/angular/issues/36106)) ([4aa4e6f](https://github.com/angular/angular/commit/4aa4e6f)), closes [#36006](https://github.com/angular/angular/issues/36006)
|
|
||||||
* **core:** undecorated-classes-with-decorated-fields migration should avoid error if base class has no value declaration ([#36543](https://github.com/angular/angular/issues/36543)) ([ca67748](https://github.com/angular/angular/commit/ca67748)), closes [#36522](https://github.com/angular/angular/issues/36522)
|
|
||||||
* **ngcc:** correctly detect external files from nested `node_modules/` ([#36559](https://github.com/angular/angular/issues/36559)) ([6ab43d7](https://github.com/angular/angular/commit/6ab43d7)), closes [#36526](https://github.com/angular/angular/issues/36526)
|
|
||||||
* **ngcc:** display output from the unlocker process on Windows ([#36569](https://github.com/angular/angular/issues/36569)) ([e041ac6](https://github.com/angular/angular/commit/e041ac6))
|
|
||||||
* **ngcc:** do not spawn unlocker processes on cluster workers ([#36569](https://github.com/angular/angular/issues/36569)) ([66effde](https://github.com/angular/angular/commit/66effde)), closes [#35861](https://github.com/angular/angular/issues/35861)
|
|
||||||
* **ngcc:** do not warn if `paths` mapping does not exist ([#36525](https://github.com/angular/angular/issues/36525)) ([717df13](https://github.com/angular/angular/commit/717df13)), closes [#36518](https://github.com/angular/angular/issues/36518)
|
|
||||||
* **ngcc:** force ngcc to exit on error ([#36622](https://github.com/angular/angular/issues/36622)) ([663b768](https://github.com/angular/angular/commit/663b768)), closes [#36616](https://github.com/angular/angular/issues/36616)
|
|
||||||
* **router:** pass correct component to canDeactivate checks when using two or more sibling router-outlets ([#36302](https://github.com/angular/angular/issues/36302)) ([80e6c07](https://github.com/angular/angular/commit/80e6c07)), closes [#34614](https://github.com/angular/angular/issues/34614)
|
|
||||||
* **upgrade:** update $locationShim to handle Location changes before initialization ([#36498](https://github.com/angular/angular/issues/36498)) ([0cc53fb](https://github.com/angular/angular/commit/0cc53fb)), closes [#36492](https://github.com/angular/angular/issues/36492)
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **ngcc:** only load if it is needed ([#36486](https://github.com/angular/angular/issues/36486)) ([3bedfda](https://github.com/angular/angular/commit/3bedfda))
|
|
||||||
* **ngcc:** read dependencies from entry-point manifest ([#36486](https://github.com/angular/angular/issues/36486)) ([a185efb](https://github.com/angular/angular/commit/a185efb)), closes [#issuecomment-608401834](https://github.com/angular/angular/issues/issuecomment-608401834)
|
|
||||||
* **ngcc:** reduce the size of the entry-point manifest file ([#36486](https://github.com/angular/angular/issues/36486)) ([ec0ce60](https://github.com/angular/angular/commit/ec0ce60))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.2"></a>
|
<a name="9.1.2"></a>
|
||||||
## [9.1.2](https://github.com/angular/angular/compare/9.1.1...9.1.2) (2020-04-15)
|
## [9.1.2](https://github.com/angular/angular/compare/9.1.1...9.1.2) (2020-04-15)
|
||||||
|
|
||||||
@ -307,77 +136,14 @@ subscribe to the observable and call markForCheck as needed.
|
|||||||
* **router:** pass correct component to canDeactivate checks when using two or more sibling router-outlets ([#36302](https://github.com/angular/angular/issues/36302)) ([8e7f903](https://github.com/angular/angular/commit/8e7f903)), closes [#34614](https://github.com/angular/angular/issues/34614)
|
* **router:** pass correct component to canDeactivate checks when using two or more sibling router-outlets ([#36302](https://github.com/angular/angular/issues/36302)) ([8e7f903](https://github.com/angular/angular/commit/8e7f903)), closes [#34614](https://github.com/angular/angular/issues/34614)
|
||||||
* **upgrade:** update $locationShim to handle Location changes before initialization ([#36498](https://github.com/angular/angular/issues/36498)) ([a67afcc](https://github.com/angular/angular/commit/a67afcc)), closes [#36492](https://github.com/angular/angular/issues/36492)
|
* **upgrade:** update $locationShim to handle Location changes before initialization ([#36498](https://github.com/angular/angular/issues/36498)) ([a67afcc](https://github.com/angular/angular/commit/a67afcc)), closes [#36492](https://github.com/angular/angular/issues/36492)
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
### Performance Improvements
|
||||||
* **ngcc:** only load if it is needed ([#36486](https://github.com/angular/angular/issues/36486)) ([e06512b](https://github.com/angular/angular/commit/e06512b)) * **ngcc:** read dependencies from entry-point manifest ([#36486](https://github.com/angular/angular/issues/36486)) ([918e628](https://github.com/angular/angular/commit/918e628)), closes [#issuecomment-608401834](https://github.com/angular/angular/issues/issuecomment-608401834)
|
|
||||||
|
* **ngcc:** only load if it is needed ([#36486](https://github.com/angular/angular/issues/36486)) ([e06512b](https://github.com/angular/angular/commit/e06512b))
|
||||||
|
* **ngcc:** read dependencies from entry-point manifest ([#36486](https://github.com/angular/angular/issues/36486)) ([918e628](https://github.com/angular/angular/commit/918e628)), closes [#issuecomment-608401834](https://github.com/angular/angular/issues/issuecomment-608401834)
|
||||||
* **ngcc:** reduce the size of the entry-point manifest file ([#36486](https://github.com/angular/angular/issues/36486)) ([603b094](https://github.com/angular/angular/commit/603b094))
|
* **ngcc:** reduce the size of the entry-point manifest file ([#36486](https://github.com/angular/angular/issues/36486)) ([603b094](https://github.com/angular/angular/commit/603b094))
|
||||||
|
|
||||||
|
|
||||||
<a name="10.0.0-next.1"></a>
|
|
||||||
# [10.0.0-next.1](https://github.com/angular/angular/compare/10.0.0-next.0...10.0.0-next.1) (2020-04-08)
|
|
||||||
|
|
||||||
This release contains various API docs improvements.
|
|
||||||
|
|
||||||
<a name="10.0.0-next.0"></a>
|
|
||||||
# [10.0.0-next.0](https://github.com/angular/angular/compare/9.1.0-rc.0...10.0.0-next.0) (2020-04-08)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** let `KeyValuePipe` accept type unions with `null` ([#36093](https://github.com/angular/angular/issues/36093)) ([d783519](https://github.com/angular/angular/commit/d783519)), closes [#35743](https://github.com/angular/angular/issues/35743)
|
|
||||||
* **compiler:** avoid undefined expressions in holey array ([#36343](https://github.com/angular/angular/issues/36343)) ([5516802](https://github.com/angular/angular/commit/5516802))
|
|
||||||
* **compiler:** record correct end of expression ([#34690](https://github.com/angular/angular/issues/34690)) ([df890d7](https://github.com/angular/angular/commit/df890d7)), closes [#33477](https://github.com/angular/angular/issues/33477)
|
|
||||||
* **compiler:** resolve enum values in binary operations ([#36461](https://github.com/angular/angular/issues/36461)) ([64022f5](https://github.com/angular/angular/commit/64022f5)), closes [#35584](https://github.com/angular/angular/issues/35584)
|
|
||||||
* **compiler-cli:** pass real source spans where they are empty ([#31805](https://github.com/angular/angular/issues/31805)) ([e893c5a](https://github.com/angular/angular/commit/e893c5a))
|
|
||||||
* **core:** avoid migration error when non-existent symbol is imported ([#36367](https://github.com/angular/angular/issues/36367)) ([d43c306](https://github.com/angular/angular/commit/d43c306)), closes [#36346](https://github.com/angular/angular/issues/36346)
|
|
||||||
* **core:** ngOnDestroy on multi providers called with incorrect context ([#35840](https://github.com/angular/angular/issues/35840)) ([95fc3d4](https://github.com/angular/angular/commit/95fc3d4)), closes [#35231](https://github.com/angular/angular/issues/35231)
|
|
||||||
* **core:** run `APP_INITIALIZER`s before accessing `LOCALE_ID` token in Ivy TestBed ([#36237](https://github.com/angular/angular/issues/36237)) ([1649743](https://github.com/angular/angular/commit/1649743)), closes [#36230](https://github.com/angular/angular/issues/36230)
|
|
||||||
* **core:** undecorated-classes-with-decorated-fields migration does not decorate derived classes ([#35339](https://github.com/angular/angular/issues/35339)) ([32eafef](https://github.com/angular/angular/commit/32eafef)), closes [#34376](https://github.com/angular/angular/issues/34376)
|
|
||||||
* **core:** workaround Terser inlining bug ([#36200](https://github.com/angular/angular/issues/36200)) ([0ce8ad3](https://github.com/angular/angular/commit/0ce8ad3))
|
|
||||||
* **elements:** correctly handle setting inputs to `undefined` ([#36140](https://github.com/angular/angular/issues/36140)) ([9ba46d9](https://github.com/angular/angular/commit/9ba46d9))
|
|
||||||
* **elements:** correctly set `SimpleChange#firstChange` for pre-existing inputs ([#36140](https://github.com/angular/angular/issues/36140)) ([b14ac96](https://github.com/angular/angular/commit/b14ac96)), closes [#36130](https://github.com/angular/angular/issues/36130)
|
|
||||||
* **language-service:** infer type of elements of array-like objects ([#36312](https://github.com/angular/angular/issues/36312)) ([fe2b692](https://github.com/angular/angular/commit/fe2b692)), closes [#36191](https://github.com/angular/angular/issues/36191)
|
|
||||||
* **language-service:** use the `HtmlAst` to get the span of HTML tag ([#36371](https://github.com/angular/angular/issues/36371)) ([81195a2](https://github.com/angular/angular/commit/81195a2))
|
|
||||||
* **localize:** allow ICU expansion case to start with any character except `}` ([#36123](https://github.com/angular/angular/issues/36123)) ([fced8ee](https://github.com/angular/angular/commit/fced8ee)), closes [#31586](https://github.com/angular/angular/issues/31586)
|
|
||||||
* **ngcc:** add process title ([#36448](https://github.com/angular/angular/issues/36448)) ([76a8cd5](https://github.com/angular/angular/commit/76a8cd5)), closes [/github.com/angular/angular/issues/36414#issuecomment-609644282](https://github.com//github.com/angular/angular/issues/36414/issues/issuecomment-609644282)
|
|
||||||
* **ngcc:** allow ngcc configuration to match pre-release versions of packages ([#36370](https://github.com/angular/angular/issues/36370)) ([326240e](https://github.com/angular/angular/commit/326240e))
|
|
||||||
* **ngcc:** correctly detect imported TypeScript helpers ([#36284](https://github.com/angular/angular/issues/36284)) ([ca25c95](https://github.com/angular/angular/commit/ca25c95)), closes [#36089](https://github.com/angular/angular/issues/36089)
|
|
||||||
* **ngcc:** correctly identify relative Windows-style import paths ([#36372](https://github.com/angular/angular/issues/36372)) ([aecf9de](https://github.com/angular/angular/commit/aecf9de))
|
|
||||||
* **ngcc:** correctly identify the package path of secondary entry-points ([#36249](https://github.com/angular/angular/issues/36249)) ([995cd15](https://github.com/angular/angular/commit/995cd15)), closes [#35747](https://github.com/angular/angular/issues/35747)
|
|
||||||
* **ngcc:** detect non-emitted, non-imported TypeScript helpers ([#36418](https://github.com/angular/angular/issues/36418)) ([5fa7b8b](https://github.com/angular/angular/commit/5fa7b8b))
|
|
||||||
* **ngcc:** do not spawn more processes than intended in parallel mode ([#36280](https://github.com/angular/angular/issues/36280)) ([5cee709](https://github.com/angular/angular/commit/5cee709)), closes [#35719](https://github.com/angular/angular/issues/35719) [#36278](https://github.com/angular/angular/issues/36278) [/github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts#L429](https://github.com//github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts/issues/L429) [/github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L108](https://github.com//github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts/issues/L108) [/github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L110](https://github.com//github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts/issues/L110) [/github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L199](https://github.com//github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts/issues/L199)
|
|
||||||
* **ngcc:** do not write entry-point manifest outside node_modules ([#36299](https://github.com/angular/angular/issues/36299)) ([c6dd900](https://github.com/angular/angular/commit/c6dd900)), closes [#36296](https://github.com/angular/angular/issues/36296)
|
|
||||||
* **ngcc:** don't crash on cyclic source-map references ([#36452](https://github.com/angular/angular/issues/36452)) ([ee70a18](https://github.com/angular/angular/commit/ee70a18)), closes [#35727](https://github.com/angular/angular/issues/35727) [#35757](https://github.com/angular/angular/issues/35757)
|
|
||||||
* **ngcc:** handle bad path mappings when finding entry-points ([#36331](https://github.com/angular/angular/issues/36331)) ([cc4b813](https://github.com/angular/angular/commit/cc4b813)), closes [#36313](https://github.com/angular/angular/issues/36313) [#36283](https://github.com/angular/angular/issues/36283)
|
|
||||||
* **ngcc:** handle entry-points within container folders ([#36305](https://github.com/angular/angular/issues/36305)) ([38ad1d9](https://github.com/angular/angular/commit/38ad1d9)), closes [#35756](https://github.com/angular/angular/issues/35756) [#36216](https://github.com/angular/angular/issues/36216)
|
|
||||||
* **ngcc:** sniff `main` property for ESM5 format ([#36396](https://github.com/angular/angular/issues/36396)) ([2463548](https://github.com/angular/angular/commit/2463548)), closes [#35788](https://github.com/angular/angular/issues/35788)
|
|
||||||
* **ngcc:** support ignoring deep-imports via package config ([#36423](https://github.com/angular/angular/issues/36423)) ([f9fb833](https://github.com/angular/angular/commit/f9fb833)), closes [#35750](https://github.com/angular/angular/issues/35750)
|
|
||||||
* **ngcc:** support simple `browser` property in entry-points ([#36396](https://github.com/angular/angular/issues/36396)) ([6b3aa60](https://github.com/angular/angular/commit/6b3aa60)), closes [#36062](https://github.com/angular/angular/issues/36062)
|
|
||||||
* **ngcc:** use path-mappings from tsconfig in dependency resolution ([#36180](https://github.com/angular/angular/issues/36180)) ([380de1e](https://github.com/angular/angular/commit/380de1e)), closes [#36119](https://github.com/angular/angular/issues/36119)
|
|
||||||
* **ngcc:** use preserve whitespaces from tsconfig if provided ([#36189](https://github.com/angular/angular/issues/36189)) ([b8e9a30](https://github.com/angular/angular/commit/b8e9a30)), closes [#35871](https://github.com/angular/angular/issues/35871)
|
|
||||||
* **platform-server:** update `xhr2` dependency ([#36366](https://github.com/angular/angular/issues/36366)) ([b59bc0e](https://github.com/angular/angular/commit/b59bc0e)), closes [#36358](https://github.com/angular/angular/issues/36358)
|
|
||||||
* **router:** allow UrlMatcher to return null ([#36402](https://github.com/angular/angular/issues/36402)) ([568e9df](https://github.com/angular/angular/commit/568e9df)), closes [#29824](https://github.com/angular/angular/issues/29824)
|
|
||||||
* **router:** state data missing in routerLink ([#36462](https://github.com/angular/angular/issues/36462)) ([e0415db](https://github.com/angular/angular/commit/e0415db)), closes [#33173](https://github.com/angular/angular/issues/33173)
|
|
||||||
* **service-worker:** by default register the SW after 30s even the app never stabilizes ([#35870](https://github.com/angular/angular/issues/35870)) ([29e8a64](https://github.com/angular/angular/commit/29e8a64)), closes [#34464](https://github.com/angular/angular/issues/34464)
|
|
||||||
* **service-worker:** prevent SW registration strategies from affecting app stabilization ([#35870](https://github.com/angular/angular/issues/35870)) ([2d7c95f](https://github.com/angular/angular/commit/2d7c95f))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **compiler:** add dependency info and ng-content selectors to metadata ([#35695](https://github.com/angular/angular/issues/35695)) ([32ce8b1](https://github.com/angular/angular/commit/32ce8b1))
|
|
||||||
* **compiler:** Propagate value span of ExpressionBinding to ParsedProperty ([#36133](https://github.com/angular/angular/issues/36133)) ([d714b95](https://github.com/angular/angular/commit/d714b95))
|
|
||||||
* **core:** undecorated-classes migration should handle derived abstract classes ([#35339](https://github.com/angular/angular/issues/35339)) ([c24ad56](https://github.com/angular/angular/commit/c24ad56))
|
|
||||||
* **service-worker:** support timeout in `registerWhenStable` SW registration strategy ([#35870](https://github.com/angular/angular/issues/35870)) ([00efacf](https://github.com/angular/angular/commit/00efacf)), closes [#34464](https://github.com/angular/angular/issues/34464)
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **router:** UrlMatcher's type now reflects that it could always return
|
|
||||||
null.
|
|
||||||
|
|
||||||
If you implemented your own Router or Recognizer class, please update it to
|
|
||||||
handle matcher returning null.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.1"></a>
|
<a name="9.1.1"></a>
|
||||||
## [9.1.1](https://github.com/angular/angular/compare/9.1.0...9.1.1) (2020-04-07)
|
## [9.1.1](https://github.com/angular/angular/compare/9.1.0...9.1.1) (2020-04-07)
|
||||||
@ -413,6 +179,7 @@ This release contains various API docs improvements.
|
|||||||
* **router:** state data missing in routerLink ([#36462](https://github.com/angular/angular/issues/36462)) ([0e7a89a](https://github.com/angular/angular/commit/0e7a89a)), closes [#33173](https://github.com/angular/angular/issues/33173)
|
* **router:** state data missing in routerLink ([#36462](https://github.com/angular/angular/issues/36462)) ([0e7a89a](https://github.com/angular/angular/commit/0e7a89a)), closes [#33173](https://github.com/angular/angular/issues/33173)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="9.1.0"></a>
|
<a name="9.1.0"></a>
|
||||||
# [9.1.0](https://github.com/angular/angular/compare/9.0.0...9.1.0) (2020-03-25)
|
# [9.1.0](https://github.com/angular/angular/compare/9.0.0...9.1.0) (2020-03-25)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
## Install git, Node.js and yarn
|
## Install git, Node.js and yarn
|
||||||
- `sudo apt-get update`
|
- `sudo apt-get update`
|
||||||
- `sudo apt-get install -y git`
|
- `sudo apt-get install -y git`
|
||||||
- Install [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
|
- Install the latest stable version of [Node.js](https://nodejs.org/en/download).
|
||||||
- Install Node.js: `nvm install 12`
|
- Install the latest stable version of [yarn](https://classic.yarnpkg.com/en/docs/install).
|
||||||
- Install yarn: `npm install --global yarn`
|
|
||||||
|
|
||||||
|
|
||||||
## Checkout repository
|
## Checkout repository
|
||||||
@ -18,7 +17,11 @@
|
|||||||
- You can overwrite the default environment variables inside the image, by passing new values using
|
- You can overwrite the default environment variables inside the image, by passing new values using
|
||||||
`--build-arg`.
|
`--build-arg`.
|
||||||
|
|
||||||
**Note:** The script has to execute docker commands with `sudo`.
|
**Note 1:** The script has to execute docker commands with `sudo`.
|
||||||
|
|
||||||
|
**Note 2:**
|
||||||
|
The script has to execute `yarn` commands, so make sure `yarn` is on the `PATH` when invoking the
|
||||||
|
script.
|
||||||
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
@ -8,7 +8,7 @@ VM host to update the preview server based on changes in the source code.
|
|||||||
|
|
||||||
The script will pull the latest changes from the origin's master branch and examine if there have
|
The script will pull the latest changes from the origin's master branch and examine if there have
|
||||||
been any changes in files inside the preview server source code directory (see below). If there are,
|
been any changes in files inside the preview server source code directory (see below). If there are,
|
||||||
it will create a new image and verify that is works as expected. Finally, it will stop and remove
|
it will create a new image and verify that it works as expected. Finally, it will stop and remove
|
||||||
the old docker container and image, create a new container based on the new image and start it.
|
the old docker container and image, create a new container based on the new image and start it.
|
||||||
|
|
||||||
The script assumes that the preview server source code is in the repository's
|
The script assumes that the preview server source code is in the repository's
|
||||||
@ -25,7 +25,11 @@ used for.
|
|||||||
|
|
||||||
**Note 1:** The script has to execute docker commands with `sudo`.
|
**Note 1:** The script has to execute docker commands with `sudo`.
|
||||||
|
|
||||||
**Note 2:** Make sure the user that executes the script has access to update the repository
|
**Note 2:**
|
||||||
|
The script has to execute `yarn` commands, so make sure `yarn` is on the `PATH` when invoking the
|
||||||
|
script.
|
||||||
|
|
||||||
|
**Note 3:** Make sure the user that executes the script has access to update the repository.
|
||||||
|
|
||||||
|
|
||||||
## Run the script manually
|
## Run the script manually
|
||||||
@ -50,3 +54,9 @@ log its output to `update-preview-server.log` (assuming the user has the necessa
|
|||||||
# Periodically check for changes and update the preview server (if necessary)
|
# Periodically check for changes and update the preview server (if necessary)
|
||||||
*/30 * * * * /path/to/update-preview-server.sh /path/to/repo /path/to/secrets /path/to/builds /path/to/localcerts /path/to/logs >> /path/to/update-preview-server.log 2>&1
|
*/30 * * * * /path/to/update-preview-server.sh /path/to/repo /path/to/secrets /path/to/builds /path/to/localcerts /path/to/logs >> /path/to/update-preview-server.log 2>&1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
Keep in mind that cron jobs run in non-interactive, non-login shells. This means that the execution
|
||||||
|
context might be different compared to when running the same commands from an interactive, login
|
||||||
|
shell. For example, `.bashrc` files are normally _not_ sourced automatically in cron jobs. See
|
||||||
|
[here](http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html) for more info.
|
||||||
|
@ -13,7 +13,8 @@ readonly HOST_LOCALCERTS_DIR=$4
|
|||||||
readonly HOST_LOGS_DIR=$5
|
readonly HOST_LOGS_DIR=$5
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
readonly PROVISIONAL_IMAGE_NAME=aio-builds:provisional
|
readonly PROVISIONAL_TAG=provisional
|
||||||
|
readonly PROVISIONAL_IMAGE_NAME=aio-builds:$PROVISIONAL_TAG
|
||||||
readonly LATEST_IMAGE_NAME=aio-builds:latest
|
readonly LATEST_IMAGE_NAME=aio-builds:latest
|
||||||
readonly CONTAINER_NAME=aio
|
readonly CONTAINER_NAME=aio
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ readonly CONTAINER_NAME=aio
|
|||||||
# Do not update the server unless files inside `aio-builds-setup/` have changed
|
# Do not update the server unless files inside `aio-builds-setup/` have changed
|
||||||
# or the last attempt failed (identified by the provisional image still being around).
|
# or the last attempt failed (identified by the provisional image still being around).
|
||||||
readonly relevantChangedFilesCount=$(git diff --name-only $lastDeployedCommit...HEAD | grep -P "^aio/aio-builds-setup/" | wc -l)
|
readonly relevantChangedFilesCount=$(git diff --name-only $lastDeployedCommit...HEAD | grep -P "^aio/aio-builds-setup/" | wc -l)
|
||||||
readonly lastAttemptFailed=$(sudo docker rmi "$PROVISIONAL_IMAGE_NAME" >> /dev/fd/3 && echo "true" || echo "false")
|
readonly lastAttemptFailed=$(sudo docker image ls | grep "$PROVISIONAL_TAG" >> /dev/fd/3 && echo "true" || echo "false")
|
||||||
if [[ $relevantChangedFilesCount -eq 0 ]] && [[ "$lastAttemptFailed" != "true" ]]; then
|
if [[ $relevantChangedFilesCount -eq 0 ]] && [[ "$lastAttemptFailed" != "true" ]]; then
|
||||||
echo "Skipping update because no relevant files have been touched."
|
echo "Skipping update because no relevant files have been touched."
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
AfterViewChecked,
|
AfterViewChecked,
|
||||||
AfterViewInit,
|
AfterViewInit,
|
||||||
Directive,
|
|
||||||
DoCheck,
|
DoCheck,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
@ -16,8 +15,7 @@ import { LoggerService } from './logger.service';
|
|||||||
let nextId = 1;
|
let nextId = 1;
|
||||||
|
|
||||||
// #docregion ngOnInit
|
// #docregion ngOnInit
|
||||||
@Directive()
|
export class PeekABoo implements OnInit {
|
||||||
export class PeekABooDirective implements OnInit {
|
|
||||||
constructor(private logger: LoggerService) { }
|
constructor(private logger: LoggerService) { }
|
||||||
|
|
||||||
// implement OnInit's `ngOnInit` method
|
// implement OnInit's `ngOnInit` method
|
||||||
@ -36,7 +34,7 @@ export class PeekABooDirective implements OnInit {
|
|||||||
})
|
})
|
||||||
// Don't HAVE to mention the Lifecycle Hook interfaces
|
// Don't HAVE to mention the Lifecycle Hook interfaces
|
||||||
// unless we want typing and tool support.
|
// unless we want typing and tool support.
|
||||||
export class PeekABooComponent extends PeekABooDirective implements
|
export class PeekABooComponent extends PeekABoo implements
|
||||||
OnChanges, OnInit, DoCheck,
|
OnChanges, OnInit, DoCheck,
|
||||||
AfterContentInit, AfterContentChecked,
|
AfterContentInit, AfterContentChecked,
|
||||||
AfterViewInit, AfterViewChecked,
|
AfterViewInit, AfterViewChecked,
|
||||||
|
@ -23,7 +23,7 @@ export class GreetingModule {
|
|||||||
// #enddocregion ctor
|
// #enddocregion ctor
|
||||||
|
|
||||||
// #docregion for-root
|
// #docregion for-root
|
||||||
static forRoot(config: UserServiceConfig): ModuleWithProviders<GreetingModule> {
|
static forRoot(config: UserServiceConfig): ModuleWithProviders {
|
||||||
return {
|
return {
|
||||||
ngModule: GreetingModule,
|
ngModule: GreetingModule,
|
||||||
providers: [
|
providers: [
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
import { browser, element, by } from 'protractor';
|
|
||||||
|
|
||||||
describe('Router basic tutorial e2e tests', () => {
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
browser.get('');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display Angular Router Sample', () => {
|
|
||||||
expect(element(by.css('h1')).getText()).toBe('Angular Router Sample');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display Crisis Center button', () => {
|
|
||||||
expect(element.all(by.css('a')).get(0).getText()).toBe('Crisis Center');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display Heroes button', () => {
|
|
||||||
expect(element.all(by.css('a')).get(1).getText()).toBe('Heroes');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should display HEROES', () => {
|
|
||||||
expect(element(by.css('h3')).getText()).toBe('HEROES');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should change to display crisis list component', async () => {
|
|
||||||
const crisisButton = element.all(by.css('a')).get(0);
|
|
||||||
await crisisButton.click();
|
|
||||||
expect(element(by.css('h3')).getText()).toBe('CRISIS CENTER');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should change to display heroes component', async () => {
|
|
||||||
const heroesButton = element.all(by.css('a')).get(1);
|
|
||||||
await heroesButton.click();
|
|
||||||
expect(element(by.css('h3')).getText()).toBe('HEROES');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should use wildcard route', async () => {
|
|
||||||
browser.get('/fake-page');
|
|
||||||
expect(browser.getCurrentUrl()).toContain('fake-page');
|
|
||||||
expect(element(by.css('h2')).getText()).toBe('Page Not Found');
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,34 +0,0 @@
|
|||||||
.button {
|
|
||||||
box-shadow: inset 0px 1px 0px 0px #ffffff;
|
|
||||||
background: linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
|
|
||||||
background-color: #ffffff;
|
|
||||||
border-radius: 6px;
|
|
||||||
border: 1px solid #dcdcdc;
|
|
||||||
display: inline-block;
|
|
||||||
cursor: pointer;
|
|
||||||
color: #666666;
|
|
||||||
font-family: Arial;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 6px 24px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-shadow: 0px 1px 0px #ffffff;
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
.activebutton {
|
|
||||||
box-shadow: inset 0px 1px 0px 0px #dcecfb;
|
|
||||||
background: linear-gradient(to bottom, #bddbfa 5%, #80b5ea 100%);
|
|
||||||
background-color: #bddbfa;
|
|
||||||
border-radius: 6px;
|
|
||||||
border: 1px solid #84bbf3;
|
|
||||||
display: inline-block;
|
|
||||||
cursor: pointer;
|
|
||||||
color: #ffffff;
|
|
||||||
font-family: Arial;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 6px 24px;
|
|
||||||
text-decoration: none;
|
|
||||||
text-shadow: 0px 1px 0px #528ecc;
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
<!-- #docplaster -->
|
|
||||||
<!-- #docregion setup -->
|
|
||||||
<h1>Angular Router Sample</h1>
|
|
||||||
<!-- #enddocregion setup-->
|
|
||||||
<!-- #docregion routeractivelink -->
|
|
||||||
<nav>
|
|
||||||
<a class="button" routerLink="/crisis-list" routerLinkActive="activebutton">Crisis Center</a> |
|
|
||||||
<a class="button" routerLink="/heroes-list" routerLinkActive="activebutton">Heroes</a>
|
|
||||||
</nav>
|
|
||||||
<!-- #enddocregion routeractivelink-->
|
|
||||||
<!-- #docregion router-outlet -->
|
|
||||||
<router-outlet></router-outlet>
|
|
||||||
<!-- #enddocregion router-outlet -->
|
|
||||||
|
|
||||||
<div style="display: none;">
|
|
||||||
<!-- This HTML represents the initial state for the tutorial. It is not intended to appear in the app. -->
|
|
||||||
<!-- #docregion setup, components -->
|
|
||||||
<app-crisis-list></app-crisis-list>
|
|
||||||
<app-heroes-list></app-heroes-list>
|
|
||||||
<!-- #enddocregion setup, components -->
|
|
||||||
|
|
||||||
<!-- This HTML snippet is for when the user first adds the routerlink navigation. -->
|
|
||||||
<!-- #docregion nav -->
|
|
||||||
<nav>
|
|
||||||
<a class="button" routerLink="/crisis-list">Crisis Center</a> |
|
|
||||||
<a class="button" routerLink="/heroes-list">Heroes</a>
|
|
||||||
</nav>
|
|
||||||
<!-- #enddocregion nav-->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
@ -1,10 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-root',
|
|
||||||
templateUrl: './app.component.html',
|
|
||||||
styleUrls: ['./app.component.css']
|
|
||||||
})
|
|
||||||
export class AppComponent {
|
|
||||||
title = 'angular-router-sample';
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
// #docplaster
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
// #docregion router-import
|
|
||||||
import { RouterModule } from '@angular/router';
|
|
||||||
// #enddocregion router-import
|
|
||||||
import { AppComponent } from './app.component';
|
|
||||||
import { CrisisListComponent } from './crisis-list/crisis-list.component';
|
|
||||||
import { HeroesListComponent } from './heroes-list/heroes-list.component';
|
|
||||||
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [
|
|
||||||
AppComponent,
|
|
||||||
CrisisListComponent,
|
|
||||||
HeroesListComponent,
|
|
||||||
PageNotFoundComponent
|
|
||||||
],
|
|
||||||
// #docplaster
|
|
||||||
// #docregion import-basic, import-redirect, import-wildcard
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
RouterModule.forRoot([
|
|
||||||
{path: 'crisis-list', component: CrisisListComponent},
|
|
||||||
{path: 'heroes-list', component: HeroesListComponent},
|
|
||||||
// #enddocregion import-basic
|
|
||||||
{path: '', redirectTo: '/heroes-list', pathMatch: 'full'},
|
|
||||||
// #enddocregion import-redirect
|
|
||||||
{path: '**', component: PageNotFoundComponent}
|
|
||||||
// #enddocregion import-wildcard
|
|
||||||
// #docregion import-basic, import-redirect, import-wildcard
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
// #enddocregion import-basic, import-redirect, import-wildcard
|
|
||||||
providers: [],
|
|
||||||
bootstrap: [AppComponent]
|
|
||||||
})
|
|
||||||
export class AppModule { }
|
|
@ -1,2 +0,0 @@
|
|||||||
<h3>CRISIS CENTER</h3>
|
|
||||||
<p>Get your crisis here</p>
|
|
@ -1,10 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-crisis-list',
|
|
||||||
templateUrl: './crisis-list.component.html',
|
|
||||||
styleUrls: ['./crisis-list.component.css']
|
|
||||||
})
|
|
||||||
export class CrisisListComponent {
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<h3>HEROES</h3>
|
|
||||||
<p>Get your heroes here</p>
|
|
@ -1,10 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-heroes-list',
|
|
||||||
templateUrl: './heroes-list.component.html',
|
|
||||||
styleUrls: ['./heroes-list.component.css']
|
|
||||||
})
|
|
||||||
export class HeroesListComponent {
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
<h2>Page Not Found</h2>
|
|
||||||
<p>We couldn't find that page! Not even with x-ray vision.</p>
|
|
@ -1,10 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-page-not-found',
|
|
||||||
templateUrl: './page-not-found.component.html',
|
|
||||||
styleUrls: ['./page-not-found.component.css']
|
|
||||||
})
|
|
||||||
export class PageNotFoundComponent {
|
|
||||||
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Angular Router Sample</title>
|
|
||||||
<base href="/">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<app-root></app-root>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||||||
import { enableProdMode } from '@angular/core';
|
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
|
||||||
import { environment } from './environments/environment';
|
|
||||||
|
|
||||||
if (environment.production) {
|
|
||||||
enableProdMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
|
||||||
.catch(err => console.error(err));
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"description": "Router",
|
|
||||||
"files":[
|
|
||||||
"!**/*.d.ts",
|
|
||||||
"!**/*.js",
|
|
||||||
"!**/*.[0-9].*"
|
|
||||||
],
|
|
||||||
"tags": ["router-tutorial"]
|
|
||||||
}
|
|
@ -23,7 +23,7 @@ to provide semantic meaning where it might otherwise be missing.
|
|||||||
Use [attribute binding](guide/template-syntax#attribute-binding) template syntax to control the values of accessibility-related attributes.
|
Use [attribute binding](guide/template-syntax#attribute-binding) template syntax to control the values of accessibility-related attributes.
|
||||||
|
|
||||||
When binding to ARIA attributes in Angular, you must use the `attr.` prefix, as the ARIA
|
When binding to ARIA attributes in Angular, you must use the `attr.` prefix, as the ARIA
|
||||||
specification depends specifically on HTML attributes rather than properties on DOM elements.
|
specification depends specifically on HTML attributes rather than properties of DOM elements.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<!-- Use attr. when binding to an ARIA attribute -->
|
<!-- Use attr. when binding to an ARIA attribute -->
|
||||||
@ -44,7 +44,7 @@ NOTE:
|
|||||||
|
|
||||||
By convention, HTML attributes use lowercase names (`tabindex`), while properties use camelCase names (`tabIndex`).
|
By convention, HTML attributes use lowercase names (`tabindex`), while properties use camelCase names (`tabIndex`).
|
||||||
|
|
||||||
See the [Template Syntax](https://angular.io/guide/template-syntax#html-attribute-vs-dom-property) guide for more background on the difference between attributes and properties.
|
See the [Template Syntax](guide/template-syntax#html-attribute-vs-dom-property) guide for more background on the difference between attributes and properties.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ This guide explains how to specify metadata and apply available compiler options
|
|||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
<a href="https://www.youtube.com/watch?v=kW9cJsvcsGo">Watch compiler author Tobias Bosch explain the Angular compiler</a> at AngularConnect 2016.
|
<a href="https://www.youtube.com/watch?v=anphffaCZrQ">Watch Alex Rickabaugh explain the Angular compiler</a> at AngularConnect 2019.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -43,33 +43,13 @@ Here are some reasons you might want to use AOT.
|
|||||||
|
|
||||||
Angular offers two ways to compile your application:
|
Angular offers two ways to compile your application:
|
||||||
|
|
||||||
* **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime.
|
* **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime. This was the default until Angular 8.
|
||||||
* **_Ahead-of-Time_ (AOT)**, which compiles your app at build time.
|
* **_Ahead-of-Time_ (AOT)**, which compiles your app and libraries at build time. This is the default since Angular 9.
|
||||||
|
|
||||||
JIT compilation is the default when you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands:
|
When you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands, the type of compilation (JIT or AOT) depends on the value of the `aot` property in your build configuration specified in `angular.json`. By default, `aot` is set to `true` for new CLI apps.
|
||||||
|
|
||||||
<code-example language="sh" class="code-shell">
|
|
||||||
ng build
|
|
||||||
ng serve
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
{@a compile}
|
|
||||||
|
|
||||||
For AOT compilation, include the `--aot` option with the `ng build` or `ng serve` command:
|
|
||||||
|
|
||||||
<code-example language="sh" class="code-shell">
|
|
||||||
ng build --aot
|
|
||||||
ng serve --aot
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
The `ng build` command with the `--prod` meta-flag (`ng build --prod`) compiles with AOT by default.
|
|
||||||
|
|
||||||
See the [CLI command reference](cli) and [Building and serving Angular apps](guide/build) for more information.
|
See the [CLI command reference](cli) and [Building and serving Angular apps](guide/build) for more information.
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## How AOT works
|
## How AOT works
|
||||||
|
|
||||||
The Angular AOT compiler extracts **metadata** to interpret the parts of the application that Angular is supposed to manage.
|
The Angular AOT compiler extracts **metadata** to interpret the parts of the application that Angular is supposed to manage.
|
||||||
@ -562,6 +542,7 @@ It does not, however, rewrite the `.d.ts` file, so TypeScript doesn't recognize
|
|||||||
|
|
||||||
|
|
||||||
{@a binding-expression-validation}
|
{@a binding-expression-validation}
|
||||||
|
|
||||||
## Phase 3: Template type checking
|
## Phase 3: Template type checking
|
||||||
|
|
||||||
One of the Angular compiler's most helpful features is the ability to type-check expressions within templates, and catch any errors before they cause crashes at runtime.
|
One of the Angular compiler's most helpful features is the ability to type-check expressions within templates, and catch any errors before they cause crashes at runtime.
|
||||||
@ -579,7 +560,7 @@ As a result, templates that previously compiled under View Engine can fail type
|
|||||||
This stricter type checking is not enabled by default in version 9, but can be enabled by setting the `strictTemplates` configuration option.
|
This stricter type checking is not enabled by default in version 9, but can be enabled by setting the `strictTemplates` configuration option.
|
||||||
We do expect to make strict type checking the default in the future.
|
We do expect to make strict type checking the default in the future.
|
||||||
|
|
||||||
<!-- For more information about type-checking options, and about improvements to template type checking in version 9 and above, see [Template type checking](guide/template-type-checking). -->
|
For more information about type-checking options, and about improvements to template type checking in version 9 and above, see [Template type checking](guide/template-typecheck).
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -638,16 +619,7 @@ For example, to avoid `Object is possibly 'undefined'` error in the template abo
|
|||||||
|
|
||||||
Using `*ngIf` allows the TypeScript compiler to infer that the `person` used in the binding expression will never be `undefined`.
|
Using `*ngIf` allows the TypeScript compiler to infer that the `person` used in the binding expression will never be `undefined`.
|
||||||
|
|
||||||
#### Custom `ngIf` like directives
|
For more information about input type narrowing, see [Input setter coercion](guide/template-typecheck#input-setter-coercion) and [Improving template type checking for custom directives](guide/structural-directives#directive-type-checks).
|
||||||
|
|
||||||
Directives that behave like `*ngIf` can declare that they want the same treatment by including a static member marker that is a signal to the template compiler to treat them like `*ngIf`. This static member for `*ngIf` is:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
public static ngIfUseIfTypeGuard: void;
|
|
||||||
```
|
|
||||||
|
|
||||||
This declares that the input property `ngIf` of the `NgIf` directive should be treated as a guard to the use of its template, implying that the template will only be instantiated if the `ngIf` input property is true.
|
|
||||||
|
|
||||||
|
|
||||||
### Non-null type assertion operator
|
### Non-null type assertion operator
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ For some platforms and applications, you might also want to use the PWA (Progres
|
|||||||
|
|
||||||
## Support for the development cycle
|
## Support for the development cycle
|
||||||
|
|
||||||
The **Development Workflow** section describes the tools and processes you use to compile, test, and and deploy Angular applications.
|
The **Development Workflow** section describes the tools and processes you use to compile, test, and deploy Angular applications.
|
||||||
|
|
||||||
* [CLI Command Reference](cli): The Angular CLI is a command-line tool that you use to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
* [CLI Command Reference](cli): The Angular CLI is a command-line tool that you use to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
||||||
|
|
||||||
|
@ -53,8 +53,7 @@ Angular supports most recent browsers. This includes the following specific vers
|
|||||||
IE
|
IE
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div> 11, 10*, 9* ("compatibility view" mode not supported) </div>
|
11, 10, 9 ("compatibility view" mode not supported)
|
||||||
<div>*deprecated in v10, see the <a href="/guide/deprecations#ie-9-10">deprecations guide</a>.</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -55,7 +55,7 @@ This method is for development and testing only, and is not a supported or secur
|
|||||||
|
|
||||||
### Automatic deployment with the CLI
|
### Automatic deployment with the CLI
|
||||||
|
|
||||||
The Angular CLI command `ng deploy` (introduced in version 8.3.0) executes the `deploy` [CLI builder](https://angular.io/guide/cli-builder) associated with your project. A number of third-party builders implement deployment capabilities to different platforms. You can add any of them to your project by running `ng add [package name]`.
|
The Angular CLI command `ng deploy` (introduced in version 8.3.0) executes the `deploy` [CLI builder](guide/cli-builder) associated with your project. A number of third-party builders implement deployment capabilities to different platforms. You can add any of them to your project by running `ng add [package name]`.
|
||||||
|
|
||||||
When you add a package with deployment capability, it'll automatically update your workspace configuration (`angular.json` file) with a `deploy` section for the selected project. You can then use the `ng deploy` command to deploy that project.
|
When you add a package with deployment capability, it'll automatically update your workspace configuration (`angular.json` file) with a `deploy` section for the selected project. You can then use the `ng deploy` command to deploy that project.
|
||||||
|
|
||||||
|
@ -35,23 +35,24 @@ v9 - v12
|
|||||||
|
|
||||||
| Area | API or Feature | May be removed in |
|
| Area | API or Feature | May be removed in |
|
||||||
| ----------------------------- | --------------------------------------------------------------------------- | ----------------- |
|
| ----------------------------- | --------------------------------------------------------------------------- | ----------------- |
|
||||||
| `@angular/common` | [`ReflectiveInjector`](#reflectiveinjector) | <!--v8--> v11 |
|
| `@angular/common` | [`ReflectiveInjector`](#reflectiveinjector) | <!--v8--> v10 |
|
||||||
| `@angular/common` | [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation) | <!--v9--> v11 |
|
| `@angular/common` | [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation) | <!--v9--> v11 |
|
||||||
| `@angular/core` | [`CollectionChangeRecord`](#core) | <!--v7--> v11 |
|
| `@angular/core` | [`CollectionChangeRecord`](#core) | <!--v7--> v10 |
|
||||||
| `@angular/core` | [`DefaultIterableDiffer`](#core) | <!--v7--> v11 |
|
| `@angular/core` | [`DefaultIterableDiffer`](#core) | <!--v7--> v10 |
|
||||||
| `@angular/core` | [`ReflectiveKey`](#core) | <!--v8--> v11 |
|
| `@angular/core` | [`ReflectiveKey`](#core) | <!--v8--> v10 |
|
||||||
| `@angular/core` | [`RenderComponentType`](#core) | <!--v7--> v11 |
|
| `@angular/core` | [`RenderComponentType`](#core) | <!--v7--> v10 |
|
||||||
| `@angular/core` | [`ViewEncapsulation.Native`](#core) | <!--v6--> v11 |
|
| `@angular/core` | [`ViewEncapsulation.Native`](#core) | <!--v6--> v10 |
|
||||||
| `@angular/core` | [`WrappedValue`](#core) | <!--v10--> v12 |
|
| `@angular/core` | [`ModuleWithProviders` without a generic](#moduleWithProviders) | <!--v9--> v10 |
|
||||||
| `@angular/forms` | [`ngModel` with reactive forms](#ngmodel-reactive) | <!--v6--> v11 |
|
| `@angular/core` | [Undecorated base classes that use Angular features](#undecorated-base-classes) | <!--v9--> v10 |
|
||||||
| `@angular/router` | [`preserveQueryParams`](#router) | <!--v7--> v11 |
|
| `@angular/forms` | [`ngModel` with reactive forms](#ngmodel-reactive) | <!--v6--> v10 |
|
||||||
| `@angular/upgrade` | [`@angular/upgrade`](#upgrade) | <!--v8--> v11 |
|
| `@angular/router` | [`preserveQueryParams`](#router) | <!--v7--> v10 |
|
||||||
| `@angular/upgrade` | [`getAngularLib`](#upgrade-static) | <!--v8--> v11 |
|
| `@angular/upgrade` | [`@angular/upgrade`](#upgrade) | <!--v8--> v10 |
|
||||||
| `@angular/upgrade` | [`setAngularLib`](#upgrade-static) | <!--v8--> v11 |
|
| `@angular/upgrade` | [`getAngularLib`](#upgrade-static) | <!--v8--> v10 |
|
||||||
| `@angular/platform-webworker` | [All entry points](api/platform-webworker) | <!--v8--> v11 |
|
| `@angular/upgrade` | [`setAngularLib`](#upgrade-static) | <!--v8--> v10 |
|
||||||
| template syntax | [`<template`>](#template-tag) | <!--v7--> v11 |
|
| `@angular/platform-webworker` | [All entry points](api/platform-webworker) | <!--v8--> v10 |
|
||||||
| polyfills | [reflect-metadata](#reflect-metadata) | <!--v8--> v11 |
|
| template syntax | [`<template`>](#template-tag) | <!--v7--> v10 |
|
||||||
| npm package format | [`esm5` and `fesm5` entry-points in @angular/* npm packages](guide/deprecations#esm5-fesm5) | <!-- v9 --> v11 |
|
| polyfills | [reflect-metadata](#reflect-metadata) | <!--v8--> v10 |
|
||||||
|
| npm package format | [`esm5` and `fesm5` entry-points in @angular/* npm packages](guide/deprecations#esm5-fesm5) | <!-- v9 --> v10 |
|
||||||
| `@angular/core` | [`defineInjectable`](#core) | <!--v8--> v11 |
|
| `@angular/core` | [`defineInjectable`](#core) | <!--v8--> v11 |
|
||||||
| `@angular/core` | [`entryComponents`](api/core/NgModule#entryComponents) | <!--v9--> v11 |
|
| `@angular/core` | [`entryComponents`](api/core/NgModule#entryComponents) | <!--v9--> v11 |
|
||||||
| `@angular/core` | [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | <!--v9--> v11 |
|
| `@angular/core` | [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | <!--v9--> v11 |
|
||||||
@ -59,7 +60,6 @@ v9 - v12
|
|||||||
| `@angular/core/testing` | [`TestBed.get`](#testing) | <!--v9--> v12 |
|
| `@angular/core/testing` | [`TestBed.get`](#testing) | <!--v9--> v12 |
|
||||||
| `@angular/router` | [`ActivatedRoute` params and `queryParams` properties](#activatedroute-props) | unspecified |
|
| `@angular/router` | [`ActivatedRoute` params and `queryParams` properties](#activatedroute-props) | unspecified |
|
||||||
| template syntax | [`/deep/`, `>>>`, and `::ng-deep`](#deep-component-style-selector) | <!--v7--> unspecified |
|
| template syntax | [`/deep/`, `>>>`, and `::ng-deep`](#deep-component-style-selector) | <!--v7--> unspecified |
|
||||||
| browser support | [`IE 9 and 10`](#ie-9-10) | <!--v10--> v11 |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +96,9 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
|
|||||||
| [`defineInjectable`](api/core/defineInjectable) | `ɵɵdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. |
|
| [`defineInjectable`](api/core/defineInjectable) | `ɵɵdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. |
|
||||||
| [`entryComponents`](api/core/NgModule#entryComponents) | none | v9 | See [`entryComponents`](#entryComponents) |
|
| [`entryComponents`](api/core/NgModule#entryComponents) | none | v9 | See [`entryComponents`](#entryComponents) |
|
||||||
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | v9 | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](#entryComponents) |
|
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | v9 | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](#entryComponents) |
|
||||||
| [`WrappedValue`](api/core/WrappedValue) | none | v10 | See [removing `WrappedValue`](#wrapped-value) |
|
| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | v9 | See [`ModuleWithProviders` section](#moduleWithProviders) |
|
||||||
|
| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | v9 | See [undecorated base classes section](#undecorated-base-classes) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -374,6 +376,60 @@ However, in practice, Angular simply ignores two-way bindings to template variab
|
|||||||
<option *ngFor="let optionName of options" [value]="optionName"></option>
|
<option *ngFor="let optionName of options" [value]="optionName"></option>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{@a undecorated-base-classes}
|
||||||
|
### Undecorated base classes using Angular features
|
||||||
|
|
||||||
|
As of version 9, it's deprecated to have an undecorated base class that:
|
||||||
|
|
||||||
|
- uses Angular features
|
||||||
|
- is extended by a directive or component
|
||||||
|
|
||||||
|
Angular lifecycle hooks or any of the following Angular field decorators are considered Angular features:
|
||||||
|
|
||||||
|
- `@Input()`
|
||||||
|
- `@Output()`
|
||||||
|
- `@HostBinding()`
|
||||||
|
- `@HostListener()`
|
||||||
|
- `@ViewChild()` / `@ViewChildren()`
|
||||||
|
- `@ContentChild()` / `@ContentChildren()`
|
||||||
|
|
||||||
|
For example, the following case is deprecated because the base class uses `@Input()` and does not have a class-level decorator:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
class Base {
|
||||||
|
@Input()
|
||||||
|
foo: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Directive(...)
|
||||||
|
class Dir extends Base {
|
||||||
|
ngOnChanges(): void {
|
||||||
|
// notified when bindings to [foo] are updated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In a future version of Angular, this code will start to throw an error.
|
||||||
|
To fix this example, add a selectorless `@Directive()` decorator to the base class:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
@Directive()
|
||||||
|
class Base {
|
||||||
|
@Input()
|
||||||
|
foo: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Directive(...)
|
||||||
|
class Dir extends Base {
|
||||||
|
ngOnChanges(): void {
|
||||||
|
// notified when bindings to [foo] are updated
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
In version 9, the CLI has an automated migration that will update your code for you when `ng update` is run.
|
||||||
|
See [the dedicated migration guide](guide/migration-undecorated-classes) for more information about the change and more examples.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{@a binding-to-innertext}
|
{@a binding-to-innertext}
|
||||||
@ -458,54 +514,13 @@ export class MyModule {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
{@a ie-9-10}
|
|
||||||
### IE 9 and 10 support
|
|
||||||
|
|
||||||
Support for IE 9 and 10 has been deprecated and will be removed in a future version.
|
|
||||||
Supporting outdated browsers like these increases bundle size, code complexity, and test load, and also requires time and effort that could be spent on improvements to the framework.
|
|
||||||
For example, fixing issues can be more difficult, as a straightforward fix for modern browsers could break old ones that have quirks due to not receiving updates from vendors.
|
|
||||||
|
|
||||||
The final decision was made on three key points:
|
|
||||||
* __Vendor support__: Microsoft dropped support of IE 9 and 10 on 1/12/16, meaning they no longer provide security updates or technical support.
|
|
||||||
* __Usage statistics__: We looked at usage trends for IE 9 and 10 from various sources and all indicated that usage percentages were extremely small (fractions of 1%).
|
|
||||||
* __Feedback from partners__: We also reached out to some of our Angular customers and none expressed concern about dropping IE 9 and 10 support.
|
|
||||||
|
|
||||||
|
|
||||||
{@a wrapped-value}
|
|
||||||
### `WrappedValue`
|
|
||||||
|
|
||||||
The purpose of `WrappedValue` is to allow the same object instance to be treated as different for the purposes of change detection.
|
|
||||||
It is commonly used with the `async` pipe in the case where the `Observable` produces the same instance of the value.
|
|
||||||
|
|
||||||
Given that this use case is relatively rare and special handling impacts application performance, we have deprecated it in v10.
|
|
||||||
No replacement is planned for this deprecation.
|
|
||||||
|
|
||||||
If you rely on the behavior that the same object instance should cause change detection, you have two options:
|
|
||||||
- Clone the resulting value so that it has a new identity.
|
|
||||||
- Explicitly call [`ChangeDetectorRef.detectChanges()`](api/core/ChangeDetectorRef#detectchanges) to force the update.
|
|
||||||
|
|
||||||
{@a removed}
|
|
||||||
## Removed APIs
|
|
||||||
|
|
||||||
The following APIs have been removed starting with version 10.0.0*:
|
|
||||||
|
|
||||||
| Package | API | Replacement | Notes |
|
|
||||||
| ---------------- | -------------- | ----------- | ----- |
|
|
||||||
| `@angular/core` | Undecorated base classes that use Angular features | Add Angular decorator | See [migration guide](guide/migration-undecorated-classes) for more info |
|
|
||||||
| `@angular/core` | `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [migration guide](guide/migration-module-with-providers) for more info |
|
|
||||||
| `@angular/core` | Style Sanitization | no action needed | See [style sanitization API removal](#style-sanitization) for more info
|
|
||||||
|
|
||||||
*To see APIs removed in version 9, check out this guide on the [version 9 docs site](https://v9.angular.io/guide/deprecations#removed).
|
|
||||||
|
|
||||||
|
|
||||||
{@a esm5-fesm5}
|
{@a esm5-fesm5}
|
||||||
### `esm5` and `fesm5` code formats in @angular/* npm packages
|
### `esm5` and `fesm5` code formats in @angular/* npm packages
|
||||||
|
|
||||||
As of Angular v8, the CLI primarily consumes the `fesm2015` variant of the code distributed via `@angular/*` npm packages.
|
As of Angular v8, the CLI primarily consumes the `fesm2015` variant of the code distributed via `@angular/*` npm packages.
|
||||||
This renders the `esm5` and `fesm5` distributions obsolete and unnecessary, adding bloat to the package size and slowing down npm installations.
|
This renders the `esm5` and `fesm5` distributions obsolete and unnecessary, adding bloat to the package size and slowing down npm installations.
|
||||||
|
|
||||||
This removal has no impact on CLI users, unless they modified their build configuration to explicitly consume these code distributions.
|
The future removal of this distribution will have no impact on CLI users, unless they modified their build configuration to explicitly consume these code distributions.
|
||||||
|
|
||||||
Any application still relying on the `esm5` and `fesm5` as the input to its build system will need to ensure that the build pipeline is capable of accepting JavaScript code conforming to ECMAScript 2015 (ES2015) language specification.
|
Any application still relying on the `esm5` and `fesm5` as the input to its build system will need to ensure that the build pipeline is capable of accepting JavaScript code conforming to ECMAScript 2015 (ES2015) language specification.
|
||||||
|
|
||||||
@ -513,7 +528,7 @@ Note that this change doesn't make existing libraries distributed in this format
|
|||||||
The CLI will fall back and consume libraries in less desirable formats if others are not available.
|
The CLI will fall back and consume libraries in less desirable formats if others are not available.
|
||||||
However, we do recommend that libraries ship their code in ES2015 format in order to make builds faster and build output smaller.
|
However, we do recommend that libraries ship their code in ES2015 format in order to make builds faster and build output smaller.
|
||||||
|
|
||||||
In practical terms, the `package.json` of all `@angular` packages has changed in the following way:
|
In practical terms, the `package.json` of all `@angular` packages will change in the following way:
|
||||||
|
|
||||||
**Before**:
|
**Before**:
|
||||||
```
|
```
|
||||||
@ -547,29 +562,33 @@ In practical terms, the `package.json` of all `@angular` packages has changed in
|
|||||||
|
|
||||||
For more information about the npm package format, see the [Angular Package Format spec](https://goo.gl/jB3GVv).
|
For more information about the npm package format, see the [Angular Package Format spec](https://goo.gl/jB3GVv).
|
||||||
|
|
||||||
{@a ie-9-10}
|
|
||||||
### IE 9 and 10 support
|
|
||||||
|
|
||||||
Support for IE 9 and 10 has been deprecated and will be removed in a future version.
|
|
||||||
Supporting outdated browsers like these increases bundle size, code complexity, and test load, and also requires time and effort that could be spent on improvements to the framework.
|
|
||||||
For example, fixing issues can be more difficult, as a straightforward fix for modern browsers could break old ones that have quirks due to not receiving updates from vendors.
|
|
||||||
|
|
||||||
The final decision was made on three key points:
|
|
||||||
* __Vendor support__: Microsoft dropped support of IE 9 and 10 on 1/12/16, meaning they no longer provide security updates or technical support.
|
|
||||||
* __Usage statistics__: We looked at usage trends for IE 9 and 10 from various sources and all indicated that usage percentages were extremely small (fractions of 1%).
|
|
||||||
* __Feedback from partners__: We also reached out to some of our Angular customers and none expressed concern about dropping IE 9 and 10 support.
|
|
||||||
|
|
||||||
{@a removed}
|
{@a removed}
|
||||||
## Removed APIs
|
## Removed APIs
|
||||||
|
|
||||||
The following APIs have been removed starting with version 10.0.0*:
|
The following APIs have been removed starting with version 9.0.0*:
|
||||||
|
|
||||||
| Package | API | Replacement | Notes |
|
| Package | API | Replacement | Notes |
|
||||||
| ---------------- | -------------- | ----------- | ----- |
|
| ---------------- | -------------- | ----------- | ----- |
|
||||||
| `@angular/core` | Undecorated base classes that use Angular features | Add Angular decorator | See [migration guide](guide/migration-undecorated-classes) for more info |
|
| `@angular/core` | [`Renderer`](https://v8.angular.io/api/core/Renderer) | [`Renderer2`](https://angular.io/api/core/Renderer2) | [Migration guide](guide/migration-renderer) |
|
||||||
| `@angular/core` | `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [migration guide](guide/migration-module-with-providers) for more info |
|
| `@angular/core` | [`RootRenderer`](https://v8.angular.io/api/core/RootRenderer) | [`RendererFactory2`](https://angular.io/api/core/RendererFactory2) | none |
|
||||||
|
| `@angular/core` | [`RenderComponentType`](https://v8.angular.io/api/core/RenderComponentType) | [`RendererType2`](https://angular.io/api/core/RendererType2) | none |
|
||||||
|
| `@angular/core` | [`WtfScopeFn`](https://v8.angular.io/api/core/WtfScopeFn) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||||
|
| `@angular/core` | [`wtfCreateScope`](https://v8.angular.io/api/core/wtfCreateScope) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||||
|
| `@angular/core` | [`wtfStartTimeRange`](https://v8.angular.io/api/core/wtfStartTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||||
|
| `@angular/core` | [`wtfEndTimeRange`](https://v8.angular.io/api/core/wtfEndTimeRange) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||||
|
| `@angular/core` | [`wtfLeave`](https://v8.angular.io/api/core/wtfLeave) | none | v8 | See [Web Tracing Framework](#wtf) |
|
||||||
|
| `@angular/common` | `DeprecatedI18NPipesModule` | [`CommonModule`](api/common/CommonModule#pipes) | none |
|
||||||
|
| `@angular/common` | `DeprecatedCurrencyPipe` | [`CurrencyPipe`](api/common/CurrencyPipe) | none |
|
||||||
|
| `@angular/common` | `DeprecatedDatePipe` | [`DatePipe`](api/common/DatePipe) | none |
|
||||||
|
| `@angular/common` | `DeprecatedDecimalPipe` | [`DecimalPipe`](api/common/DecimalPipe) | none |
|
||||||
|
| `@angular/common` | `DeprecatedPercentPipe` | [`PercentPipe`](api/common/PercentPipe) | none |
|
||||||
|
| `@angular/forms` | [`NgFormSelectorWarning`](https://v8.angular.io/api/forms/NgFormSelectorWarning) | none | none |
|
||||||
|
| `@angular/forms` | `ngForm` element selector | `ng-form` element selector | none |
|
||||||
|
| `@angular/service-worker` | `versionedFiles` | `files` | In the service worker configuration file `ngsw-config.json`, replace `versionedFiles` with `files`. See [Service Worker Configuration](guide/service-worker-config#assetgroups). |
|
||||||
|
|
||||||
*To see APIs removed in version 9, check out this guide on the [version 9 docs site](https://v9.angular.io/guide/deprecations#removed).
|
*To see APIs removed in version 8, check out this guide on the [version 8 docs site](https://v8.angular.io/guide/deprecations#removed).
|
||||||
|
|
||||||
|
|
||||||
<!-- The following anchor is used by redirects from the removed API pages. Do not change or remove. -->
|
<!-- The following anchor is used by redirects from the removed API pages. Do not change or remove. -->
|
||||||
@ -632,7 +651,3 @@ For more information about using `@angular/common/http`, see the [HttpClient gui
|
|||||||
| --------------------- | ------------------------------------------- |
|
| --------------------- | ------------------------------------------- |
|
||||||
| `MockBackend` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
|
| `MockBackend` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
|
||||||
| `MockConnection` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
|
| `MockConnection` | [`HttpTestingController`](/api/common/http/testing/HttpTestingController) |
|
||||||
|
|
||||||
{@a style-sanitization}
|
|
||||||
### Style Sanitization for `[style]` and `[style.prop]` bindings
|
|
||||||
Angular used to sanitize `[style]` and `[style.prop]` bindings to prevent malicious code from being inserted through `javascript:` expressions in CSS `url()` entries. However, most modern browsers no longer support the usage of these expressions, so sanitization was only maintained for the sake of IE 6 and 7. Given that Angular does not support either IE 6 or 7 and sanitization has a performance cost, we will no longer sanitize style bindings as of version 10 of Angular.
|
|
||||||
|
@ -1,42 +1,53 @@
|
|||||||
# Dynamic forms
|
# Building dynamic forms
|
||||||
|
|
||||||
{@a top}
|
Many forms, such as questionaires, can be very similar to one another in format and intent.
|
||||||
|
To make it faster and easier to generate different versions of such a form,
|
||||||
|
you can create a *dynamic form template* based on metadata that describes the business object model.
|
||||||
|
You can then use the template to generate new forms automatically, according to changes in the data model.
|
||||||
|
|
||||||
Building handcrafted forms can be costly and time-consuming,
|
The technique is particularly useful when you have a type of form whose content must
|
||||||
especially if you need a great number of them, they're similar to each other, and they change frequently
|
change frequently to meet rapidly changing business and regulatory requirements.
|
||||||
to meet rapidly changing business and regulatory requirements.
|
A typical use case is a questionaire. You might need to get input from users in different contexts.
|
||||||
|
The format and style of the forms a user sees should remain constant, while the actual questions you need to ask vary with the context.
|
||||||
|
|
||||||
It may be more economical to create the forms dynamically, based on
|
In this tutorial you will build a dynamic form that presents a basic questionaire.
|
||||||
metadata that describes the business object model.
|
You will build an online application for heroes seeking employment.
|
||||||
|
The agency is constantly tinkering with the application process, but by using the dynamic form
|
||||||
|
you can create the new forms on the fly without changing the application code.
|
||||||
|
|
||||||
This cookbook shows you how to use `formGroup` to dynamically
|
The tutorial walks you through the following steps.
|
||||||
render a simple form with different control types and validation.
|
|
||||||
It's a primitive start.
|
|
||||||
It might evolve to support a much richer variety of questions, more graceful rendering, and superior user experience.
|
|
||||||
All such greatness has humble beginnings.
|
|
||||||
|
|
||||||
The example in this cookbook is a dynamic form to build an
|
1. Enable reactive forms for a project.
|
||||||
online application experience for heroes seeking employment.
|
2. Establish a data model to represent form controls.
|
||||||
The agency is constantly tinkering with the application process.
|
3. Populate the model with sample data.
|
||||||
You can create the forms on the fly *without changing the application code*.
|
4. Develop a component to create form controls dynamically.
|
||||||
{@a toc}
|
|
||||||
|
The form you create uses input validation and styling to improve the user experience.
|
||||||
|
It has a Submit button that is only enabled when all user input is valid, and flags invalid input with color coding and error messages.
|
||||||
|
|
||||||
|
The basic version can evolve to support a richer variety of questions, more graceful rendering, and superior user experience.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
See the <live-example name="dynamic-form"></live-example>.
|
See the <live-example name="dynamic-form"></live-example>.
|
||||||
|
|
||||||
{@a bootstrap}
|
</div>
|
||||||
|
|
||||||
## Bootstrap
|
## Prerequisites
|
||||||
|
|
||||||
Start by creating an `NgModule` called `AppModule`.
|
Before doing this tutorial, you should have a basic understanding to the following.
|
||||||
|
|
||||||
This cookbook uses [reactive forms](guide/reactive-forms).
|
* [TypeScript](https://www.typescriptlang.org/docs/home.html "The TypeScript language") and HTML5 programming.
|
||||||
|
|
||||||
Reactive forms belongs to a different `NgModule` called `ReactiveFormsModule`,
|
* Fundamental concepts of [Angular app design](guide/architecture "Introduction to Angular app-design concepts").
|
||||||
so in order to access any reactive forms directives, you have to import
|
|
||||||
`ReactiveFormsModule` from the `@angular/forms` library.
|
|
||||||
|
|
||||||
Bootstrap the `AppModule` in `main.ts`.
|
* Basic knowledge of [reactive forms](guide/reactive-forms "Reactive forms guide").
|
||||||
|
|
||||||
|
## Enable reactive forms for your project
|
||||||
|
|
||||||
|
Dynamic forms are based on reactive forms. To give the application access reactive forms directives, the [root module](guide/bootstrapping "Learn about bootstrapping an app from the root module.") imports `ReactiveFormsModule` from the `@angular/forms` library.
|
||||||
|
|
||||||
|
The following code from the example shows the setup in the root module.
|
||||||
|
|
||||||
<code-tabs>
|
<code-tabs>
|
||||||
|
|
||||||
@ -50,79 +61,56 @@ Bootstrap the `AppModule` in `main.ts`.
|
|||||||
|
|
||||||
</code-tabs>
|
</code-tabs>
|
||||||
|
|
||||||
|
|
||||||
{@a object-model}
|
{@a object-model}
|
||||||
|
|
||||||
## Question model
|
## Create a form object model
|
||||||
|
|
||||||
The next step is to define an object model that can describe all scenarios needed by the form functionality.
|
A dynamic form requires an object model that can describe all scenarios needed by the form functionality.
|
||||||
The hero application process involves a form with a lot of questions.
|
The example hero-application form is a set of questions—that is, each control in the form must ask a question and accept an answer.
|
||||||
The _question_ is the most fundamental object in the model.
|
|
||||||
|
|
||||||
The following `QuestionBase` is a fundamental question class.
|
The data model for this type of form must represent a question.
|
||||||
|
The example includes the `DynamicFormQuestionComponent`, which defines a question as the fundamental object in the model.
|
||||||
|
|
||||||
|
The following `QuestionBase` is a base class for a set of controls that can represent the question and its answer in the form.
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question-base.ts" header="src/app/question-base.ts">
|
<code-example path="dynamic-form/src/app/question-base.ts" header="src/app/question-base.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
### Define control classes
|
||||||
|
|
||||||
|
From this base, the example derives two new classes, `TextboxQuestion` and `DropdownQuestion`,
|
||||||
|
that represent different control types.
|
||||||
|
When you create the form template in the next step, you will instantiate these specific question types in order to render the appropriate controls dynamically.
|
||||||
|
|
||||||
From this base you can derive two new classes in `TextboxQuestion` and `DropdownQuestion`
|
* The `TextboxQuestion` control type presents a question and allows users to enter input.
|
||||||
that represent textbox and dropdown questions.
|
|
||||||
The idea is that the form will be bound to specific question types and render the
|
|
||||||
appropriate controls dynamically.
|
|
||||||
|
|
||||||
`TextboxQuestion` supports multiple HTML5 types such as text, email, and url
|
<code-example path="dynamic-form/src/app/question-textbox.ts" header="src/app/question-textbox.ts"></code-example>
|
||||||
via the `type` property.
|
|
||||||
|
|
||||||
|
The `TextboxQuestion` control type will be represented in a form template using an `<input>` element.
|
||||||
|
The `type` attribute of the element will be defined based on the `type` field specified in the `options` argument (for example `text`, `email`, `url`).
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question-textbox.ts" header="src/app/question-textbox.ts"></code-example>
|
* The `DropdownQuestion` control presents a list of choices in a select box.
|
||||||
|
|
||||||
|
<code-example path="dynamic-form/src/app/question-dropdown.ts" header="src/app/question-dropdown.ts"></code-example>
|
||||||
|
|
||||||
|
### Compose form groups
|
||||||
|
|
||||||
`DropdownQuestion` presents a list of choices in a select box.
|
A dynamic form uses a service to create grouped sets of input controls, based on the form model.
|
||||||
|
The following `QuestionControlService` collects a set of `FormGroup` instances that consume the metadata from the question model. You can specify default values and validation rules.
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question-dropdown.ts" header="src/app/question-dropdown.ts"></code-example>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Next is `QuestionControlService`, a simple service for transforming the questions to a `FormGroup`.
|
|
||||||
In a nutshell, the form group consumes the metadata from the question model and
|
|
||||||
allows you to specify default values and validation rules.
|
|
||||||
|
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question-control.service.ts" header="src/app/question-control.service.ts"></code-example>
|
<code-example path="dynamic-form/src/app/question-control.service.ts" header="src/app/question-control.service.ts"></code-example>
|
||||||
|
|
||||||
{@a form-component}
|
{@a form-component}
|
||||||
|
|
||||||
## Question form components
|
## Compose dynamic form contents
|
||||||
Now that you have defined the complete model you are ready
|
|
||||||
to create components to represent the dynamic form.
|
|
||||||
|
|
||||||
|
The dynamic form itself will be represented by a container component, which you will add in a later step.
|
||||||
|
Each question is represented in the form component's template by an `<app-question>` tag, which matches an instance of `DynamicFormQuestionComponent`.
|
||||||
|
|
||||||
`DynamicFormComponent` is the entry point and the main container for the form.
|
The `DynamicFormQuestionComponent` is responsible for rendering the details of an individual question based on values in the data-bound question object.
|
||||||
|
The form relies on a [`[formGroup]` directive](api/forms/FormGroupDirective "API reference") to connect the template HTML to the underlying control objects.
|
||||||
<code-tabs>
|
The `DynamicFormQuestionComponent` creates form groups and populates them with controls defined in the question model, specifying display and validation rules.
|
||||||
|
|
||||||
<code-pane header="dynamic-form.component.html" path="dynamic-form/src/app/dynamic-form.component.html">
|
|
||||||
|
|
||||||
</code-pane>
|
|
||||||
|
|
||||||
<code-pane header="dynamic-form.component.ts" path="dynamic-form/src/app/dynamic-form.component.ts">
|
|
||||||
|
|
||||||
</code-pane>
|
|
||||||
|
|
||||||
</code-tabs>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
It presents a list of questions, each bound to a `<app-question>` component element.
|
|
||||||
The `<app-question>` tag matches the `DynamicFormQuestionComponent`,
|
|
||||||
the component responsible for rendering the details of each _individual_
|
|
||||||
question based on values in the data-bound question object.
|
|
||||||
|
|
||||||
|
|
||||||
<code-tabs>
|
<code-tabs>
|
||||||
|
|
||||||
@ -136,70 +124,88 @@ question based on values in the data-bound question object.
|
|||||||
|
|
||||||
</code-tabs>
|
</code-tabs>
|
||||||
|
|
||||||
|
The goal of the `DynamicFormQuestionComponent` is to present question types defined in your model.
|
||||||
|
|
||||||
Notice this component can present any type of question in your model.
|
|
||||||
You only have two types of questions at this point but you can imagine many more.
|
You only have two types of questions at this point but you can imagine many more.
|
||||||
The `ngSwitch` determines which type of question to display.
|
The `ngSwitch` statement in the template determines which type of question to display.
|
||||||
|
The switch uses directives with the [`formControlName`](api/forms/FormControlName "FormControlName directive API reference") and [`formGroup`](api/forms/FormGroupDirective "FormGroupDirective API reference") selectors. Both directives are defined in `ReactiveFormsModule`.
|
||||||
|
|
||||||
In both components you're relying on Angular's **formGroup** to connect the template HTML to the
|
|
||||||
underlying control objects, populated from the question model with display and validation rules.
|
|
||||||
|
|
||||||
`formControlName` and `formGroup` are directives defined in
|
|
||||||
`ReactiveFormsModule`. The templates can access these directives
|
|
||||||
directly since you imported `ReactiveFormsModule` from `AppModule`.
|
|
||||||
{@a questionnaire-data}
|
{@a questionnaire-data}
|
||||||
|
|
||||||
## Questionnaire data
|
### Supply data
|
||||||
|
|
||||||
`DynamicFormComponent` expects the list of questions in the form of an array bound to `@Input() questions`.
|
Another service is needed to supply a specific set of questions from which to build an individual form.
|
||||||
|
For this exercise you will create the `QuestionService` to supply this array of questions from the hard-coded sample data.
|
||||||
|
In a real-world app, the service might fetch data from a backend system.
|
||||||
|
The key point, however, is that you control the hero job-application questions entirely through the objects returned from `QuestionService`.
|
||||||
|
To maintain the questionnaire as requirements change, you only need to add, update, and remove objects from the `questions` array.
|
||||||
|
|
||||||
The set of questions you've defined for the job application is returned from the `QuestionService`.
|
|
||||||
In a real app you'd retrieve these questions from storage.
|
|
||||||
|
|
||||||
The key point is that you control the hero job application questions
|
|
||||||
entirely through the objects returned from `QuestionService`.
|
|
||||||
Questionnaire maintenance is a simple matter of adding, updating,
|
|
||||||
and removing objects from the `questions` array.
|
|
||||||
|
|
||||||
|
The `QuestionService` supplies a set of questions in the form of an array bound to `@Input()` questions.
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question.service.ts" header="src/app/question.service.ts">
|
<code-example path="dynamic-form/src/app/question.service.ts" header="src/app/question.service.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
|
||||||
|
{@a dynamic-template}
|
||||||
|
|
||||||
Finally, display an instance of the form in the `AppComponent` shell.
|
## Create a dynamic form template
|
||||||
|
|
||||||
|
The `DynamicFormComponent` component is the entry point and the main container for the form, which is represented using the `<app-dynamic-form>` in a template.
|
||||||
|
|
||||||
|
The `DynamicFormComponent` component presents a list of questions by binding each one to an `<app-question>` element that matches the `DynamicFormQuestionComponent`.
|
||||||
|
|
||||||
|
<code-tabs>
|
||||||
|
|
||||||
|
<code-pane header="dynamic-form.component.html" path="dynamic-form/src/app/dynamic-form.component.html">
|
||||||
|
|
||||||
|
</code-pane>
|
||||||
|
|
||||||
|
<code-pane header="dynamic-form.component.ts" path="dynamic-form/src/app/dynamic-form.component.ts">
|
||||||
|
|
||||||
|
</code-pane>
|
||||||
|
|
||||||
|
</code-tabs>
|
||||||
|
|
||||||
|
### Display the form
|
||||||
|
|
||||||
|
To display an instance of the dynamic form, the `AppComponent` shell template passes the `questions` array returned by the `QuestionService` to the form container component, `<app-dynamic-form>`.
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/app.component.ts" header="app.component.ts">
|
<code-example path="dynamic-form/src/app/app.component.ts" header="app.component.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
{@a dynamic-template}
|
The example provides a model for a job application for heroes, but there are
|
||||||
|
no references to any specific hero question other than the objects returned by `QuestionService`.
|
||||||
## Dynamic Template
|
This separation of model and data allows you to repurpose the components for any type of survey
|
||||||
Although in this example you're modelling a job application for heroes, there are
|
|
||||||
no references to any specific hero question
|
|
||||||
outside the objects returned by `QuestionService`.
|
|
||||||
|
|
||||||
This is very important since it allows you to repurpose the components for any type of survey
|
|
||||||
as long as it's compatible with the *question* object model.
|
as long as it's compatible with the *question* object model.
|
||||||
The key is the dynamic data binding of metadata used to render the form
|
|
||||||
|
### Ensuring valid data
|
||||||
|
|
||||||
|
The form template uses dynamic data binding of metadata to render the form
|
||||||
without making any hardcoded assumptions about specific questions.
|
without making any hardcoded assumptions about specific questions.
|
||||||
In addition to control metadata, you are also adding validation dynamically.
|
It adds both control metadata and validation criteria dynamically.
|
||||||
|
|
||||||
The *Save* button is disabled until the form is in a valid state.
|
To ensure valid input, the *Save* button is disabled until the form is in a valid state.
|
||||||
When the form is valid, you can click *Save* and the app renders the current form values as JSON.
|
When the form is valid, you can click *Save* and the app renders the current form values as JSON.
|
||||||
This proves that any user input is bound back to the data model.
|
|
||||||
Saving and retrieving the data is an exercise for another time.
|
|
||||||
|
|
||||||
|
The following figure shows the final form.
|
||||||
The final form looks like this:
|
|
||||||
|
|
||||||
<div class="lightbox">
|
<div class="lightbox">
|
||||||
<img src="generated/images/guide/dynamic-form/dynamic-form.png" alt="Dynamic-Form">
|
<img src="generated/images/guide/dynamic-form/dynamic-form.png" alt="Dynamic-Form">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
## Next steps
|
||||||
|
|
||||||
[Back to top](guide/dynamic-form#top)
|
* **Different types of forms and control collection**
|
||||||
|
|
||||||
|
This tutorial shows how to build a a questionaire, which is just one kind of dynamic form.
|
||||||
|
The example uses `FormGroup` to collect a set of controls.
|
||||||
|
For an example of a different type of dynamic form, see the section [Creating dynamic forms](guide/reactive-forms#creating-dynamic-forms "Create dynamic forms with arrays") in the Reactive Forms guide.
|
||||||
|
That example also shows how to use `FormArray` instead of `FormGroup` to collect a set of controls.
|
||||||
|
|
||||||
|
* **Validating user input**
|
||||||
|
|
||||||
|
The section [Validating form input](guide/reactive-forms#validating-form-input "Basic input validation") introduces the basics of how input validation works in reactive forms.
|
||||||
|
|
||||||
|
The [Form validation guide](guide/form-validation "Form validation guide") covers the topic in more depth.
|
||||||
|
@ -72,7 +72,7 @@ Files at the top level of `src/` support testing and running your application. S
|
|||||||
| `environments/` | Contains build configuration options for particular target environments. By default there is an unnamed standard development environment and a production ("prod") environment. You can define additional target environment configurations. |
|
| `environments/` | Contains build configuration options for particular target environments. By default there is an unnamed standard development environment and a production ("prod") environment. You can define additional target environment configurations. |
|
||||||
| `favicon.ico` | An icon to use for this application in the bookmark bar. |
|
| `favicon.ico` | An icon to use for this application in the bookmark bar. |
|
||||||
| `index.html` | The main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any `<script>` or` <link>` tags here manually. |
|
| `index.html` | The main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any `<script>` or` <link>` tags here manually. |
|
||||||
| `main.ts` | The main entry point for your application. Compiles the application with the [JIT compiler](https://angular.io/guide/glossary#jit) and bootstraps the application's root module (AppModule) to run in the browser. You can also use the [AOT compiler](https://angular.io/guide/aot-compiler) without changing any code by appending the `--aot` flag to the CLI `build` and `serve` commands. |
|
| `main.ts` | The main entry point for your application. Compiles the application with the [JIT compiler](guide/glossary#jit) and bootstraps the application's root module (AppModule) to run in the browser. You can also use the [AOT compiler](guide/aot-compiler) without changing any code by appending the `--aot` flag to the CLI `build` and `serve` commands. |
|
||||||
| `polyfills.ts` | Provides polyfill scripts for browser support. |
|
| `polyfills.ts` | Provides polyfill scripts for browser support. |
|
||||||
| `styles.sass` | Lists CSS files that supply styles for a project. The extension reflects the style preprocessor you have configured for the project. |
|
| `styles.sass` | Lists CSS files that supply styles for a project. The extension reflects the style preprocessor you have configured for the project. |
|
||||||
| `test.ts` | The main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file. |
|
| `test.ts` | The main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file. |
|
||||||
@ -99,7 +99,7 @@ Project-specific [TypeScript](https://www.typescriptlang.org/) configuration fil
|
|||||||
|
|
||||||
| APPLICATION-SPECIFIC CONFIG FILES | PURPOSE |
|
| APPLICATION-SPECIFIC CONFIG FILES | PURPOSE |
|
||||||
| :--------------------- | :------------------------------------------|
|
| :--------------------- | :------------------------------------------|
|
||||||
| `.browserslistrc` | Configures sharing of target browsers and Node.js versions among various front-end tools. See [Browserslist on GitHub](https://github.com/browserslist/browserslist) for more information. |
|
| `browserslist` | Configures sharing of target browsers and Node.js versions among various front-end tools. See [Browserslist on GitHub](https://github.com/browserslist/browserslist) for more information. |
|
||||||
| `karma.conf.js` | Application-specific [Karma](https://karma-runner.github.io/2.0/config/configuration-file.html) configuration. |
|
| `karma.conf.js` | Application-specific [Karma](https://karma-runner.github.io/2.0/config/configuration-file.html) configuration. |
|
||||||
| `tsconfig.app.json` | Application-specific [TypeScript](https://www.typescriptlang.org/) configuration, including TypeScript and Angular template compiler options. See [TypeScript Configuration](guide/typescript-configuration) and [Angular Compiler Options](guide/angular-compiler-options). |
|
| `tsconfig.app.json` | Application-specific [TypeScript](https://www.typescriptlang.org/) configuration, including TypeScript and Angular template compiler options. See [TypeScript Configuration](guide/typescript-configuration) and [Angular Compiler Options](guide/angular-compiler-options). |
|
||||||
| `tsconfig.spec.json` | [TypeScript](https://www.typescriptlang.org/) configuration for the application tests. See [TypeScript Configuration](guide/typescript-configuration). |
|
| `tsconfig.spec.json` | [TypeScript](https://www.typescriptlang.org/) configuration for the application tests. See [TypeScript Configuration](guide/typescript-configuration). |
|
||||||
@ -165,7 +165,7 @@ my-workspace/
|
|||||||
|
|
||||||
## Library project files
|
## Library project files
|
||||||
|
|
||||||
When you generate a library using the CLI (with a command such as `ng generate library my-lib`), the generated files go into the projects/ folder of the workspace. For more information about creating your own libraries, see [Creating Libraries](https://angular.io/guide/creating-libraries).
|
When you generate a library using the CLI (with a command such as `ng generate library my-lib`), the generated files go into the projects/ folder of the workspace. For more information about creating your own libraries, see [Creating Libraries](guide/creating-libraries).
|
||||||
|
|
||||||
Libraries (unlike applications and their associated e2e projects) have their own `package.json` configuration files.
|
Libraries (unlike applications and their associated e2e projects) have their own `package.json` configuration files.
|
||||||
|
|
||||||
|
@ -1,132 +1,131 @@
|
|||||||
# Form validation
|
# Validating form input
|
||||||
|
|
||||||
Improve overall data quality by validating user input for accuracy and completeness.
|
You can improve overall data quality by validating user input for accuracy and completeness.
|
||||||
|
This page shows how to validate user input from the UI and display useful validation messages,
|
||||||
|
in both reactive and template-driven forms.
|
||||||
|
|
||||||
This page shows how to validate user input in the UI and display useful validation messages
|
**Prerequisites**
|
||||||
using both reactive and template-driven forms. It assumes some basic knowledge of the two
|
|
||||||
forms modules.
|
Before reading about form validation, you should have a basic understanding of the following.
|
||||||
|
|
||||||
|
* [TypeScript](https://www.typescriptlang.org/docs/home.html "The TypeScript language") and HTML5 programming.
|
||||||
|
|
||||||
|
* Fundamental concepts of [Angular app design](guide/architecture "Introduction to Angular app-design concepts").
|
||||||
|
|
||||||
|
* The [two types of forms that Angular supports](guide/forms-overview "Introduction to Angular forms").
|
||||||
|
|
||||||
|
* Basics of either [Template-driven Forms](guide/forms "Template-driven forms guide") or [Reactive Forms](guide/reactive-forms "Reactive forms guide").
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
For the sample app that this page describes, see the <live-example></live-example>.
|
Get the complete example code for the reactive and template-driven forms used here to illustrate form validation.
|
||||||
|
Run the <live-example></live-example>.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
{@a template-driven-validation}
|
||||||
|
|
||||||
If you're new to forms, start by reviewing the [Forms](guide/forms) and
|
## Validating input in template-driven forms
|
||||||
[Reactive Forms](guide/reactive-forms) guides.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
## Template-driven validation
|
|
||||||
|
|
||||||
To add validation to a template-driven form, you add the same validation attributes as you
|
To add validation to a template-driven form, you add the same validation attributes as you
|
||||||
would with [native HTML form validation](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).
|
would with [native HTML form validation](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation).
|
||||||
Angular uses directives to match these attributes with validator functions in the framework.
|
Angular uses directives to match these attributes with validator functions in the framework.
|
||||||
|
|
||||||
Every time the value of a form control changes, Angular runs validation and generates
|
Every time the value of a form control changes, Angular runs validation and generates
|
||||||
either a list of validation errors, which results in an INVALID status, or null, which results in a VALID status.
|
either a list of validation errors that results in an INVALID status, or null, which results in a VALID status.
|
||||||
|
|
||||||
You can then inspect the control's state by exporting `ngModel` to a local template variable.
|
You can then inspect the control's state by exporting `ngModel` to a local template variable.
|
||||||
The following example exports `NgModel` into a variable called `name`:
|
The following example exports `NgModel` into a variable called `name`:
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="name-with-error-msg" header="template/hero-form-template.component.html (name)"></code-example>
|
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="name-with-error-msg" header="template/hero-form-template.component.html (name)"></code-example>
|
||||||
|
|
||||||
|
Notice the following features illustrated by the example.
|
||||||
Note the following:
|
|
||||||
|
|
||||||
* The `<input>` element carries the HTML validation attributes: `required` and `minlength`. It
|
* The `<input>` element carries the HTML validation attributes: `required` and `minlength`. It
|
||||||
also carries a custom validator directive, `forbiddenName`. For more
|
also carries a custom validator directive, `forbiddenName`. For more
|
||||||
information, see [Custom validators](guide/form-validation#custom-validators) section.
|
information, see the [Custom validators](#custom-validators) section.
|
||||||
|
|
||||||
* `#name="ngModel"` exports `NgModel` into a local variable called `name`. `NgModel` mirrors many of the properties of its underlying
|
* `#name="ngModel"` exports `NgModel` into a local variable called `name`. `NgModel` mirrors many of the properties of its underlying
|
||||||
`FormControl` instance, so you can use this in the template to check for control states such as `valid` and `dirty`. For a full list of control properties, see the [AbstractControl](api/forms/AbstractControl)
|
`FormControl` instance, so you can use this in the template to check for control states such as `valid` and `dirty`. For a full list of control properties, see the [AbstractControl](api/forms/AbstractControl)
|
||||||
API reference.
|
API reference.
|
||||||
|
|
||||||
* The `*ngIf` on the `<div>` element reveals a set of nested message `divs`
|
* The `*ngIf` on the `<div>` element reveals a set of nested message `divs`
|
||||||
but only if the `name` is invalid and the control is either `dirty` or `touched`.
|
but only if the `name` is invalid and the control is either `dirty` or `touched`.
|
||||||
|
|
||||||
* Each nested `<div>` can present a custom message for one of the possible validation errors.
|
* Each nested `<div>` can present a custom message for one of the possible validation errors.
|
||||||
There are messages for `required`, `minlength`, and `forbiddenName`.
|
There are messages for `required`, `minlength`, and `forbiddenName`.
|
||||||
|
|
||||||
|
{@a dirty-or-touched}
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
To prevent the validator from displaying errors before the user has a chance to edit the form, you should check for either the `dirty` or `touched` states in a control.
|
||||||
|
|
||||||
|
* When the user changes the value in the watched field, the control is marked as "dirty".
|
||||||
#### Why check _dirty_ and _touched_?
|
* When the user blurs the form control element, the control is marked as "touched".
|
||||||
|
|
||||||
You may not want your application to display errors before the user has a chance to edit the form.
|
|
||||||
The checks for `dirty` and `touched` prevent errors from showing until the user
|
|
||||||
does one of two things: changes the value,
|
|
||||||
turning the control dirty; or blurs the form control element, setting the control to touched.
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Reactive form validation
|
{@a reactive-form-validation}
|
||||||
|
|
||||||
In a reactive form, the source of truth is the component class. Instead of adding validators through attributes in the template, you add validator functions directly to the form control model in the component class. Angular then calls these functions whenever the value of the control changes.
|
## Validating input in reactive forms
|
||||||
|
|
||||||
|
In a reactive form, the source of truth is the component class.
|
||||||
|
Instead of adding validators through attributes in the template, you add validator functions directly to the form control model in the component class.
|
||||||
|
Angular then calls these functions whenever the value of the control changes.
|
||||||
|
|
||||||
### Validator functions
|
### Validator functions
|
||||||
|
|
||||||
There are two types of validator functions: sync validators and async validators.
|
Validator functions can be either synchronous or asynchronous.
|
||||||
|
|
||||||
* **Sync validators**: functions that take a control instance and immediately return either a set of validation errors or `null`. You can pass these in as the second argument when you instantiate a `FormControl`.
|
* **Sync validators**: Synchronous functions that take a control instance and immediately return either a set of validation errors or `null`. You can pass these in as the second argument when you instantiate a `FormControl`.
|
||||||
|
|
||||||
* **Async validators**: functions that take a control instance and return a Promise
|
* **Async validators**: Asynchronous functions that take a control instance and return a Promise
|
||||||
or Observable that later emits a set of validation errors or `null`. You can
|
or Observable that later emits a set of validation errors or `null`. You can
|
||||||
pass these in as the third argument when you instantiate a `FormControl`.
|
pass these in as the third argument when you instantiate a `FormControl`.
|
||||||
|
|
||||||
Note: for performance reasons, Angular only runs async validators if all sync validators pass. Each must complete before errors are set.
|
For performance reasons, Angular only runs async validators if all sync validators pass. Each must complete before errors are set.
|
||||||
|
|
||||||
### Built-in validators
|
### Built-in validator functions
|
||||||
|
|
||||||
You can choose to [write your own validator functions](guide/form-validation#custom-validators), or you can use some of
|
You can choose to [write your own validator functions](#custom-validators), or you can use some of Angular's built-in validators.
|
||||||
Angular's built-in validators.
|
|
||||||
|
|
||||||
The same built-in validators that are available as attributes in template-driven forms, such as `required` and `minlength`, are all available to use as functions from the `Validators` class. For a full list of built-in validators, see the [Validators](api/forms/Validators) API reference.
|
The same built-in validators that are available as attributes in template-driven forms, such as `required` and `minlength`, are all available to use as functions from the `Validators` class.
|
||||||
|
For a full list of built-in validators, see the [Validators](api/forms/Validators) API reference.
|
||||||
|
|
||||||
To update the hero form to be a reactive form, you can use some of the same
|
To update the hero form to be a reactive form, you can use some of the same
|
||||||
built-in validators—this time, in function form. See below:
|
built-in validators—this time, in function form, as in the following example.
|
||||||
|
|
||||||
{@a reactive-component-class}
|
{@a reactive-component-class}
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.1.ts" region="form-group" header="reactive/hero-form-reactive.component.ts (validator functions)"></code-example>
|
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.1.ts" region="form-group" header="reactive/hero-form-reactive.component.ts (validator functions)"></code-example>
|
||||||
|
|
||||||
Note that:
|
In this example, the `name` control sets up two built-in validators—`Validators.required` and `Validators.minLength(4)`—and one custom validator, `forbiddenNameValidator`. (For more details see [custom validators](#custom-validators) below.)
|
||||||
|
|
||||||
* The name control sets up two built-in validators—`Validators.required` and `Validators.minLength(4)`—and one custom validator, `forbiddenNameValidator`. For more details see the [Custom validators](guide/form-validation#custom-validators) section in this guide.
|
All of these validators are synchronous, so they are passed as the second argument. Notice that you can support multiple validators by passing the functions in as an array.
|
||||||
* As these validators are all sync validators, you pass them in as the second argument.
|
|
||||||
* Support multiple validators by passing the functions in as an array.
|
|
||||||
* This example adds a few getter methods. In a reactive form, you can always access any form control through the `get` method on its parent group, but sometimes it's useful to define getters as shorthands
|
|
||||||
for the template.
|
|
||||||
|
|
||||||
|
This example also adds a few getter methods. In a reactive form, you can always access any form control through the `get` method on its parent group, but sometimes it's useful to define getters as shorthand for the template.
|
||||||
|
|
||||||
If you look at the template for the name input again, it is fairly similar to the template-driven example.
|
If you look at the template for the `name` input again, it is fairly similar to the template-driven example.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.html" region="name-with-error-msg" header="reactive/hero-form-reactive.component.html (name with error msg)"></code-example>
|
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.html" region="name-with-error-msg" header="reactive/hero-form-reactive.component.html (name with error msg)"></code-example>
|
||||||
|
|
||||||
Key takeaways:
|
This form differs from the template-driven version in that it no longer exports any directives. Instead, it uses the `name` getter defined in the component class.
|
||||||
|
|
||||||
* The form no longer exports any directives, and instead uses the `name` getter defined in
|
Notice that the `required` attribute is still present in the template. Although it's not necessary for validation, it should be retained to for accessibility purposes.
|
||||||
the component class.
|
|
||||||
* The `required` attribute is still present. While it's not necessary for validation purposes,
|
|
||||||
you may want to keep it in your template for CSS styling or accessibility reasons.
|
|
||||||
|
|
||||||
|
{@a custom-validators}
|
||||||
|
|
||||||
## Custom validators
|
## Defining custom validators
|
||||||
|
|
||||||
Since the built-in validators won't always match the exact use case of your application, sometimes you'll want to create a custom validator.
|
The built-in validators don't always match the exact use case of your application, so you sometimes need to create a custom validator.
|
||||||
|
|
||||||
Consider the `forbiddenNameValidator` function from previous
|
Consider the `forbiddenNameValidator` function from previous [reactive-form examples](#reactive-component-class).
|
||||||
[examples](guide/form-validation#reactive-component-class) in
|
Here's what the definition of that function looks like.
|
||||||
this guide. Here's what the definition of that function looks like:
|
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="custom-validator" header="shared/forbidden-name.directive.ts (forbiddenNameValidator)"></code-example>
|
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="custom-validator" header="shared/forbidden-name.directive.ts (forbiddenNameValidator)"></code-example>
|
||||||
|
|
||||||
The function is actually a factory that takes a regular expression to detect a _specific_ forbidden name and returns a validator function.
|
The function is a factory that takes a regular expression to detect a _specific_ forbidden name and returns a validator function.
|
||||||
|
|
||||||
In this sample, the forbidden name is "bob", so the validator will reject any hero name containing "bob".
|
In this sample, the forbidden name is "bob", so the validator will reject any hero name containing "bob".
|
||||||
Elsewhere it could reject "alice" or any name that the configuring regular expression matches.
|
Elsewhere it could reject "alice" or any name that the configuring regular expression matches.
|
||||||
@ -137,55 +136,57 @@ null if the control value is valid _or_ a validation error object.
|
|||||||
The validation error object typically has a property whose name is the validation key, `'forbiddenName'`,
|
The validation error object typically has a property whose name is the validation key, `'forbiddenName'`,
|
||||||
and whose value is an arbitrary dictionary of values that you could insert into an error message, `{name}`.
|
and whose value is an arbitrary dictionary of values that you could insert into an error message, `{name}`.
|
||||||
|
|
||||||
Custom async validators are similar to sync validators, but they must instead return a Promise or Observable
|
Custom async validators are similar to sync validators, but they must instead return a Promise or observable that later emits null or a validation error object.
|
||||||
that later emits null or a validation error object. In the case of an Observable, the Observable must complete,
|
In the case of an observable, the observable must complete, at which point the form uses the last value emitted for validation.
|
||||||
at which point the form uses the last value emitted for validation.
|
|
||||||
|
|
||||||
### Adding to reactive forms
|
{@a adding-to-reactive-forms}
|
||||||
|
|
||||||
In reactive forms, custom validators are fairly simple to add. All you have to do is pass the function directly
|
### Adding custom validators to reactive forms
|
||||||
to the `FormControl`.
|
|
||||||
|
In reactive forms, add a custom validator by passing the function directly to the `FormControl`.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.1.ts" region="custom-validator" header="reactive/hero-form-reactive.component.ts (validator functions)"></code-example>
|
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.1.ts" region="custom-validator" header="reactive/hero-form-reactive.component.ts (validator functions)"></code-example>
|
||||||
|
|
||||||
### Adding to template-driven forms
|
{@a adding-to-template-driven-forms}
|
||||||
|
|
||||||
In template-driven forms, you don't have direct access to the `FormControl` instance, so you can't pass the
|
### Adding custom validators to template-driven forms
|
||||||
validator in like you can for reactive forms. Instead, you need to add a directive to the template.
|
|
||||||
|
|
||||||
The corresponding `ForbiddenValidatorDirective` serves as a wrapper around the `forbiddenNameValidator`.
|
In template-driven forms, add a directive to the template, where the directive wraps the validator function.
|
||||||
|
For example, the corresponding `ForbiddenValidatorDirective` serves as a wrapper around the `forbiddenNameValidator`.
|
||||||
|
|
||||||
Angular recognizes the directive's role in the validation process because the directive registers itself
|
Angular recognizes the directive's role in the validation process because the directive registers itself with the `NG_VALIDATORS` provider, as shown in the following example.
|
||||||
with the `NG_VALIDATORS` provider, a provider with an extensible collection of validators.
|
`NG_VALIDATORS` is a predefined provider with an extensible collection of validators.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="directive-providers" header="shared/forbidden-name.directive.ts (providers)"></code-example>
|
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="directive-providers" header="shared/forbidden-name.directive.ts (providers)"></code-example>
|
||||||
|
|
||||||
The directive class then implements the `Validator` interface, so that it can easily integrate
|
The directive class then implements the `Validator` interface, so that it can easily integrate
|
||||||
with Angular forms. Here is the rest of the directive to help you get an idea of how it all
|
with Angular forms.
|
||||||
comes together:
|
Here is the rest of the directive to help you get an idea of how it all
|
||||||
|
comes together.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="directive" header="shared/forbidden-name.directive.ts (directive)">
|
<code-example path="form-validation/src/app/shared/forbidden-name.directive.ts" region="directive" header="shared/forbidden-name.directive.ts (directive)">
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
Once the `ForbiddenValidatorDirective` is ready, you can simply add its selector, `appForbiddenName`, to any input element to activate it. For example:
|
Once the `ForbiddenValidatorDirective` is ready, you can add its selector, `appForbiddenName`, to any input element to activate it.
|
||||||
|
For example:
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="name-input" header="template/hero-form-template.component.html (forbidden-name-input)"></code-example>
|
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="name-input" header="template/hero-form-template.component.html (forbidden-name-input)"></code-example>
|
||||||
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
You may have noticed that the custom validation directive is instantiated with `useExisting`
|
Notice that the custom validation directive is instantiated with `useExisting` rather than `useClass`. The registered validator must be _this instance_ of
|
||||||
rather than `useClass`. The registered validator must be _this instance_ of
|
|
||||||
the `ForbiddenValidatorDirective`—the instance in the form with
|
the `ForbiddenValidatorDirective`—the instance in the form with
|
||||||
its `forbiddenName` property bound to “bob". If you were to replace
|
its `forbiddenName` property bound to “bob".
|
||||||
`useExisting` with `useClass`, then you’d be registering a new class instance, one that
|
|
||||||
doesn’t have a `forbiddenName`.
|
If you were to replace `useExisting` with `useClass`, then you’d be registering a new class instance, one that doesn’t have a `forbiddenName`.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Control status CSS classes
|
## Control status CSS classes
|
||||||
|
|
||||||
Like in AngularJS, Angular automatically mirrors many control properties onto the form control element as CSS classes. You can use these classes to style form control elements according to the state of the form. The following classes are currently supported:
|
Angular automatically mirrors many control properties onto the form control element as CSS classes. You can use these classes to style form control elements according to the state of the form.
|
||||||
|
The following classes are currently supported.
|
||||||
|
|
||||||
* `.ng-valid`
|
* `.ng-valid`
|
||||||
* `.ng-invalid`
|
* `.ng-invalid`
|
||||||
@ -195,25 +196,27 @@ Like in AngularJS, Angular automatically mirrors many control properties onto th
|
|||||||
* `.ng-untouched`
|
* `.ng-untouched`
|
||||||
* `.ng-touched`
|
* `.ng-touched`
|
||||||
|
|
||||||
The hero form uses the `.ng-valid` and `.ng-invalid` classes to
|
In the following example, the hero form uses the `.ng-valid` and `.ng-invalid` classes to
|
||||||
set the color of each form control's border.
|
set the color of each form control's border.
|
||||||
|
|
||||||
<code-example path="form-validation/src/assets/forms.css" header="forms.css (status classes)">
|
<code-example path="form-validation/src/assets/forms.css" header="forms.css (status classes)">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
## Cross field validation
|
## Cross-field validation
|
||||||
This section shows how to perform cross field validation. It assumes some basic knowledge of creating custom validators.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
A cross-field validator is a [custom validator](#custom-validators "Read about custom validators") that compares the values of different fields in a form and accepts or rejects them in combination.
|
||||||
|
For example, you might have a form that offers mutually incompatible options, so that if the user can choose A or B, but not both.
|
||||||
|
Some field values might also depend on others; a user might be allowed to choose B only if A is also chosen.
|
||||||
|
|
||||||
If you haven't created custom validators before, start by reviewing the [custom validators section](guide/form-validation#custom-validators).
|
The following cross validation examples show how to do the following:
|
||||||
|
|
||||||
</div>
|
* Validate reactive or template-based form input based on the values of two sibling controls,
|
||||||
|
* Show a descriptive error message after the user interacted with the form and the validation failed.
|
||||||
|
|
||||||
In the following section, we will make sure that our heroes do not reveal their true identities by filling out the Hero Form. We will do that by validating that the hero names and alter egos do not match.
|
The examples use cross-validation to ensure that heroes do not reveal their true identities by filling out the Hero Form. The validators do this by checking that the hero names and alter egos do not match.
|
||||||
|
|
||||||
### Adding to reactive forms
|
### Adding cross-validation to reactive forms
|
||||||
|
|
||||||
The form has the following structure:
|
The form has the following structure:
|
||||||
|
|
||||||
@ -225,7 +228,9 @@ const heroForm = new FormGroup({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Notice that the name and alterEgo are sibling controls. To evaluate both controls in a single custom validator, we should perform the validation in a common ancestor control: the `FormGroup`. That way, we can query the `FormGroup` for the child controls which will allow us to compare their values.
|
Notice that the `name` and `alterEgo` are sibling controls.
|
||||||
|
To evaluate both controls in a single custom validator, you must perform the validation in a common ancestor control: the `FormGroup`.
|
||||||
|
You query the `FormGroup` for its child controls so that you can compare their values.
|
||||||
|
|
||||||
To add a validator to the `FormGroup`, pass the new validator in as the second argument on creation.
|
To add a validator to the `FormGroup`, pass the new validator in as the second argument on creation.
|
||||||
|
|
||||||
@ -237,74 +242,73 @@ const heroForm = new FormGroup({
|
|||||||
}, { validators: identityRevealedValidator });
|
}, { validators: identityRevealedValidator });
|
||||||
```
|
```
|
||||||
|
|
||||||
The validator code is as follows:
|
The validator code is as follows.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/identity-revealed.directive.ts" region="cross-validation-validator" header="shared/identity-revealed.directive.ts"></code-example>
|
<code-example path="form-validation/src/app/shared/identity-revealed.directive.ts" region="cross-validation-validator" header="shared/identity-revealed.directive.ts"></code-example>
|
||||||
|
|
||||||
The identity validator implements the `ValidatorFn` interface. It takes an Angular control object as an argument and returns either null if the form is valid, or `ValidationErrors` otherwise.
|
The `identity` validator implements the `ValidatorFn` interface. It takes an Angular control object as an argument and returns either null if the form is valid, or `ValidationErrors` otherwise.
|
||||||
|
|
||||||
First we retrieve the child controls by calling the `FormGroup`'s [get](api/forms/AbstractControl#get) method. Then we simply compare the values of the `name` and `alterEgo` controls.
|
The validator retrieves the child controls by calling the `FormGroup`'s [get](api/forms/AbstractControl#get) method, then compares the values of the `name` and `alterEgo` controls.
|
||||||
|
|
||||||
If the values do not match, the hero's identity remains secret, and we can safely return null. Otherwise, the hero's identity is revealed and we must mark the form as invalid by returning an error object.
|
If the values do not match, the hero's identity remains secret, both are valid, and the validator returns null.
|
||||||
|
If they do match, the hero's identity is revealed and the validator must mark the form as invalid by returning an error object.
|
||||||
|
|
||||||
|
To provide better user experience, the template shows an appropriate error message when the form is invalid.
|
||||||
|
|
||||||
Next, to provide better user experience, we show an appropriate error message when the form is invalid.
|
|
||||||
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.html" region="cross-validation-error-message" header="reactive/hero-form-template.component.html"></code-example>
|
<code-example path="form-validation/src/app/reactive/hero-form-reactive.component.html" region="cross-validation-error-message" header="reactive/hero-form-template.component.html"></code-example>
|
||||||
|
|
||||||
Note that we check if:
|
This `*ngIf` displays the error if the `FormGroup` has the cross validation error returned by the `identityRevealed` validator, but only if the user has finished [interacting with the form](#dirty-or-touched).
|
||||||
- the `FormGroup` has the cross validation error returned by the `identityRevealed` validator,
|
|
||||||
- the user is yet to [interact](guide/form-validation#why-check-dirty-and-touched) with the form.
|
|
||||||
|
|
||||||
### Adding to template driven forms
|
### Adding cross-validation to template-driven forms
|
||||||
First we must create a directive that will wrap the validator function. We provide it as the validator using the `NG_VALIDATORS` token. If you are not sure why, or you do not fully understand the syntax, revisit the previous [section](guide/form-validation#adding-to-template-driven-forms).
|
|
||||||
|
For a template-driven form, you must create a directive to wrap the validator function.
|
||||||
|
You provide that directive as the validator using the [`NG_VALIDATORS` token](#adding-to-template-driven-forms "Read about providing validators"), as shown in the following example.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/identity-revealed.directive.ts" region="cross-validation-directive" header="shared/identity-revealed.directive.ts"></code-example>
|
<code-example path="form-validation/src/app/shared/identity-revealed.directive.ts" region="cross-validation-directive" header="shared/identity-revealed.directive.ts"></code-example>
|
||||||
|
|
||||||
Next, we have to add the directive to the html template. Since the validator must be registered at the highest level in the form, we put the directive on the `form` tag.
|
You must add the new directive to the HTML template.
|
||||||
|
Because the validator must be registered at the highest level in the form, the following template puts the directive on the `form` tag.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="cross-validation-register-validator" header="template/hero-form-template.component.html"></code-example>
|
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="cross-validation-register-validator" header="template/hero-form-template.component.html"></code-example>
|
||||||
|
|
||||||
To provide better user experience, we show an appropriate error message when the form is invalid.
|
To provide better user experience, we show an appropriate error message when the form is invalid.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="cross-validation-error-message" header="template/hero-form-template.component.html"></code-example>
|
<code-example path="form-validation/src/app/template/hero-form-template.component.html" region="cross-validation-error-message" header="template/hero-form-template.component.html"></code-example>
|
||||||
|
|
||||||
Note that we check if:
|
This is the same in both template-driven and reactive forms.
|
||||||
- the form has the cross validation error returned by the `identityRevealed` validator,
|
|
||||||
- the user is yet to [interact](guide/form-validation#why-check-dirty-and-touched) with the form.
|
|
||||||
|
|
||||||
This completes the cross validation example. We managed to:
|
## Creating asynchronous validators
|
||||||
- validate the form based on the values of two sibling controls,
|
|
||||||
- show a descriptive error message after the user interacted with the form and the validation failed.
|
|
||||||
|
|
||||||
## Async Validation
|
Asynchronous validators implement the `AsyncValidatorFn` and `AsyncValidator` interfaces.
|
||||||
This section shows how to create asynchronous validators. It assumes some basic knowledge of creating [custom validators](guide/form-validation#custom-validators).
|
These are very similar to their synchronous counterparts, with the following differences.
|
||||||
|
|
||||||
### The Basics
|
* The `validate()` functions must return a Promise or an observable,
|
||||||
Just like synchronous validators have the `ValidatorFn` and `Validator` interfaces, asynchronous validators have their own counterparts: `AsyncValidatorFn` and `AsyncValidator`.
|
* The observable returned must be finite, meaning it must complete at some point.
|
||||||
|
To convert an infinite observable into a finite one, pipe the observable through a filtering operator such as `first`, `last`, `take`, or `takeUntil`.
|
||||||
|
|
||||||
They are very similar with the only difference being:
|
Asynchronous validation happens after the synchronous validation, and is performed only if the synchronous validation is successful.
|
||||||
|
This check allows forms to avoid potentially expensive async validation processes (such as an HTTP request) if the more basic validation methods have already found invalid input.
|
||||||
|
|
||||||
* They must return a Promise or an Observable,
|
After asynchronous validation begins, the form control enters a `pending` state. You can inspect the control's `pending` property and use it to give visual feedback about the ongoing validation operation.
|
||||||
* The observable returned must be finite, meaning it must complete at some point. To convert an infinite observable into a finite one, pipe the observable through a filtering operator such as `first`, `last`, `take`, or `takeUntil`.
|
|
||||||
|
|
||||||
It is important to note that the asynchronous validation happens after the synchronous validation, and is performed only if the synchronous validation is successful. This check allows forms to avoid potentially expensive async validation processes such as an HTTP request if more basic validation methods fail.
|
A common UI pattern is to show a spinner while the async validation is being performed. The following example shows how to achieve this in a template-driven form.
|
||||||
|
|
||||||
After asynchronous validation begins, the form control enters a `pending` state. You can inspect the control's `pending` property and use it to give visual feedback about the ongoing validation.
|
|
||||||
|
|
||||||
A common UI pattern is to show a spinner while the async validation is being performed. The following example presents how to achieve this with template-driven forms:
|
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input [(ngModel)]="name" #model="ngModel" appSomeAsyncValidator>
|
<input [(ngModel)]="name" #model="ngModel" appSomeAsyncValidator>
|
||||||
<app-spinner *ngIf="model.pending"></app-spinner>
|
<app-spinner *ngIf="model.pending"></app-spinner>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Implementing Custom Async Validator
|
### Implementing a custom async validator
|
||||||
In the following section, validation is performed asynchronously to ensure that our heroes pick an alter ego that is not already taken. New heroes are constantly enlisting and old heroes are leaving the service. That means that we do not have the list of available alter egos ahead of time.
|
|
||||||
|
|
||||||
To validate the potential alter ego, we need to consult a central database of all currently enlisted heroes. The process is asynchronous, so we need a special validator for that.
|
In the following example, an async validator ensures that heroes pick an alter ego that is not already taken.
|
||||||
|
New heroes are constantly enlisting and old heroes are leaving the service, so the list of available alter egos cannot be retrieved ahead of time.
|
||||||
|
To validate the potential alter ego entry, the validator must initiate an asynchronous operation to consult a central database of all currently enlisted heroes.
|
||||||
|
|
||||||
Let's start by creating the validator class.
|
The following code create the validator class, `UniqueAlterEgoValidator`, which implements the `AsyncValidator` interface.
|
||||||
|
|
||||||
<code-example path="form-validation/src/app/shared/alter-ego.directive.ts" region="async-validator"></code-example>
|
<code-example path="form-validation/src/app/shared/alter-ego.directive.ts" region="async-validator"></code-example>
|
||||||
|
|
||||||
As you can see, the `UniqueAlterEgoValidator` class implements the `AsyncValidator` interface. In the constructor, we inject the `HeroesService` that has the following interface:
|
The constructor injects the `HeroesService`, which defines the following interface.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface HeroesService {
|
interface HeroesService {
|
||||||
@ -312,29 +316,37 @@ interface HeroesService {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In a real world application, the `HeroesService` is responsible for making an HTTP request to the hero database to check if the alter ego is available. From the validator's point of view, the actual implementation of the service is not important, so we can just code against the `HeroesService` interface.
|
In a real world application, the `HeroesService` would be responsible for making an HTTP request to the hero database to check if the alter ego is available.
|
||||||
|
From the validator's point of view, the actual implementation of the service is not important, so the example can just code against the `HeroesService` interface.
|
||||||
|
|
||||||
As the validation begins, the `UniqueAlterEgoValidator` delegates to the `HeroesService` `isAlterEgoTaken()` method with the current control value. At this point the control is marked as `pending` and remains in this state until the observable chain returned from the `validate()` method completes.
|
As the validation begins, the `UniqueAlterEgoValidator` delegates to the `HeroesService` `isAlterEgoTaken()` method with the current control value.
|
||||||
|
At this point the control is marked as `pending` and remains in this state until the observable chain returned from the `validate()` method completes.
|
||||||
|
|
||||||
The `isAlterEgoTaken()` method dispatches an HTTP request that checks if the alter ego is available, and returns `Observable<boolean>` as the result. We pipe the response through the `map` operator and transform it into a validation result. As always, we return `null` if the form is valid, and `ValidationErrors` if it is not. We make sure to handle any potential errors with the `catchError` operator.
|
The `isAlterEgoTaken()` method dispatches an HTTP request that checks if the alter ego is available, and returns `Observable<boolean>` as the result.
|
||||||
|
The `validate()` method pipes the response through the `map` operator and transforms it into a validation result.
|
||||||
|
|
||||||
Here we decided that `isAlterEgoTaken()` error is treated as a successful validation, because failure to make a validation request does not necessarily mean that the alter ego is invalid. You could handle the error differently and return the `ValidationError` object instead.
|
The method then, like any validator, returns `null` if the form is valid, and `ValidationErrors` if it is not.
|
||||||
|
This validator handles any potential errors with the `catchError` operator.
|
||||||
|
In this case, the validator treats the `isAlterEgoTaken()` error as a successful validation, because failure to make a validation request does not necessarily mean that the alter ego is invalid.
|
||||||
|
You could handle the error differently and return the `ValidationError` object instead.
|
||||||
|
|
||||||
After some time passes, the observable chain completes and the async validation is done. The `pending` flag is set to `false`, and the form validity is updated.
|
After some time passes, the observable chain completes and the asynchronous validation is done.
|
||||||
|
The `pending` flag is set to `false`, and the form validity is updated.
|
||||||
|
|
||||||
### Note on performance
|
### Optimizing performance of async validators
|
||||||
|
|
||||||
By default, all validators are run after every form value change. With synchronous validators, this will not likely have a noticeable impact on application performance. However, it's common for async validators to perform some kind of HTTP request to validate the control. Dispatching an HTTP request after every keystroke could put a strain on the backend API, and should be avoided if possible.
|
By default, all validators run after every form value change. With synchronous validators, this does not normally have a noticeable impact on application performance.
|
||||||
|
Async validators, however, commonly perform some kind of HTTP request to validate the control. Dispatching an HTTP request after every keystroke could put a strain on the backend API, and should be avoided if possible.
|
||||||
|
|
||||||
We can delay updating the form validity by changing the `updateOn` property from `change` (default) to `submit` or `blur`.
|
You can delay updating the form validity by changing the `updateOn` property from `change` (default) to `submit` or `blur`.
|
||||||
|
|
||||||
With template-driven forms:
|
With template-driven forms, set the property in the template.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input [(ngModel)]="name" [ngModelOptions]="{updateOn: 'blur'}">
|
<input [(ngModel)]="name" [ngModelOptions]="{updateOn: 'blur'}">
|
||||||
```
|
```
|
||||||
|
|
||||||
With reactive forms:
|
With reactive forms, set the property in the `FormControl` instance.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
new FormControl('', {updateOn: 'blur'});
|
new FormControl('', {updateOn: 'blur'});
|
||||||
|
@ -214,6 +214,13 @@ Read more about component classes, templates, and views in [Introduction to Angu
|
|||||||
|
|
||||||
See [workspace configuration](#cli-config)
|
See [workspace configuration](#cli-config)
|
||||||
|
|
||||||
|
{@a content-projection}
|
||||||
|
|
||||||
|
## content projection
|
||||||
|
|
||||||
|
A way to insert DOM content from outside a component into the component's view in a designated spot.
|
||||||
|
|
||||||
|
For more information, see [Responding to changes in content](guide/lifecycle-hooks#content-projection).
|
||||||
|
|
||||||
{@a custom-element}
|
{@a custom-element}
|
||||||
|
|
||||||
@ -594,7 +601,7 @@ Compare to [NgModule](#ngmodule).
|
|||||||
## ngcc
|
## ngcc
|
||||||
|
|
||||||
Angular compatibility compiler.
|
Angular compatibility compiler.
|
||||||
If you build your app using [Ivy](#ivy), but it depends on libraries have not been compiled with Ivy, the CLI uses `ngcc` to automatically update the dependent libraries to use Ivy.
|
If you build your app using [Ivy](#ivy), but it depends on libraries that have not been compiled with Ivy, the CLI uses `ngcc` to automatically update the dependent libraries to use Ivy.
|
||||||
|
|
||||||
|
|
||||||
{@a ngmodule}
|
{@a ngmodule}
|
||||||
@ -946,6 +953,19 @@ Read more about TypeScript at [typescriptlang.org](http://www.typescriptlang.org
|
|||||||
|
|
||||||
{@a U}
|
{@a U}
|
||||||
|
|
||||||
|
{@a unidirectional-data-flow}
|
||||||
|
|
||||||
|
## unidirectional data flow
|
||||||
|
|
||||||
|
A data flow model where the component tree is always checked for changes in one direction (parent to child), which prevents cycles in the change detection graph.
|
||||||
|
|
||||||
|
In practice, this means that data in Angular flows downward during change detection.
|
||||||
|
A parent component can easily change values in its child components because the parent is checked first.
|
||||||
|
A failure could occur, however, if a child component tries to change a value in its parent during change detection (inverting the expected data flow), because the parent component has already been rendered.
|
||||||
|
In development mode, Angular throws the `ExpressionChangedAfterItHasBeenCheckedError` error if your app attempts to do this, rather than silently failing to render the new value.
|
||||||
|
|
||||||
|
To avoid this error, a [lifecycle hook](guide/lifecycle-hooks) method that seeks to make such a change should trigger a new change detection run. The new run follows the same direction as before, but succeeds in picking up the new value.
|
||||||
|
|
||||||
{@a universal}
|
{@a universal}
|
||||||
|
|
||||||
## Universal
|
## Universal
|
||||||
|
@ -292,59 +292,3 @@ To fix this problem, we recommend binding to the `selected` property on the `<op
|
|||||||
<option>
|
<option>
|
||||||
</select>
|
</select>
|
||||||
```
|
```
|
||||||
|
|
||||||
{@a forward-refs-directive-inputs}
|
|
||||||
## Forward references to directive inputs accessed through local refs are no longer supported.
|
|
||||||
|
|
||||||
|
|
||||||
### Basic example of change
|
|
||||||
|
|
||||||
|
|
||||||
```ts
|
|
||||||
@Directive({
|
|
||||||
selector: '[myDir]',
|
|
||||||
exportAs: 'myDir'
|
|
||||||
})
|
|
||||||
export class MyDir {
|
|
||||||
@Input() message: string;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```html
|
|
||||||
{{ myDir.name }}
|
|
||||||
<div myDir #myDir="myDir" [name]="myName"></div>
|
|
||||||
```
|
|
||||||
|
|
||||||
In the View Engine runtime, the above code would print out the name without any errors.
|
|
||||||
In Ivy, the `myDir.name` binding will throw an `ExpressionChangedAfterItHasBeenCheckedError`.
|
|
||||||
|
|
||||||
|
|
||||||
### Background
|
|
||||||
|
|
||||||
In the ViewEngine runtime, directive input bindings and element bindings were executed in different stages. Angular would process the template one full time to check directive inputs only (e.g. `[name]`), then process the whole template again to check element and text bindings only (e.g.`{{ myDir.name }}`). This meant that the `name` directive input would be checked before the `myDir.name` text binding despite their relative order in the template, which some users felt to be counterintuitive.
|
|
||||||
|
|
||||||
In contrast, Ivy processes the template in just one pass, so that bindings are checked in the same order that they are written in the template. In this case, it means that the `myDir.name` binding will be checked before the `name` input sets the property on the directive (and thus it will be `undefined`). Since the `myDir.name` property will be set by the time the next change detection pass runs, a change detection error is thrown.
|
|
||||||
|
|
||||||
### Example of error
|
|
||||||
|
|
||||||
Assuming that the value for `myName` is `Angular`, you should see an error that looks like
|
|
||||||
|
|
||||||
```
|
|
||||||
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Angular'.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Recommended fix
|
|
||||||
|
|
||||||
To fix this problem, we recommend either getting the information for the binding directly from the host component (e.g. the `myName` property from our example) or to move the data binding after the directive has been declared so that the initial value is available on the first pass.
|
|
||||||
|
|
||||||
*Before*
|
|
||||||
```html
|
|
||||||
{{ myDir.name }}
|
|
||||||
<div myDir #myDir="myDir" [name]="myName"></div>
|
|
||||||
```
|
|
||||||
|
|
||||||
*After*
|
|
||||||
```html
|
|
||||||
{{ myName }}
|
|
||||||
<div myDir [name]="myName"></div>
|
|
||||||
```
|
|
||||||
|
@ -63,7 +63,7 @@ Please note that these constants are not meant to be used by 3rd party library o
|
|||||||
|
|
||||||
* Foreign functions or foreign constants in decorator metadata aren't statically resolvable (previously, you could import a constant or function from another compilation unit, like a library, and use that constant/function in your `@NgModule` definition).
|
* Foreign functions or foreign constants in decorator metadata aren't statically resolvable (previously, you could import a constant or function from another compilation unit, like a library, and use that constant/function in your `@NgModule` definition).
|
||||||
|
|
||||||
* Forward references to directive inputs accessed through local refs are no longer supported by default. [details](guide/ivy-compatibility-examples#forward-refs-directive-inputs)
|
* Forward references to directive inputs accessed through local refs are no longer supported by default.
|
||||||
|
|
||||||
* If there is both an unbound class attribute and a `[class]` binding, the classes in the unbound attribute will also be added (previously, the class binding would overwrite classes in the unbound attribute).
|
* If there is both an unbound class attribute and a `[class]` binding, the classes in the unbound attribute will also be added (previously, the class binding would overwrite classes in the unbound attribute).
|
||||||
|
|
||||||
|
@ -1,19 +1,61 @@
|
|||||||
# Lazy-loading feature modules
|
# Lazy-loading feature modules
|
||||||
|
|
||||||
## High level view
|
|
||||||
|
|
||||||
By default, NgModules are eagerly loaded, which means that as soon as the app loads, so do all the NgModules, whether or not they are immediately necessary. For large apps with lots of routes, consider lazy loading—a design pattern that loads NgModules as needed. Lazy loading helps keep initial
|
By default, NgModules are eagerly loaded, which means that as soon as the app loads, so do all the NgModules, whether or not they are immediately necessary. For large apps with lots of routes, consider lazy loading—a design pattern that loads NgModules as needed. Lazy loading helps keep initial
|
||||||
bundle sizes smaller, which in turn helps decrease load times.
|
bundle sizes smaller, which in turn helps decrease load times.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
For the final sample app with two lazy-loaded modules that this page describes, see the
|
For the final sample app with two lazy-loaded modules that this page describes, see the
|
||||||
<live-example></live-example>.
|
<live-example></live-example>.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a lazy-loading}
|
||||||
|
|
||||||
|
## Lazy loading basics
|
||||||
|
|
||||||
|
This section introduces the basic procedure for configuring a lazy-loaded route.
|
||||||
|
For a step-by-step example, see the [step-by-step setup](#step-by-step) section on this page.
|
||||||
|
|
||||||
|
To lazy load Angular modules, use `loadchildren` (instead of `component`) in your `AppRoutingModule` `routes` configuration as follows.
|
||||||
|
|
||||||
|
<code-example header="AppRoutingModule (excerpt)">
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'items',
|
||||||
|
loadChildren: () => import('./items/items.module').then(m => m.ItemsModule)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
In the lazy-loaded module's routing module, add a route for the component.
|
||||||
|
|
||||||
|
<code-example header="Routing module for lazy loaded module (excerpt)">
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ItemsComponent
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
Also be sure to remove the `ItemsModule` from the `AppModule`.
|
||||||
|
For step-by-step instructions on lazy loading modules, continue with the following sections of this page.
|
||||||
|
|
||||||
|
{@a step-by-step}
|
||||||
|
|
||||||
|
## Step-by-step setup
|
||||||
|
|
||||||
There are two main steps to setting up a lazy-loaded feature module:
|
There are two main steps to setting up a lazy-loaded feature module:
|
||||||
|
|
||||||
1. Create the feature module with the CLI, using the `--route` flag.
|
1. Create the feature module with the CLI, using the `--route` flag.
|
||||||
1. Configure the routes.
|
1. Configure the routes.
|
||||||
|
|
||||||
## Set up an app
|
### Set up an app
|
||||||
|
|
||||||
If you don’t already have an app, you can follow the steps below to
|
If you don’t already have an app, you can follow the steps below to
|
||||||
create one with the CLI. If you already have an app, skip to
|
create one with the CLI. If you already have an app, skip to
|
||||||
@ -36,7 +78,7 @@ See [Keeping Up to Date](guide/updating).
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Create a feature module with routing
|
### Create a feature module with routing
|
||||||
|
|
||||||
Next, you’ll need a feature module with a component to route to.
|
Next, you’ll need a feature module with a component to route to.
|
||||||
To make one, enter the following command in the terminal, where `customers` is the name of the feature module. The path for loading the `customers` feature modules is also `customers` because it is specified with the `--route` option:
|
To make one, enter the following command in the terminal, where `customers` is the name of the feature module. The path for loading the `customers` feature modules is also `customers` because it is specified with the `--route` option:
|
||||||
@ -59,7 +101,7 @@ Instead, it adds the declared route, `customers` to the `routes` array declared
|
|||||||
Notice that the lazy-loading syntax uses `loadChildren` followed by a function that uses the browser's built-in `import('...')` syntax for dynamic imports.
|
Notice that the lazy-loading syntax uses `loadChildren` followed by a function that uses the browser's built-in `import('...')` syntax for dynamic imports.
|
||||||
The import path is the relative path to the module.
|
The import path is the relative path to the module.
|
||||||
|
|
||||||
### Add another feature module
|
#### Add another feature module
|
||||||
|
|
||||||
Use the same command to create a second lazy-loaded feature module with routing, along with its stub component.
|
Use the same command to create a second lazy-loaded feature module with routing, along with its stub component.
|
||||||
|
|
||||||
@ -76,16 +118,14 @@ The `orders` route, specified with the `--route` option, is added to the `routes
|
|||||||
region="routes-customers-orders">
|
region="routes-customers-orders">
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
## Set up the UI
|
### Set up the UI
|
||||||
|
|
||||||
Though you can type the URL into the address bar, a navigation UI is easier for the user and more common.
|
Though you can type the URL into the address bar, a navigation UI is easier for the user and more common.
|
||||||
Replace the default placeholder markup in `app.component.html` with a custom nav
|
Replace the default placeholder markup in `app.component.html` with a custom nav
|
||||||
so you can easily navigate to your modules in the browser:
|
so you can easily navigate to your modules in the browser:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="lazy-loading-ngmodules/src/app/app.component.html" header="app.component.html" region="app-component-template" header="src/app/app.component.html"></code-example>
|
<code-example path="lazy-loading-ngmodules/src/app/app.component.html" header="app.component.html" region="app-component-template" header="src/app/app.component.html"></code-example>
|
||||||
|
|
||||||
|
|
||||||
To see your app in the browser so far, enter the following command in the terminal window:
|
To see your app in the browser so far, enter the following command in the terminal window:
|
||||||
|
|
||||||
<code-example language="bash">
|
<code-example language="bash">
|
||||||
@ -102,7 +142,7 @@ These buttons work, because the CLI automatically added the routes to the featur
|
|||||||
|
|
||||||
{@a config-routes}
|
{@a config-routes}
|
||||||
|
|
||||||
## Imports and route configuration
|
### Imports and route configuration
|
||||||
|
|
||||||
The CLI automatically added each feature module to the routes map at the application level.
|
The CLI automatically added each feature module to the routes map at the application level.
|
||||||
Finish this off by adding the default route. In the `app-routing.module.ts` file, update the `routes` array with the following:
|
Finish this off by adding the default route. In the `app-routing.module.ts` file, update the `routes` array with the following:
|
||||||
@ -134,7 +174,7 @@ The other feature module's routing module is configured similarly.
|
|||||||
|
|
||||||
<code-example path="lazy-loading-ngmodules/src/app/orders/orders-routing.module.ts" id="orders-routing.module.ts" region="orders-routing-module-detail" header="src/app/orders/orders-routing.module.ts (excerpt)"></code-example>
|
<code-example path="lazy-loading-ngmodules/src/app/orders/orders-routing.module.ts" id="orders-routing.module.ts" region="orders-routing-module-detail" header="src/app/orders/orders-routing.module.ts (excerpt)"></code-example>
|
||||||
|
|
||||||
## Confirm it’s working
|
### Verify lazy loading
|
||||||
|
|
||||||
You can check to see that a module is indeed being lazy loaded with the Chrome developer tools. In Chrome, open the dev tools by pressing `Cmd+Option+i` on a Mac or `Ctrl+Shift+j` on a PC and go to the Network Tab.
|
You can check to see that a module is indeed being lazy loaded with the Chrome developer tools. In Chrome, open the dev tools by pressing `Cmd+Option+i` on a Mac or `Ctrl+Shift+j` on a PC and go to the Network Tab.
|
||||||
|
|
||||||
@ -175,6 +215,105 @@ The `forRoot()` method takes care of the *global* injector configuration for the
|
|||||||
The `forChild()` method has no injector configuration. It uses directives such as `RouterOutlet` and `RouterLink`.
|
The `forChild()` method has no injector configuration. It uses directives such as `RouterOutlet` and `RouterLink`.
|
||||||
For more information, see the [`forRoot()` pattern](guide/singleton-services#forRoot) section of the [Singleton Services](guide/singleton-services) guide.
|
For more information, see the [`forRoot()` pattern](guide/singleton-services#forRoot) section of the [Singleton Services](guide/singleton-services) guide.
|
||||||
|
|
||||||
|
{@a preloading}
|
||||||
|
|
||||||
|
## Preloading
|
||||||
|
|
||||||
|
Preloading improves UX by loading parts of your app in the background.
|
||||||
|
You can preload modules or component data.
|
||||||
|
|
||||||
|
### Preloading modules
|
||||||
|
|
||||||
|
Preloading modules improves UX by loading parts of your app in the background so users don't have to wait for the elements to download when they activate a route.
|
||||||
|
|
||||||
|
To enable preloading of all lazy loaded modules, import the `PreloadAllModules` token from the Angular `router`.
|
||||||
|
|
||||||
|
<code-example header="AppRoutingModule (excerpt)">
|
||||||
|
|
||||||
|
import { PreloadAllModules } from '@angular/router';
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
Still in the `AppRoutingModule`, specify your preloading strategy in `forRoot()`.
|
||||||
|
|
||||||
|
<code-example header="AppRoutingModule (excerpt)">
|
||||||
|
|
||||||
|
RouterModule.forRoot(
|
||||||
|
appRoutes,
|
||||||
|
{
|
||||||
|
preloadingStrategy: PreloadAllModules
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
### Preloading component data
|
||||||
|
|
||||||
|
To preload component data, you can use a `resolver`.
|
||||||
|
Resolvers improve UX by blocking the page load until all necessary data is available to fully display the page.
|
||||||
|
|
||||||
|
#### Resolvers
|
||||||
|
|
||||||
|
Create a resolver service.
|
||||||
|
With the CLI, the command to generate a service is as follows:
|
||||||
|
|
||||||
|
|
||||||
|
<code-example language="none" class="code-shell">
|
||||||
|
ng generate service <service-name>
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
In your service, import the following router members, implement `Resolve`, and inject the `Router` service:
|
||||||
|
|
||||||
|
<code-example header="Resolver service (excerpt)">
|
||||||
|
|
||||||
|
import { Resolve } from '@angular/router';
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
export class CrisisDetailResolverService implements Resolve<> {
|
||||||
|
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<> {
|
||||||
|
// your logic goes here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
Import this resolver into your module's routing module.
|
||||||
|
|
||||||
|
<code-example header="Feature module's routing module (excerpt)">
|
||||||
|
|
||||||
|
import { YourResolverService } from './your-resolver.service';
|
||||||
|
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
Add a `resolve` object to the component's `route` configuration.
|
||||||
|
|
||||||
|
<code-example header="Feature module's routing module (excerpt)">
|
||||||
|
{
|
||||||
|
path: '/your-path',
|
||||||
|
component: YourComponent,
|
||||||
|
resolve: {
|
||||||
|
crisis: YourResolverService
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
|
||||||
|
In the component, use an `Observable` to get the data from the `ActivatedRoute`.
|
||||||
|
|
||||||
|
|
||||||
|
<code-example header="Component (excerpt)">
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.data
|
||||||
|
.subscribe((your-parameters) => {
|
||||||
|
// your data-specific code goes here
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
For more information with a working example, see the [routing tutorial section on preloading](guide/router#preloading-background-loading-of-feature-areas).
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
## More on NgModules and routing
|
## More on NgModules and routing
|
||||||
|
@ -1,45 +1,49 @@
|
|||||||
# Lifecycle hooks
|
# Hooking into the component lifecycle
|
||||||
|
|
||||||
A component has a lifecycle managed by Angular.
|
A component instance has a lifecycle that starts when Angular instantiates the component class and renders the component view along with its child views.
|
||||||
|
The lifecycle continues with change detection, as Angular checks to see when data-bound properties change, and updates both the view and the component instance as needed.
|
||||||
|
The lifecycle ends when Angular destroys the component instance and removes its rendered template from the DOM.
|
||||||
|
Directives have a similar lifecycle, as Angular creates, updates, and destroys instances in the course of execution.
|
||||||
|
|
||||||
Angular creates and renders components along with their children, checks when their data-bound properties change, and destroys them before removing them from the DOM.
|
Your application can use [lifecycle hook methods](guide/glossary#lifecycle-hook "Definition of lifecycle hook") to tap into key events in the lifecycle of a component or directive in order to initialize new instances, initiate change detection when needed, respond to updates during change detection, and clean up before deletion of instances.
|
||||||
|
|
||||||
Angular offers **lifecycle hooks**
|
## Prerequisites
|
||||||
that provide visibility into these key life moments and the ability to act when they occur.
|
|
||||||
|
|
||||||
A directive has the same set of lifecycle hooks.
|
Before working with lifecycle hooks, you should have a basic understanding of the following:
|
||||||
|
|
||||||
|
* [TypeScript programming](https://www.typescriptlang.org/).
|
||||||
|
* Angular app-design fundamentals, as described in [Angular Concepts](guide/architecture "Introduction to fundamental app-design concepts").
|
||||||
|
|
||||||
{@a hooks-overview}
|
{@a hooks-overview}
|
||||||
|
|
||||||
## Component lifecycle hooks overview
|
## Responding to lifecycle events
|
||||||
|
|
||||||
Directive and component instances have a lifecycle
|
You can respond to events in the lifecycle of a component or directive by implementing one or more of the *lifecycle hook* interfaces in the Angular `core` library.
|
||||||
as Angular creates, updates, and destroys them.
|
The hooks give you the opportunity to act on a component or directive instance at the appropriate moment, as Angular creates, updates, or destroys that instance.
|
||||||
Developers can tap into key moments in that lifecycle by implementing
|
|
||||||
one or more of the *lifecycle hook* interfaces in the Angular `core` library.
|
|
||||||
|
|
||||||
Each interface has a single hook method whose name is the interface name prefixed with `ng`.
|
Each interface defines the prototype for a single hook method, whose name is the interface name prefixed with `ng`.
|
||||||
For example, the `OnInit` interface has a hook method named `ngOnInit()`
|
For example, the `OnInit` interface has a hook method named `ngOnInit()`. If you implement this method in your component or directive class, Angular calls it shortly after checking the input properties for that component or directive for the first time.
|
||||||
that Angular calls shortly after creating the component:
|
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/peek-a-boo.component.ts" region="ngOnInit" header="peek-a-boo.component.ts (excerpt)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/peek-a-boo.component.ts" region="ngOnInit" header="peek-a-boo.component.ts (excerpt)"></code-example>
|
||||||
|
|
||||||
No directive or component will implement all of the lifecycle hooks.
|
You don't have to implement all (or any) of the lifecycle hooks, just the ones you need.
|
||||||
Angular only calls a directive/component hook method *if it is defined*.
|
|
||||||
|
|
||||||
{@a hooks-purpose-timing}
|
{@a hooks-purpose-timing}
|
||||||
|
|
||||||
## Lifecycle sequence
|
### Lifecycle event sequence
|
||||||
|
|
||||||
*After* creating a component/directive by calling its constructor, Angular
|
After your application instantiates a component or directive by calling its constructor, Angular calls the hook methods you have implemented at the appropriate point in the lifecycle of that instance.
|
||||||
calls the lifecycle hook methods in the following sequence at specific moments:
|
|
||||||
|
Angular executes hook methods in the following sequence. You can use them to perform the following kinds of operations.
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<col width="20%"></col>
|
<col width="20%"></col>
|
||||||
<col width="80%"></col>
|
<col width="60%"></col>
|
||||||
|
<col width="20%"></col>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Hook</th>
|
<th>Hook method</th>
|
||||||
<th>Purpose and Timing</th>
|
<th>Purpose</th>
|
||||||
|
<th>Timing</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style='vertical-align:top'>
|
<tr style='vertical-align:top'>
|
||||||
<td>
|
<td>
|
||||||
@ -47,9 +51,15 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Respond when Angular (re)sets data-bound input properties.
|
Respond when Angular sets or resets data-bound input properties.
|
||||||
The method receives a `SimpleChanges` object of current and previous property values.
|
The method receives a `SimpleChanges` object of current and previous property values.
|
||||||
|
|
||||||
|
Note that this happens very frequently, so any operation you perform here impacts performance significantly.
|
||||||
|
See details in [Using change detection hooks](#onchanges) in this document.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
Called before `ngOnInit()` and whenever one or more data-bound input properties change.
|
Called before `ngOnInit()` and whenever one or more data-bound input properties change.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
@ -60,10 +70,14 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Initialize the directive/component after Angular first displays the data-bound properties
|
Initialize the directive or component after Angular first displays the data-bound properties
|
||||||
and sets the directive/component's input properties.
|
and sets the directive or component's input properties.
|
||||||
|
See details in [Initializing a component or directive](#oninit) in this document.
|
||||||
|
|
||||||
Called _once_, after the _first_ `ngOnChanges()`.
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Called once, after the first `ngOnChanges()`.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -74,8 +88,12 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
<td>
|
<td>
|
||||||
|
|
||||||
Detect and act upon changes that Angular can't or won't detect on its own.
|
Detect and act upon changes that Angular can't or won't detect on its own.
|
||||||
|
See details and example in [Defining custom change detection](#docheck) in this document.
|
||||||
|
|
||||||
Called during every change detection run, immediately after `ngOnChanges()` and `ngOnInit()`.
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Called immediately after `ngOnChanges()` on every change detection run, and immediately after `ngOnInit()` on the first run.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -85,7 +103,13 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Respond after Angular projects external content into the component's view / the view that a directive is in.
|
Respond after Angular projects external content into the component's view, or into the view that a directive is in.
|
||||||
|
|
||||||
|
See details and example in [Responding to changes in content](#aftercontent) in this document.
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
Called _once_ after the first `ngDoCheck()`.
|
Called _once_ after the first `ngDoCheck()`.
|
||||||
|
|
||||||
@ -97,9 +121,15 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Respond after Angular checks the content projected into the directive/component.
|
Respond after Angular checks the content projected into the directive or component.
|
||||||
|
|
||||||
Called after the `ngAfterContentInit()` and every subsequent `ngDoCheck()`.
|
See details and example in [Responding to projected content changes](#aftercontent) in this document.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Called after `ngAfterContentInit()` and every subsequent `ngDoCheck()`.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -109,10 +139,15 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Respond after Angular initializes the component's views and child views / the view that a directive is in.
|
Respond after Angular initializes the component's views and child views, or the view that contains the directive.
|
||||||
|
|
||||||
|
See details and example in [Responding to view changes](#afterview) in this document.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
|
||||||
Called _once_ after the first `ngAfterContentChecked()`.
|
Called _once_ after the first `ngAfterContentChecked()`.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style='vertical-align:top'>
|
<tr style='vertical-align:top'>
|
||||||
@ -121,7 +156,11 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Respond after Angular checks the component's views and child views / the view that a directive is in.
|
Respond after Angular checks the component's views and child views, or the view that contains the directive.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
|
||||||
Called after the `ngAfterViewInit()` and every subsequent `ngAfterContentChecked()`.
|
Called after the `ngAfterViewInit()` and every subsequent `ngAfterContentChecked()`.
|
||||||
|
|
||||||
@ -133,53 +172,32 @@ calls the lifecycle hook methods in the following sequence at specific moments:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Cleanup just before Angular destroys the directive/component.
|
Cleanup just before Angular destroys the directive or component.
|
||||||
Unsubscribe Observables and detach event handlers to avoid memory leaks.
|
Unsubscribe Observables and detach event handlers to avoid memory leaks.
|
||||||
|
See details in [Cleaning up on instance destruction](#ondestroy) in this document.
|
||||||
|
|
||||||
Called _just before_ Angular destroys the directive/component.
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Called immediately before Angular destroys the directive or component.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{@a interface-optional}
|
|
||||||
|
|
||||||
## Interfaces are optional (technically)
|
|
||||||
|
|
||||||
The interfaces are optional for JavaScript and Typescript developers from a purely technical perspective.
|
|
||||||
The JavaScript language doesn't have interfaces.
|
|
||||||
Angular can't see TypeScript interfaces at runtime because they disappear from the transpiled JavaScript.
|
|
||||||
|
|
||||||
Fortunately, they aren't necessary.
|
|
||||||
You don't have to add the lifecycle hook interfaces to directives and components to benefit from the hooks themselves.
|
|
||||||
|
|
||||||
Angular instead inspects directive and component classes and calls the hook methods *if they are defined*.
|
|
||||||
Angular finds and calls methods like `ngOnInit()`, with or without the interfaces.
|
|
||||||
|
|
||||||
Nonetheless, it's good practice to add interfaces to TypeScript directive classes
|
|
||||||
in order to benefit from strong typing and editor tooling.
|
|
||||||
|
|
||||||
{@a other-lifecycle-hooks}
|
|
||||||
|
|
||||||
## Other Angular lifecycle hooks
|
|
||||||
|
|
||||||
Other Angular sub-systems may have their own lifecycle hooks apart from these component hooks.
|
|
||||||
|
|
||||||
3rd party libraries might implement their hooks as well in order to give developers more
|
|
||||||
control over how these libraries are used.
|
|
||||||
|
|
||||||
{@a the-sample}
|
{@a the-sample}
|
||||||
|
|
||||||
## Lifecycle examples
|
### Lifecycle example set
|
||||||
|
|
||||||
The <live-example></live-example>
|
The <live-example></live-example>
|
||||||
demonstrates the lifecycle hooks in action through a series of exercises
|
demonstrates the use of lifecycle hooks through a series of exercises
|
||||||
presented as components under the control of the root `AppComponent`.
|
presented as components under the control of the root `AppComponent`.
|
||||||
|
In each case a *parent* component serves as a test rig for
|
||||||
They follow a common pattern: a *parent* component serves as a test rig for
|
|
||||||
a *child* component that illustrates one or more of the lifecycle hook methods.
|
a *child* component that illustrates one or more of the lifecycle hook methods.
|
||||||
|
|
||||||
Here's a brief description of each exercise:
|
The following table lists the exercises with brief descriptions.
|
||||||
|
The sample code is also used to illustrate specific tasks in the following sections.
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<col width="20%"></col>
|
<col width="20%"></col>
|
||||||
@ -205,12 +223,9 @@ Here's a brief description of each exercise:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Directives have lifecycle hooks too.
|
Shows how you can use lifecycle hooks with a custom directive.
|
||||||
A `SpyDirective` can log when the element it spies upon is
|
The `SpyDirective` implements the `ngOnInit()` and `ngOnDestroy()` hooks,
|
||||||
created or destroyed using the `ngOnInit` and `ngOnDestroy` hooks.
|
and uses them to watch and report when an element goes in or out of the current view.
|
||||||
|
|
||||||
This example applies the `SpyDirective` to a `<div>` in an `ngFor` *hero* repeater
|
|
||||||
managed by the parent `SpyComponent`.
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -220,9 +235,9 @@ Here's a brief description of each exercise:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
See how Angular calls the `ngOnChanges()` hook with a `changes` object
|
Demonstrates how Angular calls the `ngOnChanges()` hook
|
||||||
every time one of the component input properties changes.
|
every time one of the component input properties changes,
|
||||||
Shows how to interpret the `changes` object.
|
and shows how to interpret the `changes` object passed to the hook method.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -232,8 +247,8 @@ Here's a brief description of each exercise:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Implements an `ngDoCheck()` method with custom change detection.
|
Implements the `ngDoCheck()` method with custom change detection.
|
||||||
See how often Angular calls this hook and watch it post changes to a log.
|
Watch the hook post changes to a log to see how often Angular calls this hook.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -243,8 +258,8 @@ Here's a brief description of each exercise:
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Shows what Angular means by a *view*.
|
Shows what Angular means by a [view](guide/glossary#view "Definition of view.").
|
||||||
Demonstrates the `ngAfterViewInit` and `ngAfterViewChecked` hooks.
|
Demonstrates the `ngAfterViewInit()` and `ngAfterViewChecked()` hooks.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -256,40 +271,87 @@ Here's a brief description of each exercise:
|
|||||||
|
|
||||||
Shows how to project external content into a component and
|
Shows how to project external content into a component and
|
||||||
how to distinguish projected content from a component's view children.
|
how to distinguish projected content from a component's view children.
|
||||||
Demonstrates the `ngAfterContentInit` and `ngAfterContentChecked` hooks.
|
Demonstrates the `ngAfterContentInit()` and `ngAfterContentChecked()` hooks.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style='vertical-align:top'>
|
<tr style='vertical-align:top'>
|
||||||
<td>
|
<td>
|
||||||
Counter
|
<a href="#counter">Counter</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Demonstrates a combination of a component and a directive
|
Demonstrates a combination of a component and a directive, each with its own hooks.
|
||||||
each with its own hooks.
|
|
||||||
|
|
||||||
In this example, a `CounterComponent` logs a change (via `ngOnChanges`)
|
|
||||||
every time the parent component increments its input counter property.
|
|
||||||
Meanwhile, the `SpyDirective` from the previous example is applied
|
|
||||||
to the `CounterComponent` log where it watches log entries being created and destroyed.
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
The remainder of this page discusses selected exercises in further detail.
|
|
||||||
|
{@a oninit}
|
||||||
|
|
||||||
|
## Initializing a component or directive
|
||||||
|
|
||||||
|
Use the `ngOnInit()` method to perform the following initialization tasks.
|
||||||
|
|
||||||
|
* Perform complex initializations outside of the constructor.
|
||||||
|
Components should be cheap and safe to construct.
|
||||||
|
You should not, for example, fetch data in a component constructor.
|
||||||
|
You shouldn't worry that a new component will try to contact a remote server when
|
||||||
|
created under test or before you decide to display it.
|
||||||
|
|
||||||
|
An `ngOnInit()` is a good place for a component to fetch its initial data.
|
||||||
|
For an example, see the [Tour of Heroes tutorial](tutorial/toh-pt4#oninit).
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
In [Flaw: Constructor does Real Work](http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/), Misko Hevery, Angular team lead, explains why you should avoid complex constructor logic.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
* Set up the component after Angular sets the input properties.
|
||||||
|
Constructors should do no more than set the initial local variables to simple values.
|
||||||
|
|
||||||
|
Keep in mind that a directive's data-bound input properties are not set until _after construction_.
|
||||||
|
If you need to initialize the directive based on those properties, set them when `ngOnInit()` runs.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
The `ngOnChanges()` method is your first opportunity to access those properties.
|
||||||
|
Angular calls `ngOnChanges()` before `ngOnInit()`, but also many times after that.
|
||||||
|
It only calls `ngOnInit()` once.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a ondestroy}
|
||||||
|
|
||||||
|
## Cleaning up on instance destruction
|
||||||
|
|
||||||
|
Put cleanup logic in `ngOnDestroy()`, the logic that must run before Angular destroys the directive.
|
||||||
|
|
||||||
|
This is the place to free resources that won't be garbage-collected automatically.
|
||||||
|
You risk memory leaks if you neglect to do so.
|
||||||
|
|
||||||
|
* Unsubscribe from Observables and DOM events.
|
||||||
|
* Stop interval timers.
|
||||||
|
* Unregister all callbacks that the directive registered with global or application services.
|
||||||
|
|
||||||
|
The `ngOnDestroy()` method is also the time to notify another part of the application that the component is going away.
|
||||||
|
|
||||||
|
|
||||||
|
## General examples
|
||||||
|
|
||||||
|
The following examples demonstrate the call sequence and relative frequency of the various lifecycle events, and how the hooks can be used separately or together for components and directives.
|
||||||
|
|
||||||
{@a peek-a-boo}
|
{@a peek-a-boo}
|
||||||
|
|
||||||
## Peek-a-boo: all hooks
|
### Sequence and frequency of all lifecycle events
|
||||||
|
|
||||||
The `PeekABooComponent` demonstrates all of the hooks in one component.
|
To show how Angular calls the hooks in the expected order, the `PeekABooComponent` demonstrates all of the hooks in one component.
|
||||||
|
|
||||||
You would rarely, if ever, implement all of the interfaces like this.
|
In practice you would rarely, if ever, implement all of the interfaces the way this demo does.
|
||||||
The peek-a-boo exists to show how Angular calls the hooks in the expected order.
|
|
||||||
|
|
||||||
This snapshot reflects the state of the log after the user clicked the *Create...* button and then the *Destroy...* button.
|
The following snapshot reflects the state of the log after the user clicked the *Create...* button and then the *Destroy...* button.
|
||||||
|
|
||||||
<div class="lightbox">
|
<div class="lightbox">
|
||||||
<img src="generated/images/guide/lifecycle-hooks/peek-a-boo.png" alt="Peek-a-boo">
|
<img src="generated/images/guide/lifecycle-hooks/peek-a-boo.png" alt="Peek-a-boo">
|
||||||
@ -301,52 +363,42 @@ The sequence of log messages follows the prescribed hook calling order:
|
|||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
The constructor isn't an Angular hook *per se*.
|
Notice that the log confirms that input properties (the `name` property in this case) have no assigned values at construction.
|
||||||
The log confirms that input properties (the `name` property in this case) have no assigned values at construction.
|
The input properties are available to the `onInit()` method for further initialization.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Had the user clicked the *Update Hero* button, the log would show another `OnChanges` and two more triplets of
|
Had the user clicked the *Update Hero* button, the log would show another `OnChanges` and two more triplets of `DoCheck`, `AfterContentChecked` and `AfterViewChecked`.
|
||||||
`DoCheck`, `AfterContentChecked` and `AfterViewChecked`.
|
Notice that these three hooks fire *often*, so it is important to keep their logic as lean as possible.
|
||||||
Clearly these three hooks fire *often*. Keep the logic in these hooks as lean as possible!
|
|
||||||
|
|
||||||
The next examples focus on hook details.
|
|
||||||
|
|
||||||
|
|
||||||
{@a spy}
|
{@a spy}
|
||||||
|
|
||||||
## Spying *OnInit* and *OnDestroy*
|
### Use directives to watch the DOM
|
||||||
|
|
||||||
Go undercover with these two spy hooks to discover when an element is initialized or destroyed.
|
The `Spy` example demonstrates how you can use hook method for directives as well as components.
|
||||||
|
The `SpyDirective` implements two hooks, `ngOnInit()` and `ngOnDestroy()`, in order to discover when a watched element is in the current view.
|
||||||
|
|
||||||
This is the perfect infiltration job for a directive.
|
This template applies the `SpyDirective` to a `<div>` in the `ngFor` *hero* repeater managed by the parent `SpyComponent`.
|
||||||
The heroes will never know they're being watched.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
The example does not perform any initialization or clean-up.
|
||||||
|
It just tracks the appearance and disappearance of an element in the view by recording when the directive itself is instantiated and destroyed.
|
||||||
|
|
||||||
Kidding aside, pay attention to two key points:
|
A spy directive like this can provide insight into a DOM object that you cannot change directly.
|
||||||
|
You can't touch the implementation of a native `<div>`, or modify a third party component.
|
||||||
|
You can, however watch these elements with a directive.
|
||||||
|
|
||||||
1. Angular calls hook methods for *directives* as well as components.<br><br>
|
The directive defines `ngOnInit()` and `ngOnDestroy()` hooks
|
||||||
|
|
||||||
2. A spy directive can provide insight into a DOM object that you cannot change directly.
|
|
||||||
Obviously you can't touch the implementation of a native `<div>`.
|
|
||||||
You can't modify a third party component either.
|
|
||||||
But you can watch both with a directive.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
The sneaky spy directive is simple, consisting almost entirely of `ngOnInit()` and `ngOnDestroy()` hooks
|
|
||||||
that log messages to the parent via an injected `LoggerService`.
|
that log messages to the parent via an injected `LoggerService`.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/spy.directive.ts" region="spy-directive" header="src/app/spy.directive.ts"></code-example>
|
<code-example path="lifecycle-hooks/src/app/spy.directive.ts" region="spy-directive" header="src/app/spy.directive.ts"></code-example>
|
||||||
|
|
||||||
You can apply the spy to any native or component element and it'll be initialized and destroyed
|
You can apply the spy to any native or component element, and see that it is initialized and destroyed
|
||||||
at the same time as that element.
|
at the same time as that element.
|
||||||
Here it is attached to the repeated hero `<div>`:
|
Here it is attached to the repeated hero `<div>`:
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/spy.component.html" region="template" header="src/app/spy.component.html"></code-example>
|
<code-example path="lifecycle-hooks/src/app/spy.component.html" region="template" header="src/app/spy.component.html"></code-example>
|
||||||
|
|
||||||
Each spy's birth and death marks the birth and death of the attached hero `<div>`
|
Each spy's creation and destruction marks the appearance and disappearance of the attached hero `<div>`
|
||||||
with an entry in the *Hook Log* as seen here:
|
with an entry in the *Hook Log* as seen here:
|
||||||
|
|
||||||
<div class="lightbox">
|
<div class="lightbox">
|
||||||
@ -359,70 +411,20 @@ The *Reset* button clears the `heroes` list.
|
|||||||
Angular removes all hero `<div>` elements from the DOM and destroys their spy directives at the same time.
|
Angular removes all hero `<div>` elements from the DOM and destroys their spy directives at the same time.
|
||||||
The spy's `ngOnDestroy()` method reports its last moments.
|
The spy's `ngOnDestroy()` method reports its last moments.
|
||||||
|
|
||||||
The `ngOnInit()` and `ngOnDestroy()` methods have more vital roles to play in real applications.
|
{@a counter}
|
||||||
|
|
||||||
{@a oninit}
|
### Use component and directive hooks together
|
||||||
|
|
||||||
### _OnInit()_
|
In this example, a `CounterComponent` uses the `ngOnChanges()` method to log a change every time the parent component increments its input `counter` property.
|
||||||
|
|
||||||
Use `ngOnInit()` for two main reasons:
|
This example applies the `SpyDirective` from the previous example to the `CounterComponent` log, in order to watch the creation and destruction of log entries.
|
||||||
|
|
||||||
1. To perform complex initializations shortly after construction.
|
|
||||||
1. To set up the component after Angular sets the input properties.
|
|
||||||
|
|
||||||
Experienced developers agree that components should be cheap and safe to construct.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
Misko Hevery, Angular team lead,
|
|
||||||
[explains why](http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/)
|
|
||||||
you should avoid complex constructor logic.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Don't fetch data in a component constructor.
|
|
||||||
You shouldn't worry that a new component will try to contact a remote server when
|
|
||||||
created under test or before you decide to display it.
|
|
||||||
Constructors should do no more than set the initial local variables to simple values.
|
|
||||||
|
|
||||||
An `ngOnInit()` is a good place for a component to fetch its initial data. The
|
|
||||||
[Tour of Heroes Tutorial](tutorial/toh-pt4#oninit) guide shows how.
|
|
||||||
|
|
||||||
|
|
||||||
Remember also that a directive's data-bound input properties are not set until _after construction_.
|
|
||||||
That's a problem if you need to initialize the directive based on those properties.
|
|
||||||
They'll have been set when `ngOnInit()` runs.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
The `ngOnChanges()` method is your first opportunity to access those properties.
|
|
||||||
Angular calls `ngOnChanges()` before `ngOnInit()` and many times after that.
|
|
||||||
It only calls `ngOnInit()` once.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
You can count on Angular to call the `ngOnInit()` method _soon_ after creating the component.
|
|
||||||
That's where the heavy initialization logic belongs.
|
|
||||||
|
|
||||||
{@a ondestroy}
|
|
||||||
|
|
||||||
### _OnDestroy()_
|
|
||||||
|
|
||||||
Put cleanup logic in `ngOnDestroy()`, the logic that *must* run before Angular destroys the directive.
|
|
||||||
|
|
||||||
This is the time to notify another part of the application that the component is going away.
|
|
||||||
|
|
||||||
This is the place to free resources that won't be garbage collected automatically.
|
|
||||||
Unsubscribe from Observables and DOM events. Stop interval timers.
|
|
||||||
Unregister all callbacks that this directive registered with global or application services.
|
|
||||||
You risk memory leaks if you neglect to do so.
|
|
||||||
|
|
||||||
{@a onchanges}
|
{@a onchanges}
|
||||||
|
|
||||||
## _OnChanges()_
|
## Using change detection hooks
|
||||||
|
|
||||||
Angular calls its `ngOnChanges()` method whenever it detects changes to ***input properties*** of the component (or directive).
|
Angular calls the `ngOnChanges()` method of a component or directive whenever it detects changes to the ***input properties***.
|
||||||
This example monitors the `OnChanges` hook.
|
The *onChanges* example demonstrates this by monitoring the `OnChanges()` hook.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/on-changes.component.ts" region="ng-on-changes" header="on-changes.component.ts (excerpt)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/on-changes.component.ts" region="ng-on-changes" header="on-changes.component.ts (excerpt)"></code-example>
|
||||||
|
|
||||||
@ -434,7 +436,7 @@ The example component, `OnChangesComponent`, has two input properties: `hero` an
|
|||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/on-changes.component.ts" region="inputs" header="src/app/on-changes.component.ts"></code-example>
|
<code-example path="lifecycle-hooks/src/app/on-changes.component.ts" region="inputs" header="src/app/on-changes.component.ts"></code-example>
|
||||||
|
|
||||||
The host `OnChangesParentComponent` binds to them like this:
|
The host `OnChangesParentComponent` binds to them as follows.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/on-changes-parent.component.html" region="on-changes" header="src/app/on-changes-parent.component.html"></code-example>
|
<code-example path="lifecycle-hooks/src/app/on-changes-parent.component.html" region="on-changes" header="src/app/on-changes-parent.component.html"></code-example>
|
||||||
|
|
||||||
@ -445,51 +447,20 @@ Here's the sample in action as the user makes changes.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
The log entries appear as the string value of the *power* property changes.
|
The log entries appear as the string value of the *power* property changes.
|
||||||
But the `ngOnChanges` does not catch changes to `hero.name`
|
Notice, however, that the `ngOnChanges()` method does not catch changes to `hero.name`.
|
||||||
That's surprising at first.
|
This is because Angular calls the hook only when the value of the input property changes.
|
||||||
|
In this case, `hero` is the input property, and the value of the `hero` property is the *reference to the hero object*.
|
||||||
|
The object reference did not change when the value of its own `name` property changed.
|
||||||
|
|
||||||
Angular only calls the hook when the value of the input property changes.
|
|
||||||
The value of the `hero` property is the *reference to the hero object*.
|
|
||||||
Angular doesn't care that the hero's own `name` property changed.
|
|
||||||
The hero object *reference* didn't change so, from Angular's perspective, there is no change to report!
|
|
||||||
|
|
||||||
{@a docheck}
|
|
||||||
|
|
||||||
## _DoCheck()_
|
|
||||||
|
|
||||||
Use the `DoCheck` hook to detect and act upon changes that Angular doesn't catch on its own.
|
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
Use this method to detect a change that Angular overlooked.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
The *DoCheck* sample extends the *OnChanges* sample with the following `ngDoCheck()` hook:
|
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/do-check.component.ts" region="ng-do-check" header="DoCheckComponent (ngDoCheck)"></code-example>
|
|
||||||
|
|
||||||
This code inspects certain _values of interest_, capturing and comparing their current state against previous values.
|
|
||||||
It writes a special message to the log when there are no substantive changes to the `hero` or the `power`
|
|
||||||
so you can see how often `DoCheck` is called. The results are illuminating:
|
|
||||||
|
|
||||||
<div class="lightbox">
|
|
||||||
<img src='generated/images/guide/lifecycle-hooks/do-check-anim.gif' alt="DoCheck">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
While the `ngDoCheck()` hook can detect when the hero's `name` has changed, it has a frightful cost.
|
|
||||||
This hook is called with enormous frequency—after _every_
|
|
||||||
change detection cycle no matter where the change occurred.
|
|
||||||
It's called over twenty times in this example before the user can do anything.
|
|
||||||
|
|
||||||
Most of these initial checks are triggered by Angular's first rendering of *unrelated data elsewhere on the page*.
|
|
||||||
Mere mousing into another `<input>` triggers a call.
|
|
||||||
Relatively few calls reveal actual changes to pertinent data.
|
|
||||||
Clearly our implementation must be very lightweight or the user experience suffers.
|
|
||||||
|
|
||||||
{@a afterview}
|
{@a afterview}
|
||||||
|
|
||||||
## AfterView
|
### Responding to view changes
|
||||||
|
|
||||||
|
As Angular traverses the [view hierarchy](guide/glossary#view-hierarchy "Definition of view hierarchy definition") during change detection, it needs to be sure that a change in a child does not attempt to cause a change in its own parent. Such a change would not be rendered properly, because of how [unidirectional data flow](guide/glossary#unidirectional-data-flow "Definition") works.
|
||||||
|
|
||||||
|
If you need to make a change that inverts the expected data flow, you must trigger a new change detection cycle to allow that change to be rendered.
|
||||||
|
The examples illustrate how to make such changes safely.
|
||||||
|
|
||||||
The *AfterView* sample explores the `AfterViewInit()` and `AfterViewChecked()` hooks that Angular calls
|
The *AfterView* sample explores the `AfterViewInit()` and `AfterViewChecked()` hooks that Angular calls
|
||||||
*after* it creates a component's child views.
|
*after* it creates a component's child views.
|
||||||
@ -506,47 +477,46 @@ The following hooks take action based on changing values *within the child view*
|
|||||||
which can only be reached by querying for the child view via the property decorated with
|
which can only be reached by querying for the child view via the property decorated with
|
||||||
[@ViewChild](api/core/ViewChild).
|
[@ViewChild](api/core/ViewChild).
|
||||||
|
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/after-view.component.ts" region="hooks" header="AfterViewComponent (class excerpts)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/after-view.component.ts" region="hooks" header="AfterViewComponent (class excerpts)"></code-example>
|
||||||
|
|
||||||
{@a wait-a-tick}
|
{@a wait-a-tick}
|
||||||
|
|
||||||
### Abide by the unidirectional data flow rule
|
#### Wait before updating the view
|
||||||
The `doSomething()` method updates the screen when the hero name exceeds 10 characters.
|
|
||||||
|
In this example, the `doSomething()` method updates the screen when the hero name exceeds 10 characters, but waits a tick before updating `comment`.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/after-view.component.ts" region="do-something" header="AfterViewComponent (doSomething)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/after-view.component.ts" region="do-something" header="AfterViewComponent (doSomething)"></code-example>
|
||||||
|
|
||||||
Why does the `doSomething()` method wait a tick before updating `comment`?
|
Both the `AfterViewInit()` and `AfterViewChecked()` hooks fire after the component's view has been composed.
|
||||||
|
If you modify the code so that the hook updates the component's data-bound `comment` property immediately, you can see that Angular throws an error.
|
||||||
|
|
||||||
Angular's unidirectional data flow rule forbids updates to the view *after* it has been composed.
|
The `LoggerService.tick_then()` statement postpones the log update
|
||||||
Both of these hooks fire _after_ the component's view has been composed.
|
for one turn of the browser's JavaScript cycle, which triggers a new change-detection cycle.
|
||||||
|
|
||||||
Angular throws an error if the hook updates the component's data-bound `comment` property immediately (try it!).
|
#### Write lean hook methods to avoid performance problems
|
||||||
The `LoggerService.tick_then()` postpones the log update
|
|
||||||
for one turn of the browser's JavaScript cycle and that's just long enough.
|
|
||||||
|
|
||||||
Here's *AfterView* in action:
|
When you run the *AfterView* sample, notice how frequently Angular calls `AfterViewChecked()`$emdash;often when there are no changes of interest.
|
||||||
|
Be very careful about how much logic or computation you put into one of these methods.
|
||||||
|
|
||||||
<div class="lightbox">
|
<div class="lightbox">
|
||||||
|
|
||||||
<img src='generated/images/guide/lifecycle-hooks/after-view-anim.gif' alt="AfterView">
|
<img src='generated/images/guide/lifecycle-hooks/after-view-anim.gif' alt="AfterView">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Notice that Angular frequently calls `AfterViewChecked()`, often when there are no changes of interest.
|
|
||||||
Write lean hook methods to avoid performance problems.
|
|
||||||
|
|
||||||
{@a aftercontent}
|
{@a aftercontent}
|
||||||
|
{@a aftercontent-hooks}
|
||||||
## AfterContent
|
|
||||||
|
|
||||||
The *AfterContent* sample explores the `AfterContentInit()` and `AfterContentChecked()` hooks that Angular calls
|
|
||||||
*after* Angular projects external content into the component.
|
|
||||||
|
|
||||||
{@a content-projection}
|
{@a content-projection}
|
||||||
|
|
||||||
### Content projection
|
### Responding to projected content changes
|
||||||
|
|
||||||
*Content projection* is a way to import HTML content from outside the component and insert that content
|
*Content projection* is a way to import HTML content from outside the component and insert that content
|
||||||
into the component's template in a designated spot.
|
into the component's template in a designated spot.
|
||||||
|
You can identify content projection in a template by looking for the following constructs.
|
||||||
|
|
||||||
|
* HTML between component element tags.
|
||||||
|
* The presence of `<ng-content>` tags in the component's template.
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
@ -554,9 +524,12 @@ into the component's template in a designated spot.
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Consider this variation on the [previous _AfterView_](guide/lifecycle-hooks#afterview) example.
|
The *AfterContent* sample explores the `AfterContentInit()` and `AfterContentChecked()` hooks that Angular calls *after* Angular projects external content into the component.
|
||||||
|
|
||||||
|
Consider this variation on the [previous _AfterView_](#afterview) example.
|
||||||
This time, instead of including the child view within the template, it imports the content from
|
This time, instead of including the child view within the template, it imports the content from
|
||||||
the `AfterContentComponent`'s parent. Here's the parent's template:
|
the `AfterContentComponent`'s parent.
|
||||||
|
The following is the parent's template.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="parent-template" header="AfterContentParentComponent (template excerpt)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="parent-template" header="AfterContentParentComponent (template excerpt)"></code-example>
|
||||||
|
|
||||||
@ -564,7 +537,7 @@ Notice that the `<app-child>` tag is tucked between the `<after-content>` tags.
|
|||||||
Never put content between a component's element tags *unless you intend to project that content
|
Never put content between a component's element tags *unless you intend to project that content
|
||||||
into the component*.
|
into the component*.
|
||||||
|
|
||||||
Now look at the component's template:
|
Now look at the component's template.
|
||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="template" header="AfterContentComponent (template)"></code-example>
|
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="template" header="AfterContentComponent (template)"></code-example>
|
||||||
|
|
||||||
@ -576,18 +549,8 @@ In this case, the projected content is the `<app-child>` from the parent.
|
|||||||
<img src='generated/images/guide/lifecycle-hooks/projected-child-view.png' alt="Projected Content">
|
<img src='generated/images/guide/lifecycle-hooks/projected-child-view.png' alt="Projected Content">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert is-helpful">
|
|
||||||
|
|
||||||
The telltale signs of *content projection* are twofold:
|
#### Using AfterContent hooks
|
||||||
|
|
||||||
* HTML between component element tags.
|
|
||||||
* The presence of `<ng-content>` tags in the component's template.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{@a aftercontent-hooks}
|
|
||||||
|
|
||||||
### AfterContent hooks
|
|
||||||
|
|
||||||
*AfterContent* hooks are similar to the *AfterView* hooks.
|
*AfterContent* hooks are similar to the *AfterView* hooks.
|
||||||
The key difference is in the child component.
|
The key difference is in the child component.
|
||||||
@ -606,11 +569,44 @@ which can only be reached by querying for them via the property decorated with
|
|||||||
|
|
||||||
{@a no-unidirectional-flow-worries}
|
{@a no-unidirectional-flow-worries}
|
||||||
|
|
||||||
### No unidirectional flow worries with _AfterContent_
|
<div class="alert is-helpful>
|
||||||
|
|
||||||
This component's `doSomething()` method update's the component's data-bound `comment` property immediately.
|
<header>No need to wait for content updates</header>
|
||||||
There's no [need to wait](guide/lifecycle-hooks#wait-a-tick).
|
|
||||||
|
|
||||||
Recall that Angular calls both *AfterContent* hooks before calling either of the *AfterView* hooks.
|
This component's `doSomething()` method updates the component's data-bound `comment` property immediately.
|
||||||
|
There's no need to [delay the update to ensure proper rendering](#wait-a-tick "Delaying updates").
|
||||||
|
|
||||||
|
Angular calls both *AfterContent* hooks before calling either of the *AfterView* hooks.
|
||||||
Angular completes composition of the projected content *before* finishing the composition of this component's view.
|
Angular completes composition of the projected content *before* finishing the composition of this component's view.
|
||||||
There is a small window between the `AfterContent...` and `AfterView...` hooks to modify the host view.
|
There is a small window between the `AfterContent...` and `AfterView...` hooks that allows you to modify the host view.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a docheck}
|
||||||
|
|
||||||
|
## Defining custom change detection
|
||||||
|
|
||||||
|
To monitor changes that occur where `ngOnChanges()` won't catch them, you can implement your own change check, as shown in the *DoCheck* example.
|
||||||
|
This example shows how you can use the `ngDoCheck()` hook to detect and act upon changes that Angular doesn't catch on its own.
|
||||||
|
|
||||||
|
The *DoCheck* sample extends the *OnChanges* sample with the following `ngDoCheck()` hook:
|
||||||
|
|
||||||
|
<code-example path="lifecycle-hooks/src/app/do-check.component.ts" region="ng-do-check" header="DoCheckComponent (ngDoCheck)"></code-example>
|
||||||
|
|
||||||
|
This code inspects certain _values of interest_, capturing and comparing their current state against previous values.
|
||||||
|
It writes a special message to the log when there are no substantive changes to the `hero` or the `power` so you can see how often `DoCheck()` is called.
|
||||||
|
The results are illuminating.
|
||||||
|
|
||||||
|
<div class="lightbox">
|
||||||
|
<img src='generated/images/guide/lifecycle-hooks/do-check-anim.gif' alt="DoCheck">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
While the `ngDoCheck()` hook can detect when the hero's `name` has changed, it is very expensive.
|
||||||
|
This hook is called with enormous frequency—after _every_
|
||||||
|
change detection cycle no matter where the change occurred.
|
||||||
|
It's called over twenty times in this example before the user can do anything.
|
||||||
|
|
||||||
|
Most of these initial checks are triggered by Angular's first rendering of *unrelated data elsewhere on the page*.
|
||||||
|
Just moving the cursor into another `<input>` triggers a call.
|
||||||
|
Relatively few calls reveal actual changes to pertinent data.
|
||||||
|
If you use this hook, your implementation must be extremely lightweight or the user experience suffers.
|
||||||
|
@ -53,11 +53,11 @@ With dynamic queries (`static: false`), the query resolves after either `ngAfter
|
|||||||
The result will be updated for changes to your view, such as changes to `ngIf` and `ngFor` blocks.
|
The result will be updated for changes to your view, such as changes to `ngIf` and `ngFor` blocks.
|
||||||
|
|
||||||
For more information, see the following entries in the
|
For more information, see the following entries in the
|
||||||
[Static Query Migration Guide](https://angular.io/guide/static-query-migration):
|
[Static Query Migration Guide](guide/static-query-migration):
|
||||||
|
|
||||||
* [How do I choose which `static` flag value to use: `true` or `false`?](https://angular.io/guide/static-query-migration#how-do-i-choose-which-static-flag-value-to-use-true-or-false)
|
* [How do I choose which `static` flag value to use: `true` or `false`?](guide/static-query-migration#how-do-i-choose-which-static-flag-value-to-use-true-or-false)
|
||||||
|
|
||||||
* [Is there a case where I should use `{static: true}`?](https://angular.io/guide/static-query-migration#is-there-a-case-where-i-should-use-static-true)
|
* [Is there a case where I should use `{static: true}`?](guide/static-query-migration#is-there-a-case-where-i-should-use-static-true)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ The following table summarizes the `@NgModule` metadata properties.
|
|||||||
|
|
||||||
Angular automatically adds components in the module's `bootstrap` and route definitions into the `entryComponents` list.
|
Angular automatically adds components in the module's `bootstrap` and route definitions into the `entryComponents` list.
|
||||||
|
|
||||||
That leaves only components bootstrapped using one of the imperative techniques, such as [`ViewComponentRef.createComponent()`](https://angular.io/api/core/ViewContainerRef#createComponent) as undiscoverable.
|
That leaves only components bootstrapped using one of the imperative techniques, such as [`ViewComponentRef.createComponent()`](api/core/ViewContainerRef#createComponent) as undiscoverable.
|
||||||
|
|
||||||
Dynamic component loading is not common in most apps beyond the router. If you need to dynamically load components, you must add these components to the `entryComponents` list yourself.
|
Dynamic component loading is not common in most apps beyond the router. If you need to dynamically load components, you must add these components to the `entryComponents` list yourself.
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ Angular provides an `EventEmitter` class that is used when publishing values fro
|
|||||||
`EventEmitter` extends [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject), adding an `emit()` method so it can send arbitrary values.
|
`EventEmitter` extends [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject), adding an `emit()` method so it can send arbitrary values.
|
||||||
When you call `emit()`, it passes the emitted value to the `next()` method of any subscribed observer.
|
When you call `emit()`, it passes the emitted value to the `next()` method of any subscribed observer.
|
||||||
|
|
||||||
A good example of usage can be found in the [EventEmitter](https://angular.io/api/core/EventEmitter) documentation. Here is the example component that listens for open and close events:
|
A good example of usage can be found in the [EventEmitter](api/core/EventEmitter) documentation. Here is the example component that listens for open and close events:
|
||||||
|
|
||||||
`<zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>`
|
`<zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>`
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ Angular’s `HttpClient` returns observables from HTTP method calls. For instanc
|
|||||||
|
|
||||||
## Async pipe
|
## Async pipe
|
||||||
|
|
||||||
The [AsyncPipe](https://angular.io/api/common/AsyncPipe) subscribes to an observable or promise and returns the latest value it has emitted. When a new value is emitted, the pipe marks the component to be checked for changes.
|
The [AsyncPipe](api/common/AsyncPipe) subscribes to an observable or promise and returns the latest value it has emitted. When a new value is emitted, the pipe marks the component to be checked for changes.
|
||||||
|
|
||||||
The following example binds the `time` observable to the component's view. The observable continuously updates the view with the current time.
|
The following example binds the `time` observable to the component's view. The observable continuously updates the view with the current time.
|
||||||
|
|
||||||
@ -38,16 +38,16 @@ The following example binds the `time` observable to the component's view. The o
|
|||||||
|
|
||||||
## Router
|
## Router
|
||||||
|
|
||||||
[`Router.events`](https://angular.io/api/router/Router#events) provides events as observables. You can use the `filter()` operator from RxJS to look for events of interest, and subscribe to them in order to make decisions based on the sequence of events in the navigation process. Here's an example:
|
[`Router.events`](api/router/Router#events) provides events as observables. You can use the `filter()` operator from RxJS to look for events of interest, and subscribe to them in order to make decisions based on the sequence of events in the navigation process. Here's an example:
|
||||||
|
|
||||||
<code-example path="observables-in-angular/src/main.ts" header="Router events" region="router"></code-example>
|
<code-example path="observables-in-angular/src/main.ts" header="Router events" region="router"></code-example>
|
||||||
|
|
||||||
The [ActivatedRoute](https://angular.io/api/router/ActivatedRoute) is an injected router service that makes use of observables to get information about a route path and parameters. For example, `ActivatedRoute.url` contains an observable that reports the route path or paths. Here's an example:
|
The [ActivatedRoute](api/router/ActivatedRoute) is an injected router service that makes use of observables to get information about a route path and parameters. For example, `ActivatedRoute.url` contains an observable that reports the route path or paths. Here's an example:
|
||||||
|
|
||||||
<code-example path="observables-in-angular/src/main.ts" header="ActivatedRoute" region="activated_route"></code-example>
|
<code-example path="observables-in-angular/src/main.ts" header="ActivatedRoute" region="activated_route"></code-example>
|
||||||
|
|
||||||
## Reactive forms
|
## Reactive forms
|
||||||
|
|
||||||
Reactive forms have properties that use observables to monitor form control values. The [`FormControl`](https://angular.io/api/forms/FormControl) properties `valueChanges` and `statusChanges` contain observables that raise change events. Subscribing to an observable form-control property is a way of triggering application logic within the component class. For example:
|
Reactive forms have properties that use observables to monitor form control values. The [`FormControl`](api/forms/FormControl) properties `valueChanges` and `statusChanges` contain observables that raise change events. Subscribing to an observable form-control property is a way of triggering application logic within the component class. For example:
|
||||||
|
|
||||||
<code-example path="observables-in-angular/src/main.ts" header="Reactive forms" region="forms"></code-example>
|
<code-example path="observables-in-angular/src/main.ts" header="Reactive forms" region="forms"></code-example>
|
||||||
|
@ -58,8 +58,8 @@ Though you can provide services by lazy loading modules, not all services can be
|
|||||||
Another way to limit provider scope is by adding the service you want to limit to the component’s
|
Another way to limit provider scope is by adding the service you want to limit to the component’s
|
||||||
`providers` array. Component providers and NgModule providers are independent of each other. This
|
`providers` array. Component providers and NgModule providers are independent of each other. This
|
||||||
method is helpful when you want to eagerly load a module that needs a service all to itself.
|
method is helpful when you want to eagerly load a module that needs a service all to itself.
|
||||||
Providing a service in the component limits the service only to that component (other components in
|
Providing a service in the component limits the service only to that component and its descendants.
|
||||||
the same module can’t access it).
|
Other components in the same module can’t access it.
|
||||||
|
|
||||||
<code-example path="providers/src/app/app.component.ts" region="component-providers" header="src/app/app.component.ts"></code-example>
|
<code-example path="providers/src/app/app.component.ts" region="component-providers" header="src/app/app.component.ts"></code-example>
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ A basic understanding of the following concepts:
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
The [AnimationOptions](https://angular.io/api/animations/AnimationOptions) interface in Angular animations enables you to create animations that you can reuse across different components.
|
The [AnimationOptions](api/animations/AnimationOptions) interface in Angular animations enables you to create animations that you can reuse across different components.
|
||||||
|
|
||||||
## Creating reusable animations
|
## Creating reusable animations
|
||||||
|
|
||||||
To create a reusable animation, use the [`animation()`](https://angular.io/api/animations/animation) method to define an animation in a separate `.ts` file and declare this animation definition as a `const` export variable. You can then import and reuse this animation in any of your app components using the [`useAnimation()`](https://angular.io/api/animations/useAnimation) API.
|
To create a reusable animation, use the [`animation()`](api/animations/animation) method to define an animation in a separate `.ts` file and declare this animation definition as a `const` export variable. You can then import and reuse this animation in any of your app components using the [`useAnimation()`](api/animations/useAnimation) API.
|
||||||
|
|
||||||
<code-example path="animations/src/app/animations.ts" header="src/app/animations.ts" region="reusable" language="typescript"></code-example>
|
<code-example path="animations/src/app/animations.ts" header="src/app/animations.ts" region="reusable" language="typescript"></code-example>
|
||||||
|
|
||||||
|
@ -1,262 +0,0 @@
|
|||||||
# Using Angular routes in a single-page application
|
|
||||||
|
|
||||||
This tutorial describes how you can build a single-page application, SPA that uses multiple Angular routes.
|
|
||||||
|
|
||||||
|
|
||||||
In an SPA, all of your application's functions exist in a single HTML page.
|
|
||||||
As users access your application's features, the browser needs to render only the parts that matter to the user, instead of loading a new page. This pattern can significantly improve your application's user exprience.
|
|
||||||
|
|
||||||
To define how users navigate through your application, you use routes. You can add routes to define how users navigate from one part of your application to another.
|
|
||||||
You can also configure routes to guard against unexpected or unauthorized behavior.
|
|
||||||
|
|
||||||
To explore a sample app featuring the contents of this tutorial, see the <live-example></live-example>.
|
|
||||||
|
|
||||||
## Objectives
|
|
||||||
|
|
||||||
* Organize a sample application's features into modules.
|
|
||||||
* Define how to navigate to a component.
|
|
||||||
* Pass information to a component using a parameter.
|
|
||||||
* Structure routes by nesting several routes.
|
|
||||||
* Check whether users can access a route.
|
|
||||||
* Control whether the application can discard unsaved changes.
|
|
||||||
* Improve performance by pre-fetching route data and lazy loading feature modules.
|
|
||||||
* Require specific criteria to load components.
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
To complete this tutorial, you should have a basic understanding of the following concepts:
|
|
||||||
|
|
||||||
* JavaScript
|
|
||||||
* HTML
|
|
||||||
* CSS
|
|
||||||
* [Angular CLI](/cli)
|
|
||||||
|
|
||||||
You might find the [Tour of Heroes tutorial](/tutorial) helpful, but it is not required.
|
|
||||||
|
|
||||||
## Create a sample application
|
|
||||||
|
|
||||||
Using the Angular CLI, create a new application, _angular-router-sample_. This application will have two components: _crisis-list_ and _heroes-list_.
|
|
||||||
|
|
||||||
1. Create a new Angular project, _angular-router-sample_.
|
|
||||||
|
|
||||||
<code-example language="sh">
|
|
||||||
ng new angular-router-sample
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
When prompted with `Would you like to add Angular routing?`, select `N`.
|
|
||||||
|
|
||||||
When prompted with `Which stylesheet format would you like to use?`, select `CSS`.
|
|
||||||
|
|
||||||
After a few moments, a new project, `angular-router-sample`, is ready.
|
|
||||||
|
|
||||||
1. From your terminal, navigate to the `angular-router-sample` directory.
|
|
||||||
|
|
||||||
1. Create a component, _crisis-list_.
|
|
||||||
|
|
||||||
<code-example language="sh">
|
|
||||||
ng generate component crisis-list
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
1. In your code editor, locate the file, `crisis-list.component.html` and replace
|
|
||||||
the placeholder content with the following HTML.
|
|
||||||
|
|
||||||
<code-example header="src/app/crisis-list/crisis-list.component.html" path="router-tutorial/src/app/crisis-list/crisis-list.component.html"></code-example>
|
|
||||||
|
|
||||||
1. Create a second component, _heroes-list_.
|
|
||||||
|
|
||||||
<code-example language="sh">
|
|
||||||
ng generate component heroes-list
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
1. In your code editor, locate the file, `heroes-list.component.html` and replace the placeholder content with the following HTML.
|
|
||||||
|
|
||||||
<code-example header="src/app/heroes-list/heroes-list.component.html" path="router-tutorial/src/app/heroes-list/heroes-list.component.html"></code-example>
|
|
||||||
|
|
||||||
1. In your code editor, open the file, `app.component.html` and replace its contents with the following HTML.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.html" path="router-tutorial/src/app/app.component.html" region="setup"></code-example>
|
|
||||||
|
|
||||||
1. Verify that your new application runs as expected by running the `ng serve` command.
|
|
||||||
|
|
||||||
<code-example language="sh">
|
|
||||||
ng serve
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
1. Open a browser to `http://localhost:4200`.
|
|
||||||
|
|
||||||
You should see a single web page, consisting of a title and the HTML of your two components.
|
|
||||||
|
|
||||||
## Import `RouterModule` from `@angular/router`
|
|
||||||
|
|
||||||
Routing allows you to display specific views of your application depending on the URL path.
|
|
||||||
To add this functionality to your sample application, you need to update the `app.module.ts` file to use the module, `RouterModule`.
|
|
||||||
You import this module from `@angular/router`.
|
|
||||||
|
|
||||||
1. From your code editor, open the `app.module.ts` file.
|
|
||||||
|
|
||||||
1. Add the following `import` statement.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.module.ts" path="router-tutorial/src/app/app.module.ts" region="router-import"></code-example>
|
|
||||||
|
|
||||||
## Define your routes
|
|
||||||
|
|
||||||
In this section, you'll define two routes:
|
|
||||||
|
|
||||||
* The route `/crisis-center` opens the `crisis-center` component.
|
|
||||||
* The route `/heroes-list` opens the `heroes-list` component.
|
|
||||||
|
|
||||||
A route definition is a JavaScript object. Each route typically has two propteries. The first property, `path`, is a string
|
|
||||||
that specifies the URL path for the route. The second property, `component`, is a string that specifies
|
|
||||||
what component your application should display for that path.
|
|
||||||
|
|
||||||
1. From your code editor, open the `app.module.ts` file.
|
|
||||||
|
|
||||||
1. Locate the `@NgModule()` section.
|
|
||||||
|
|
||||||
1. Replace the `imports` array in that section with the following.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.module.ts" path="router-tutorial/src/app/app.module.ts" region="import-basic"></code-example>
|
|
||||||
|
|
||||||
This code adds the `RouterModule` to the `imports` array. Next, the code uses the `forRoot()` method of the `RouterModule` to
|
|
||||||
define your two routes. This method takes an array of JavaScript objects, with each object defining the proprties of a route.
|
|
||||||
The `forRoot()` method ensures that your application only instantiates one `RouterModule`. For more information, see
|
|
||||||
[Singleton Services](/guide/singleton-services#forroot-and-the-router).
|
|
||||||
|
|
||||||
## Update your component with `router-outlet`
|
|
||||||
|
|
||||||
At this point, you have defined two routes for your application. However, your application
|
|
||||||
still has both the `crisis-list` and `heroes-list` components hard-coded in your `app.component.html` template. For your routes to
|
|
||||||
work, you need to update your template to dynamically load a component based on the URL path.
|
|
||||||
|
|
||||||
To implement this functionality, you add the `router-outlet` directive to your template file.
|
|
||||||
|
|
||||||
1. From your code editor, open the `app.component.html` file.
|
|
||||||
|
|
||||||
1. Delete the following lines.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.html" path="router-tutorial/src/app/app.component.html" region="components"></code-example>
|
|
||||||
|
|
||||||
1. Add the `router-outlet` directive.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.html" path="router-tutorial/src/app/app.component.html" region="router-outlet"></code-example>
|
|
||||||
|
|
||||||
View your updated application in your browser. You should see only the application title. To
|
|
||||||
view the `crisis-list` component, add `crisis-list` to the end of the path in your browser's
|
|
||||||
address bar. For example:
|
|
||||||
|
|
||||||
<code-example language="none">
|
|
||||||
http://localhost:4200/crisis-list
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Notice that the `crisis-list` component displays. Angular is using the route you defined to dynamically load the
|
|
||||||
component. You can load the `heroes-list` component the same way:
|
|
||||||
|
|
||||||
<code-example language="none">
|
|
||||||
http://localhost:4200/heroes-list
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
## Control navigation with UI elements
|
|
||||||
|
|
||||||
Currently, your application supports two routes. However, the only way to use those routes
|
|
||||||
is for the user to manually type the path in the browser's address bar. In this section, you'll
|
|
||||||
add two links that users can click to navigate between the `heroes-list` and `crisis-list`
|
|
||||||
components. You'll also add some CSS styles. While these styles are not required, they make
|
|
||||||
it easier to identify the link for the currently-displayed component. You'll add that functionality
|
|
||||||
in the next section.
|
|
||||||
|
|
||||||
1. Open the `app.component.html` file and add the following HTML below the title.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.html" path="router-tutorial/src/app/app.component.html" region="nav"></code-example>
|
|
||||||
|
|
||||||
This HTML uses an Angular directive, `routerLink`. This directive connects the routes
|
|
||||||
you defined to your template files.
|
|
||||||
|
|
||||||
1. Open the `app.component.css` file and add the following styles.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.css" path="router-tutorial/src/app/app.component.css"></code-example>
|
|
||||||
|
|
||||||
|
|
||||||
If you view your application in the browser, you should see these two links. When you click
|
|
||||||
on a link, the corresponding component appears.
|
|
||||||
|
|
||||||
## Identify the active route
|
|
||||||
|
|
||||||
While users can navigate your application using the links you added in the previous section,
|
|
||||||
they don't have an easy way to identify what the active route is. You can add this functionality
|
|
||||||
using Angular's `routerLinkActive` directive.
|
|
||||||
|
|
||||||
1. From your code editor, open the `app.component.html` file.
|
|
||||||
|
|
||||||
1. Update the anchor tags to include the `routerLinkActive` directive.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.component.html" path="router-tutorial/src/app/app.component.html" region="routeractivelink"></code-example>
|
|
||||||
|
|
||||||
View your application again. As you click one of the buttons, the style for that button updates
|
|
||||||
automatically, identifying the active component to the user. By adding the `routerLinkActive`
|
|
||||||
directive, you inform your application to apply a specific CSS class to the active route. In this
|
|
||||||
tutorial, that CSS class is `activebutton`, but you could use any class that you want.
|
|
||||||
|
|
||||||
## Adding a redirect
|
|
||||||
|
|
||||||
In this step of the tutorial, you add a route that redirects the user to display the `/heroes-list` component.
|
|
||||||
|
|
||||||
1. From your code editor, open the `app.module.ts` file.
|
|
||||||
|
|
||||||
1. In the `imports` array, update the `RouterModule` section as follows.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.module.ts" path="router-tutorial/src/app/app.module.ts" region="import-redirect"></code-example>
|
|
||||||
|
|
||||||
Notice that this new route uses an empty string as its path. In addition, it replaces the `component` property with two new ones:
|
|
||||||
|
|
||||||
* `redirectTo`. This property instructs Angular to redirect from an empty path to the
|
|
||||||
`heroes-list` path.
|
|
||||||
* `pathMatch`. This property instructs Angular on how much of the URL to match. For this
|
|
||||||
tutorial, you should set this property to `full`. This strategy is recommended when
|
|
||||||
you have an empty string for a path. For more information about this property,
|
|
||||||
see the [Route API documentation](/api/router/Route).
|
|
||||||
|
|
||||||
Now when you open your application, it displays the `heroes-list` component by default.
|
|
||||||
|
|
||||||
## Adding a 404 page
|
|
||||||
|
|
||||||
It is possible for a user to try to access a route that you have not defined. To account for
|
|
||||||
this behavior, a best practice is to display a 404 page. In this section, you'll create a 404 page and
|
|
||||||
update your route configuration to show that page for any unspecified routes.
|
|
||||||
|
|
||||||
1. From the terminal, create a new component, `PageNotFound`.
|
|
||||||
|
|
||||||
<code-example language="sh">
|
|
||||||
ng generate component page-not-found
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
1. From your code editor, open the `page-not-found.component.html` file and replace its contents
|
|
||||||
with the following HTML.
|
|
||||||
|
|
||||||
<code-example header="src/app/page-not-found/page-not-found.component.html" path="router-tutorial/src/app/page-not-found/page-not-found.component.html"></code-example>
|
|
||||||
|
|
||||||
1. Open the `app.module.ts` file. In the `imports` array, update the `RouterModule` section as follows.
|
|
||||||
|
|
||||||
<code-example header="src/app/app.module.ts" path="router-tutorial/src/app/app.module.ts" region="import-wildcard"></code-example>
|
|
||||||
|
|
||||||
The new route uses a path, `**`. This path is how Angular identifies a wildcard route. Any route
|
|
||||||
that does not match an existing route in your configuration will use this route.
|
|
||||||
|
|
||||||
<div class="alert is-important">
|
|
||||||
Notice that the wildcard route is placed at the end of the array. The order of your
|
|
||||||
routes is important, as Angular applies routes in order and uses the first match it finds.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Try navigating to a non-existing route on your application, such as `http://localhost:4200/powers`.
|
|
||||||
This route doesn't match anything defined in your `app.module.ts` file. However, because you
|
|
||||||
defined a wildcard route, the application automatically displays your `PageNotFound` component.
|
|
||||||
|
|
||||||
## Next steps
|
|
||||||
|
|
||||||
At this point, you have a basic application that uses Angular's routing feature to change
|
|
||||||
what components the user can see based on the URL address. You have extended these features
|
|
||||||
to include a redirect, as well as a wildcard route to display a custom 404 page.
|
|
||||||
|
|
||||||
For more information about routing, see the following topics:
|
|
||||||
|
|
||||||
* [In-app Routing and Navigation](/guide/router)
|
|
||||||
* [Router API](/api/router)
|
|
@ -169,7 +169,7 @@ To get information from a route:
|
|||||||
|
|
||||||
<code-example header="In the component (excerpt)">
|
<code-example header="In the component (excerpt)">
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.activatedRoute.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
this.name = params['name'];
|
this.name = params['name'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -357,130 +357,12 @@ Inject `ActivatedRoute` and `Router` in the constructor of the component class s
|
|||||||
|
|
||||||
{@a lazy-loading}
|
{@a lazy-loading}
|
||||||
|
|
||||||
## Lazy loading modules
|
## Lazy loading
|
||||||
|
|
||||||
To lazy load Angular modules, use `loadchildren` (instead of `component`) in your `AppRoutingModule` `routes` configuration as follows:
|
You can configure your routes to lazy load modules, which means that Angular only loads modules as needed, rather than loading all modules when the app launches.
|
||||||
|
Additionally, you can preload parts of your app in the background to improve the user experience.
|
||||||
<code-example header="AppRoutingModule (excerpt)">
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: 'items',
|
|
||||||
loadChildren: () => import('./items/items.module').then(m => m.ItemsModule)
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
In the lazy loaded module's routing module, add a route for the component.
|
|
||||||
|
|
||||||
<code-example header="Routing module for lazy loaded module (excerpt)">
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: ItemsComponent
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Also be sure to remove the `ItemsModule` from the `AppModule`. For more information on lazy loading modules see [Lazy-loading feature modules](guide/lazy-loading-ngmodules).
|
|
||||||
|
|
||||||
|
|
||||||
{@a preloading}
|
|
||||||
|
|
||||||
## Preloading
|
|
||||||
|
|
||||||
Preloading improves UX by loading parts of your app in the background. You can preload modules or component data.
|
|
||||||
|
|
||||||
### Preloading modules
|
|
||||||
|
|
||||||
To enable preloading of all lazy loaded modules, import the `PreloadAllModules` token from the Angular `router`.
|
|
||||||
|
|
||||||
<code-example header="AppRoutingModule (excerpt)">
|
|
||||||
|
|
||||||
import { PreloadAllModules } from '@angular/router';
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Still in the `AppRoutingModule`, specify your preloading strategy in `forRoot()`.
|
|
||||||
|
|
||||||
<code-example header="AppRoutingModule (excerpt)">
|
|
||||||
|
|
||||||
RouterModule.forRoot(
|
|
||||||
appRoutes,
|
|
||||||
{
|
|
||||||
preloadingStrategy: PreloadAllModules
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
### Preloading component data
|
|
||||||
|
|
||||||
You can preload component data so that all elements and data on a page render at the same time when the user activates a route. To preload component data, you can use a `resolver`.
|
|
||||||
|
|
||||||
#### Resolvers
|
|
||||||
|
|
||||||
Create a resolver service. With the CLI, the command to generate a service is as follows:
|
|
||||||
|
|
||||||
|
|
||||||
<code-example language="none" class="code-shell">
|
|
||||||
ng generate service <service-name>
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
In your service, import the following router members, implement `Resolve`, and inject the `Router` service:
|
|
||||||
|
|
||||||
<code-example header="Resolver service (excerpt)">
|
|
||||||
|
|
||||||
import { Resolve } from '@angular/router';
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
export class CrisisDetailResolverService implements Resolve<> {
|
|
||||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<> {
|
|
||||||
// your logic goes here
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Import this resolver into your module's routing module.
|
|
||||||
|
|
||||||
<code-example header="Feature module's routing module (excerpt)">
|
|
||||||
|
|
||||||
import { YourResolverService } from './your-resolver.service';
|
|
||||||
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Add a `resolve` object to the component's `route` configuration.
|
|
||||||
|
|
||||||
<code-example header="Feature module's routing module (excerpt)">
|
|
||||||
{
|
|
||||||
path: '/your-path',
|
|
||||||
component: YourComponent,
|
|
||||||
resolve: {
|
|
||||||
crisis: YourResolverService
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
|
|
||||||
In the component, use an observable to get the data from the `ActivatedRoute`.
|
|
||||||
|
|
||||||
|
|
||||||
<code-example header="Component (excerpt)">
|
|
||||||
ngOnInit() {
|
|
||||||
this.route.data
|
|
||||||
.subscribe((your-parameters) => {
|
|
||||||
// your data-specific code goes here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
For more information with a working example, see the [routing tutorial section on preloading](guide/router#preloading-background-loading-of-feature-areas).
|
|
||||||
|
|
||||||
|
For more information on lazy loading and preloading see the dedicated guide [Lazy loading NgModules](guide/lazy-loading-ngmodules).
|
||||||
|
|
||||||
## Preventing unauthorized access
|
## Preventing unauthorized access
|
||||||
|
|
||||||
@ -2956,7 +2838,7 @@ Update the `CrisisDetailComponent` to get the crisis from the `ActivatedRoute.d
|
|||||||
|
|
||||||
<code-example path="router/src/app/crisis-center/crisis-detail/crisis-detail.component.ts" header="src/app/crisis-center/crisis-detail/crisis-detail.component.ts (ngOnInit v2)" region="ngOnInit"></code-example>
|
<code-example path="router/src/app/crisis-center/crisis-detail/crisis-detail.component.ts" header="src/app/crisis-center/crisis-detail/crisis-detail.component.ts (ngOnInit v2)" region="ngOnInit"></code-example>
|
||||||
|
|
||||||
Note the following three important points:
|
Note the following two important points:
|
||||||
|
|
||||||
1. The router's `Resolve` interface is optional.
|
1. The router's `Resolve` interface is optional.
|
||||||
The `CrisisDetailResolverService` doesn't inherit from a base class.
|
The `CrisisDetailResolverService` doesn't inherit from a base class.
|
||||||
@ -2964,8 +2846,6 @@ The router looks for that method and calls it if found.
|
|||||||
|
|
||||||
1. The router calls the resolver in any case where the the user could navigate away so you don't have to code for each use case.
|
1. The router calls the resolver in any case where the the user could navigate away so you don't have to code for each use case.
|
||||||
|
|
||||||
1. Returning an empty `Observable` in at least one resolver will cancel navigation.
|
|
||||||
|
|
||||||
The relevant Crisis Center code for this milestone follows.
|
The relevant Crisis Center code for this milestone follows.
|
||||||
|
|
||||||
<code-tabs>
|
<code-tabs>
|
||||||
|
@ -61,7 +61,7 @@ If the current tab needs to be updated to the latest app version immediately, it
|
|||||||
|
|
||||||
<code-example path="service-worker-getting-started/src/app/prompt-update.service.ts" header="prompt-update.service.ts" region="sw-activate"></code-example>
|
<code-example path="service-worker-getting-started/src/app/prompt-update.service.ts" header="prompt-update.service.ts" region="sw-activate"></code-example>
|
||||||
|
|
||||||
Doing this could break lazy-loading into currently running apps, especially if the lazy-loaded chunks use filenames with hashes, which change every version.
|
Doing this could break lazy-loading in currently running apps, especially if the lazy-loaded chunks use filenames with hashes, which change every version.
|
||||||
|
|
||||||
## More on Angular service workers
|
## More on Angular service workers
|
||||||
|
|
||||||
|
@ -74,9 +74,6 @@ interface AssetGroup {
|
|||||||
files?: string[];
|
files?: string[];
|
||||||
urls?: string[];
|
urls?: string[];
|
||||||
};
|
};
|
||||||
cacheQueryOptions?: {
|
|
||||||
ignoreSearch?: boolean;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -113,12 +110,6 @@ This section describes the resources to cache, broken up into the following grou
|
|||||||
* `urls` includes both URLs and URL patterns that will be matched at runtime. These resources are not fetched directly and do not have content hashes, but they will be cached according to their HTTP headers. This is most useful for CDNs such as the Google Fonts service.<br>
|
* `urls` includes both URLs and URL patterns that will be matched at runtime. These resources are not fetched directly and do not have content hashes, but they will be cached according to their HTTP headers. This is most useful for CDNs such as the Google Fonts service.<br>
|
||||||
_(Negative glob patterns are not supported and `?` will be matched literally; i.e. it will not match any character other than `?`.)_
|
_(Negative glob patterns are not supported and `?` will be matched literally; i.e. it will not match any character other than `?`.)_
|
||||||
|
|
||||||
### `cacheQueryOptions`
|
|
||||||
|
|
||||||
These options are used to modify the matching behavior of requests. They are passed to the browsers `Cache#match` function. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match) for details. Currently, only the following options are supported:
|
|
||||||
|
|
||||||
* `ignoreSearch`: Ignore query parameters. Defaults to `false`.
|
|
||||||
|
|
||||||
## `dataGroups`
|
## `dataGroups`
|
||||||
|
|
||||||
Unlike asset resources, data requests are not versioned along with the app. They're cached according to manually-configured policies that are more useful for situations such as API requests and other data dependencies.
|
Unlike asset resources, data requests are not versioned along with the app. They're cached according to manually-configured policies that are more useful for situations such as API requests and other data dependencies.
|
||||||
@ -136,9 +127,6 @@ export interface DataGroup {
|
|||||||
timeout?: string;
|
timeout?: string;
|
||||||
strategy?: 'freshness' | 'performance';
|
strategy?: 'freshness' | 'performance';
|
||||||
};
|
};
|
||||||
cacheQueryOptions?: {
|
|
||||||
ignoreSearch?: boolean;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -193,10 +181,6 @@ The Angular service worker can use either of two caching strategies for data res
|
|||||||
|
|
||||||
* `freshness` optimizes for currency of data, preferentially fetching requested data from the network. Only if the network times out, according to `timeout`, does the request fall back to the cache. This is useful for resources that change frequently; for example, account balances.
|
* `freshness` optimizes for currency of data, preferentially fetching requested data from the network. Only if the network times out, according to `timeout`, does the request fall back to the cache. This is useful for resources that change frequently; for example, account balances.
|
||||||
|
|
||||||
### `cacheQueryOptions`
|
|
||||||
|
|
||||||
See [assetGroups](#assetgroups) for details.
|
|
||||||
|
|
||||||
## `navigationUrls`
|
## `navigationUrls`
|
||||||
|
|
||||||
This optional section enables you to specify a custom list of URLs that will be redirected to the index file.
|
This optional section enables you to specify a custom list of URLs that will be redirected to the index file.
|
||||||
|
@ -23,7 +23,7 @@ The above command completes the following actions:
|
|||||||
2. Enables service worker build support in the CLI.
|
2. Enables service worker build support in the CLI.
|
||||||
3. Imports and registers the service worker in the app module.
|
3. Imports and registers the service worker in the app module.
|
||||||
4. Updates the `index.html` file:
|
4. Updates the `index.html` file:
|
||||||
* Includes a link to add the `manifest.json` file.
|
* Includes a link to add the `manifest.webmanifest` file.
|
||||||
* Adds meta tags for `theme-color`.
|
* Adds meta tags for `theme-color`.
|
||||||
5. Installs icon files to support the installed Progressive Web App (PWA).
|
5. Installs icon files to support the installed Progressive Web App (PWA).
|
||||||
6. Creates the service worker configuration file called [`ngsw-config.json`](/guide/service-worker-config), which specifies the caching behaviors and other settings.
|
6. Creates the service worker configuration file called [`ngsw-config.json`](/guide/service-worker-config), which specifies the caching behaviors and other settings.
|
||||||
|
@ -44,7 +44,7 @@ For more information on how to choose, see the [next question](#how-do-i-choose)
|
|||||||
{@a how-do-i-choose}
|
{@a how-do-i-choose}
|
||||||
### How do I choose which `static` flag value to use: `true` or `false`?
|
### How do I choose which `static` flag value to use: `true` or `false`?
|
||||||
|
|
||||||
In the official API docs, we have always recommended retrieving query results in [`ngAfterViewInit` for view queries](https://angular.io/api/core/ViewChild#description) and [`ngAfterContentInit` for content queries](https://angular.io/api/core/ContentChild#description).
|
In the official API docs, we have always recommended retrieving query results in [`ngAfterViewInit` for view queries](api/core/ViewChild#description) and [`ngAfterContentInit` for content queries](api/core/ContentChild#description).
|
||||||
This is because by the time those lifecycle hooks run, change detection has completed for the relevant nodes and we can guarantee that we have collected all the possible query results.
|
This is because by the time those lifecycle hooks run, change detection has completed for the relevant nodes and we can guarantee that we have collected all the possible query results.
|
||||||
|
|
||||||
Most applications will want to use `{static: false}` for the same reason. This setting will ensure query matches that are dependent on binding resolution (e.g. results inside `*ngIf`s or `*ngFor`s) will be found by the query.
|
Most applications will want to use `{static: false}` for the same reason. This setting will ensure query matches that are dependent on binding resolution (e.g. results inside `*ngIf`s or `*ngFor`s) will be found by the query.
|
||||||
|
@ -832,6 +832,89 @@ When the `condition` is truthy, the top (A) paragraph is removed and the bottom
|
|||||||
<img src='generated/images/guide/structural-directives/unless-anim.gif' alt="UnlessDirective in action">
|
<img src='generated/images/guide/structural-directives/unless-anim.gif' alt="UnlessDirective in action">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{@a directive-type-checks}
|
||||||
|
|
||||||
|
## Improving template type checking for custom directives
|
||||||
|
|
||||||
|
You can improve template type checking for custom directives by adding template guard properties to your directive definition.
|
||||||
|
These properties help the Angular template type checker find mistakes in the template at compile time, which can avoid runtime errors those mistakes can cause.
|
||||||
|
|
||||||
|
Use the type-guard properties to inform the template type checker of an expected type, thus improving compile-time type-checking for that template.
|
||||||
|
|
||||||
|
* A property `ngTemplateGuard_(someInputProperty)` lets you specify a more accurate type for an input expression within the template.
|
||||||
|
* The `ngTemplateContextGuard` static property declares the type of the template context.
|
||||||
|
|
||||||
|
This section provides example of both kinds of type-guard property.
|
||||||
|
|
||||||
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
|
For more information, see [Template type checking guide](guide/template-typecheck "Template type-checking guide").
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{@a narrowing-input-types}
|
||||||
|
|
||||||
|
### Make in-template type requirements more specific with template guards
|
||||||
|
|
||||||
|
A structural directive in a template controls whether that template is rendered at run time, based on its input expression.
|
||||||
|
To help the compiler catch template type errors, you should specify as closely as possible the required type of a directive's input expression when it occurs inside the template.
|
||||||
|
|
||||||
|
A type guard function *narrows* the expected type of an input expression to a subset of types that might be passed to the directive within the template at run time.
|
||||||
|
You can provide such a function to help the type-checker infer the proper type for the expression at compile time.
|
||||||
|
|
||||||
|
For example, the `NgIf` implementation uses type-narrowing to ensure that the
|
||||||
|
template is only instantiated if the input expression to `*ngIf` is truthy.
|
||||||
|
To provide the specific type requirement, the `NgIf` directive defines a [static property `ngTemplateGuard_ngIf: 'binding'`](api/common/NgIf#static-properties).
|
||||||
|
The `binding` value is a special case for a common kind of type-narrowing where the input expression is evaluated in order to satisfy the type requirement.
|
||||||
|
|
||||||
|
To provide a more specific type for an input expression to a directive within the template, add a `ngTemplateGuard_xx` property to the directive, where the suffix to the static property name is the `@Input` field name.
|
||||||
|
The value of the property can be either a general type-narrowing function based on its return type, or the string `"binding"` as in the case of `NgIf`.
|
||||||
|
|
||||||
|
For example, consider the following structural directive that takes the result of a template expression as an input.
|
||||||
|
|
||||||
|
<code-example language="ts" header="IfLoadedDirective">
|
||||||
|
export type Loaded<T> = { type: 'loaded', data: T };
|
||||||
|
export type Loading = { type: 'loading' };
|
||||||
|
export type LoadingState<T> = Loaded<T> | Loading;
|
||||||
|
export class IfLoadedDirective<T> {
|
||||||
|
@Input('ifLoaded') set state(state: LoadingState<T>) {}
|
||||||
|
static ngTemplateGuard_state<T>(dir: IfLoadedDirective<T>, expr: LoadingState<T>): expr is Loaded<T> { return true; };
|
||||||
|
export interface Person {
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
template: `<div *ifLoaded="state">{{ state.data }}</div>`,
|
||||||
|
})
|
||||||
|
export class AppComponent {
|
||||||
|
state: LoadingState<Person>;
|
||||||
|
}
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
In this example, the `LoadingState<T>` type permits either of two states, `Loaded<T>` or `Loading`. The expression used as the directive’s `state` input is of the umbrella type `LoadingState`, as it’s unknown what the loading state is at that point.
|
||||||
|
|
||||||
|
The `IfLoadedDirective` definition declares the static field `ngTemplateGuard_state`, which expresses the narrowing behavior.
|
||||||
|
Within the `AppComponent` template, the `*ifLoaded` structural directive should render this template only when `state` is actually `Loaded<Person>`.
|
||||||
|
The type guard allows the type checker to infer that the acceptable type of `state` within the template is a `Loaded<T>`, and further infer that `T` must be an instance of `Person`.
|
||||||
|
|
||||||
|
{@a narrowing-context-type}
|
||||||
|
|
||||||
|
### Typing the directive's context
|
||||||
|
|
||||||
|
If your structural directive provides a context to the instantiated template, you can properly type it inside the template by providing a static `ngTemplateContextGuard` function.
|
||||||
|
The following snippet shows an example of such a function.
|
||||||
|
|
||||||
|
<code-example language="ts" header="myDirective.ts">
|
||||||
|
@Directive({…})
|
||||||
|
export class ExampleDirective {
|
||||||
|
// Make sure the template checker knows the type of the context with which the
|
||||||
|
// template of this directive will be rendered
|
||||||
|
static ngTemplateContextGuard(dir: ExampleDirective, ctx: unknown): ctx is ExampleContext { return true; };
|
||||||
|
|
||||||
|
// …
|
||||||
|
}
|
||||||
|
</code-example>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{@a summary}
|
{@a summary}
|
||||||
@ -879,7 +962,7 @@ Here is the source from the `src/app/` folder.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
You learned
|
You learned:
|
||||||
|
|
||||||
* that structural directives manipulate HTML layout.
|
* that structural directives manipulate HTML layout.
|
||||||
* to use [`<ng-container>`](guide/structural-directives#ngcontainer) as a grouping element when there is no suitable host element.
|
* to use [`<ng-container>`](guide/structural-directives#ngcontainer) as a grouping element when there is no suitable host element.
|
||||||
|
@ -432,7 +432,7 @@ Attributes can be changed by `setAttribute()`, which re-initializes correspondin
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
For more information, see the [MDN Interfaces documentation](https://developer.mozilla.org/en-US/docs/Web/API#Interfaces) which has API docs for all the standard DOM elements and their properties.
|
For more information, see the [MDN Interfaces documentation](https://developer.mozilla.org/en-US/docs/Web/API#Interfaces) which has API docs for all the standard DOM elements and their properties.
|
||||||
Comparing the [`<td>` attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) attributes to the [`<td>` properties](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement) provides a helpful example for differentiation.
|
Comparing the [`<td>` attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td) to the [`<td>` properties](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCellElement) provides a helpful example for differentiation.
|
||||||
In particular, you can navigate from the attributes page to the properties via "DOM interface" link, and navigate the inheritance hierarchy up to `HTMLTableCellElement`.
|
In particular, you can navigate from the attributes page to the properties via "DOM interface" link, and navigate the inheritance hierarchy up to `HTMLTableCellElement`.
|
||||||
|
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ To control the state of the button, set the `disabled` *property*,
|
|||||||
|
|
||||||
<div class="alert is-helpful">
|
<div class="alert is-helpful">
|
||||||
|
|
||||||
Though you could technically set the `[attr.disabled]` attribute binding, the values are different in that the property binding requires to a boolean value, while its corresponding attribute binding relies on whether the value is `null` or not. Consider the following:
|
Though you could technically set the `[attr.disabled]` attribute binding, the values are different in that the property binding requires to be a boolean value, while its corresponding attribute binding relies on whether the value is `null` or not. Consider the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input [disabled]="condition ? true : false">
|
<input [disabled]="condition ? true : false">
|
||||||
@ -1455,7 +1455,7 @@ Angular provides *value accessors* for all of the basic HTML form elements and t
|
|||||||
|
|
||||||
You can't apply `[(ngModel)]` to a non-form native element or a
|
You can't apply `[(ngModel)]` to a non-form native element or a
|
||||||
third-party custom component until you write a suitable value accessor. For more information, see
|
third-party custom component until you write a suitable value accessor. For more information, see
|
||||||
the API documentation on [DefaultValueAccessor](https://angular.io/api/forms/DefaultValueAccessor).
|
the API documentation on [DefaultValueAccessor](api/forms/DefaultValueAccessor).
|
||||||
|
|
||||||
You don't need a value accessor for an Angular component that
|
You don't need a value accessor for an Angular component that
|
||||||
you write because you can name the value and event properties
|
you write because you can name the value and event properties
|
||||||
|
@ -167,6 +167,8 @@ Here, during type checking of the template for `AppComponent`, the `[user]="sele
|
|||||||
Therefore, Angular assigns the `selectedUser` property to `UserDetailComponent.user`, which would result in an error if their types were incompatible.
|
Therefore, Angular assigns the `selectedUser` property to `UserDetailComponent.user`, which would result in an error if their types were incompatible.
|
||||||
TypeScript checks the assignment according to its type system, obeying flags such as `strictNullChecks` as they are configured in the application.
|
TypeScript checks the assignment according to its type system, obeying flags such as `strictNullChecks` as they are configured in the application.
|
||||||
|
|
||||||
|
You can avoid run-time type errors by providing more specific in-template type requirements to the template type checker. Make the input type requirements for your own directives as specific as possible by providing template-guard functions in the directive definition. See [Improving template type checking for custom directives](guide/structural-directives#directive-type-checks), and [Input setter coercion](#input-setter-coercion) in this guide.
|
||||||
|
|
||||||
|
|
||||||
### Strict null checks
|
### Strict null checks
|
||||||
|
|
||||||
@ -201,7 +203,7 @@ There are two potential workarounds to the above issues:
|
|||||||
|
|
||||||
As a library author, you can take several measures to provide an optimal experience for your users.
|
As a library author, you can take several measures to provide an optimal experience for your users.
|
||||||
First, enabling `strictNullChecks` and including `null` in an input's type, as appropriate, communicates to your consumers whether they can provide a nullable value or not.
|
First, enabling `strictNullChecks` and including `null` in an input's type, as appropriate, communicates to your consumers whether they can provide a nullable value or not.
|
||||||
Additionally, it is possible to provide type hints that are specific to the template type checker, see the [Input setter coercion](guide/template-typecheck#input-setter-coercion) section of this guide.
|
Additionally, it is possible to provide type hints that are specific to the template type checker. See [Improving template type checking for custom directives](guide/structural-directives#directive-type-checks), and [Input setter coercion](#input-setter-coercion) below.
|
||||||
|
|
||||||
|
|
||||||
{@a input-setter-coercion}
|
{@a input-setter-coercion}
|
||||||
|
@ -153,7 +153,7 @@ You can define more than one animation trigger for a component. You can attach a
|
|||||||
|
|
||||||
### Parent-child animations
|
### Parent-child animations
|
||||||
|
|
||||||
Each time an animation is triggered in Angular, the parent animation always get priority and child animations are blocked. In order for a child animation to run, the parent animation must query each of the elements containing child animations and then allow the animations to run using the [`animateChild()`](https://angular.io/api/animations/animateChild) function.
|
Each time an animation is triggered in Angular, the parent animation always get priority and child animations are blocked. In order for a child animation to run, the parent animation must query each of the elements containing child animations and then allow the animations to run using the [`animateChild()`](api/animations/animateChild) function.
|
||||||
|
|
||||||
#### Disabling an animation on an HTML element
|
#### Disabling an animation on an HTML element
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ You can't selectively disable multiple animations on a single element.
|
|||||||
|
|
||||||
However, selective child animations can still be run on a disabled parent in one of the following ways:
|
However, selective child animations can still be run on a disabled parent in one of the following ways:
|
||||||
|
|
||||||
* A parent animation can use the [`query()`](https://angular.io/api/animations/query) function to collect inner elements located in disabled areas of the HTML template.
|
* A parent animation can use the [`query()`](api/animations/query) function to collect inner elements located in disabled areas of the HTML template.
|
||||||
Those elements can still animate.
|
Those elements can still animate.
|
||||||
|
|
||||||
* A subanimation can be queried by a parent and then later animated with the `animateChild()` function.
|
* A subanimation can be queried by a parent and then later animated with the `animateChild()` function.
|
||||||
|
@ -53,7 +53,7 @@ The initial `tsconfig.json` for an Angular app typically looks like the followin
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"strictTemplates": true,
|
"fullTemplateTypeCheck": true,
|
||||||
"strictInjectionParameters": true
|
"strictInjectionParameters": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,6 +62,7 @@ The initial `tsconfig.json` for an Angular app typically looks like the followin
|
|||||||
|
|
||||||
{@a noImplicitAny}
|
{@a noImplicitAny}
|
||||||
|
|
||||||
|
|
||||||
### *noImplicitAny* and *suppressImplicitAnyIndexErrors*
|
### *noImplicitAny* and *suppressImplicitAnyIndexErrors*
|
||||||
|
|
||||||
TypeScript developers disagree about whether the `noImplicitAny` flag should be `true` or `false`.
|
TypeScript developers disagree about whether the `noImplicitAny` flag should be `true` or `false`.
|
||||||
@ -95,7 +96,6 @@ For more information about how the TypeScript configuration affects compilation,
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{@a typings}
|
{@a typings}
|
||||||
|
|
||||||
## TypeScript typings
|
## TypeScript typings
|
||||||
@ -146,6 +146,7 @@ For instance, to install typings for `jasmine` you run `npm install @types/jasmi
|
|||||||
|
|
||||||
{@a target}
|
{@a target}
|
||||||
|
|
||||||
|
|
||||||
### *target*
|
### *target*
|
||||||
|
|
||||||
By default, the target is `es2015`, which is supported only in modern browsers. You can configure the target to `es5` to specifically support legacy browsers. [Differential loading](guide/deployment#differential-loading) is also provided by the Angular CLI to support modern, and legacy browsers with separate bundles.
|
By default, the target is `es2015`, which is supported only in modern browsers. You can configure the target to `es5` to specifically support legacy browsers. [Differential loading](guide/deployment#differential-loading) is also provided by the Angular CLI to support modern, and legacy browsers with separate bundles.
|
||||||
|
@ -37,8 +37,8 @@ See our [template type-checking guide](guide/template-typecheck) for more inform
|
|||||||
| [`entryComponents`](api/core/NgModule#entryComponents) | none | See [`entryComponents`](guide/deprecations#entryComponents) |
|
| [`entryComponents`](api/core/NgModule#entryComponents) | none | See [`entryComponents`](guide/deprecations#entryComponents) |
|
||||||
| [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation)| `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | From v11 the default code will be extracted from the locale data given by `LOCAL_ID`, rather than `USD`. |
|
| [`CurrencyPipe` - `DEFAULT_CURRENCY_CODE`](api/common/CurrencyPipe#currency-code-deprecation)| `{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}` | From v11 the default code will be extracted from the locale data given by `LOCAL_ID`, rather than `USD`. |
|
||||||
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](guide/deprecations#entryComponents) |
|
| [`ANALYZE_FOR_ENTRY_COMPONENTS`](api/core/ANALYZE_FOR_ENTRY_COMPONENTS) | none | See [`ANALYZE_FOR_ENTRY_COMPONENTS`](guide/deprecations#entryComponents) |
|
||||||
| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | |
|
| `ModuleWithProviders` without a generic | `ModuleWithProviders` with a generic | See [`ModuleWithProviders` section](guide/deprecations#moduleWithProviders) |
|
||||||
| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | |
|
| Undecorated base classes that use Angular features | Base classes with `@Directive()` decorator that use Angular features | See [undecorated base classes section](guide/deprecations#undecorated-base-classes) |
|
||||||
| `esm5` and `fesm5` distribution in `@angular/*` npm packages | `esm2015` and `fesm2015` entrypoints | See [`esm5` and `fesm5`](guide/deprecations#esm5-fesm5) |
|
| `esm5` and `fesm5` distribution in `@angular/*` npm packages | `esm2015` and `fesm2015` entrypoints | See [`esm5` and `fesm5`](guide/deprecations#esm5-fesm5) |
|
||||||
| [`TestBed.get`](api/core/testing/TestBed#get) | [`TestBed.inject`](api/core/testing/TestBed#inject) | Same behavior, but type safe. |
|
| [`TestBed.get`](api/core/testing/TestBed#get) | [`TestBed.inject`](api/core/testing/TestBed#inject) | Same behavior, but type safe. |
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Using published libraries
|
# Using published libraries
|
||||||
|
|
||||||
When building Angular applications you can take advantage of sophisticated first-party libraries, such as [Angular Material](https://material.angular.io/), as well as rich ecosystem of third-party libraries.
|
When building Angular applications you can take advantage of sophisticated first-party libraries, such as [Angular Material](https://material.angular.io/), as well as rich ecosystem of third-party libraries.
|
||||||
See the [Angular Resources](https://angular.io/resources) page for links to the most popular ones.
|
See the [Angular Resources](resources) page for links to the most popular ones.
|
||||||
|
|
||||||
## Installing libraries
|
## Installing libraries
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
BIN
aio/content/images/bios/cindygreenekaplan.jpg
Normal file
BIN
aio/content/images/bios/cindygreenekaplan.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB |
@ -44,15 +44,6 @@
|
|||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "juleskremer"
|
"lead": "juleskremer"
|
||||||
},
|
},
|
||||||
"alexeagle": {
|
|
||||||
"name": "Alex Eagle",
|
|
||||||
"picture": "alex-eagle.jpg",
|
|
||||||
"twitter": "jakeherringbone",
|
|
||||||
"website": "http://google.com/+alexeagle",
|
|
||||||
"bio": "Alex works on language tooling for JavaScript and TypeScript. Previously Alex spent five years in Google's developer testing tools. He has developed systems including Google's continuous integration service, capturing build&test failures, and explaining them to developers. Before Google, Alex worked at startups including Opower, and consulted for large government IT. In his 20% time, he created the Error-Prone static analysis tool, which detects common Java programming mistakes and reports them as compile errors.",
|
|
||||||
"groups": ["Collaborators"],
|
|
||||||
"lead": "igorminar"
|
|
||||||
},
|
|
||||||
"aikidave": {
|
"aikidave": {
|
||||||
"name": "Dave Shevitz",
|
"name": "Dave Shevitz",
|
||||||
"picture": "daveshevitz.jpg",
|
"picture": "daveshevitz.jpg",
|
||||||
@ -63,7 +54,7 @@
|
|||||||
"kyliau": {
|
"kyliau": {
|
||||||
"name": "Keen Yee Liau",
|
"name": "Keen Yee Liau",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "alexeagle",
|
"lead": "igorminar",
|
||||||
"picture": "kyliau.jpg"
|
"picture": "kyliau.jpg"
|
||||||
},
|
},
|
||||||
"clydin": {
|
"clydin": {
|
||||||
@ -113,14 +104,6 @@
|
|||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "igorminar"
|
"lead": "igorminar"
|
||||||
},
|
},
|
||||||
"vikerman": {
|
|
||||||
"name": "Vikram Subramanian",
|
|
||||||
"picture": "vikram.jpg",
|
|
||||||
"twitter": "vikerman",
|
|
||||||
"bio": "Vikram is a Software Engineer on the Angular team focused on Engineering Productivity. That means he makes sure people on the team can move fast and not break things. Vikram enjoys doing Yoga and going on walks with his daughter.",
|
|
||||||
"groups": ["Angular"],
|
|
||||||
"lead": "alexeagle"
|
|
||||||
},
|
|
||||||
"pkozlowski-opensource": {
|
"pkozlowski-opensource": {
|
||||||
"name": "Pawel Kozlowski",
|
"name": "Pawel Kozlowski",
|
||||||
"picture": "pawel.jpg",
|
"picture": "pawel.jpg",
|
||||||
@ -314,7 +297,7 @@
|
|||||||
"website": "http://blog.mgechev.com",
|
"website": "http://blog.mgechev.com",
|
||||||
"bio": "Software engineer who enjoys theoretical computer science and its practical applications. Speaker, author of the book 'Switching to Angular', codelyzer, Guess.js, and the Go linter revive. Working for faster and more reliable software.",
|
"bio": "Software engineer who enjoys theoretical computer science and its practical applications. Speaker, author of the book 'Switching to Angular', codelyzer, Guess.js, and the Go linter revive. Working for faster and more reliable software.",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "alexeagle"
|
"lead": "stephenfluin"
|
||||||
},
|
},
|
||||||
"urish": {
|
"urish": {
|
||||||
"name": "Uri Shaked",
|
"name": "Uri Shaked",
|
||||||
@ -650,7 +633,7 @@
|
|||||||
"picture": "denny.jpg",
|
"picture": "denny.jpg",
|
||||||
"bio": "Denny is founder of Expert Support, a professional services firm specializing in technical communication, and leads the Angular technical writing team. His lifelong passion has been to reduce the time and effort required to understand complex technical information. Early on, he was Associate Chairman of the Computer Science Department at Stanford, where he taught introductory courses in programming. He also plays old-timers baseball in local leagues and national tournaments.",
|
"bio": "Denny is founder of Expert Support, a professional services firm specializing in technical communication, and leads the Angular technical writing team. His lifelong passion has been to reduce the time and effort required to understand complex technical information. Early on, he was Associate Chairman of the Computer Science Department at Stanford, where he taught introductory courses in programming. He also plays old-timers baseball in local leagues and national tournaments.",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "juleskremer"
|
"lead": "aikidave"
|
||||||
},
|
},
|
||||||
"jbogarthyde": {
|
"jbogarthyde": {
|
||||||
"name": "Judy Bogart",
|
"name": "Judy Bogart",
|
||||||
@ -771,7 +754,7 @@
|
|||||||
"website": "https://github.com/dgp1130",
|
"website": "https://github.com/dgp1130",
|
||||||
"bio": "Doug is an overly-opinionated software developer with a passion for making awesome developer tools. He is motivated primarily by his selfish desire to make his own life easier, but loves to share his tools and workflows with others to make everyone's lives easier.",
|
"bio": "Doug is an overly-opinionated software developer with a passion for making awesome developer tools. He is motivated primarily by his selfish desire to make his own life easier, but loves to share his tools and workflows with others to make everyone's lives easier.",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "igorminar"
|
"lead": "kyliau"
|
||||||
},
|
},
|
||||||
"martinakraus": {
|
"martinakraus": {
|
||||||
"name": "Martina Kraus",
|
"name": "Martina Kraus",
|
||||||
@ -840,5 +823,13 @@
|
|||||||
"bio": "Annie is an engineering resident on the Angular Components team at Google. She is passionate about the intersection between design and technology and enjoys drawing in her free time.",
|
"bio": "Annie is an engineering resident on the Angular Components team at Google. She is passionate about the intersection between design and technology and enjoys drawing in her free time.",
|
||||||
"groups": ["Angular"],
|
"groups": ["Angular"],
|
||||||
"lead": "jelbourn"
|
"lead": "jelbourn"
|
||||||
|
},
|
||||||
|
"cindygk": {
|
||||||
|
"name": "Cindy Greene-Kaplan",
|
||||||
|
"picture": "cindygreenekaplan.jpg",
|
||||||
|
"twitter": "CindyGK2019",
|
||||||
|
"bio": "Cindy is a Program Manager on the Angular team at Google. She is passionate about improving team processes and overall execution. She enjoys dance fitness, movies and travel.",
|
||||||
|
"groups": ["Angular"],
|
||||||
|
"lead": "juleskremer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,6 @@ While we can't accept all contributions, qualifying contributions can be submitt
|
|||||||
|
|
||||||
1. Your contribution must be valid, and contain a link to a page talking specifically about using Angular
|
1. Your contribution must be valid, and contain a link to a page talking specifically about using Angular
|
||||||
1. Your contribution should have a clear and concise title and description
|
1. Your contribution should have a clear and concise title and description
|
||||||
1. Your resource should follow our brand guidelines (see our [Presskit](https://angular.io/presskit))
|
1. Your resource should follow our brand guidelines (see our [Presskit](presskit))
|
||||||
1. Your resource should have significant benefit to Angular developers
|
1. Your resource should have significant benefit to Angular developers
|
||||||
1. Your resource should already have traction and praise from Angular developers
|
1. Your resource should already have traction and praise from Angular developers
|
||||||
|
@ -7,38 +7,32 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"awesome-angular-components": {
|
"awesome-angular-components": {
|
||||||
"desc": "A community index of components and libraries maintained on GitHub",
|
"desc": "A community index of components and libraries maintained on GitHub",
|
||||||
"rev": true,
|
|
||||||
"title": "Catalog of Angular Components & Libraries",
|
"title": "Catalog of Angular Components & Libraries",
|
||||||
"url": "https://github.com/brillout/awesome-angular-components"
|
"url": "https://github.com/brillout/awesome-angular-components"
|
||||||
},
|
},
|
||||||
"angular-ru": {
|
"angular-ru": {
|
||||||
"desc": "Angular-RU Community on GitHub is a single entry point for all resources, chats, podcasts and meetups for Angular in Russia.",
|
"desc": "Angular-RU Community on GitHub is a single entry point for all resources, chats, podcasts and meetups for Angular in Russia.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Conferences and Angular Camps in Moscow, Russia.",
|
"title": "Angular Conferences and Angular Camps in Moscow, Russia.",
|
||||||
"url": "https://angular-ru.github.io/"
|
"url": "https://angular-ru.github.io/"
|
||||||
},
|
},
|
||||||
"made-with-angular": {
|
"made-with-angular": {
|
||||||
"desc": "A showcase of web apps built with Angular.",
|
"desc": "A showcase of web apps built with Angular.",
|
||||||
"rev": true,
|
|
||||||
"title": "Made with Angular",
|
"title": "Made with Angular",
|
||||||
"url": "https://www.madewithangular.com/"
|
"url": "https://www.madewithangular.com/"
|
||||||
},
|
},
|
||||||
"angular-subreddit": {
|
"angular-subreddit": {
|
||||||
"desc": "An Angular-dedicated subreddit.",
|
"desc": "An Angular-dedicated subreddit.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Subreddit",
|
"title": "Angular Subreddit",
|
||||||
"url": "https://www.reddit.com/r/Angular2/"
|
"url": "https://www.reddit.com/r/Angular2/"
|
||||||
},
|
},
|
||||||
"angular-devto" : {
|
"angular-devto": {
|
||||||
"desc": "Read and share content and chat about Angular on DEV Community.",
|
"desc": "Read and share content and chat about Angular on DEV Community.",
|
||||||
"url": "https://dev.to/t/angular",
|
"url": "https://dev.to/t/angular",
|
||||||
"rev": true,
|
|
||||||
"title": "DEV Community"
|
"title": "DEV Community"
|
||||||
},
|
},
|
||||||
"angular-in-depth" : {
|
"angular-in-depth": {
|
||||||
"desc": "The place where advanced Angular concepts are explained",
|
"desc": "The place where advanced Angular concepts are explained",
|
||||||
"url": "https://blog.angularindepth.com",
|
"url": "https://blog.angularindepth.com",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular In Depth"
|
"title": "Angular In Depth"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,28 +43,24 @@
|
|||||||
"sdfjkdkfj": {
|
"sdfjkdkfj": {
|
||||||
"desc": "Adventures in Angular is a weekly podcast dedicated to the Angular platform and related technologies, tools, languages, and practices.",
|
"desc": "Adventures in Angular is a weekly podcast dedicated to the Angular platform and related technologies, tools, languages, and practices.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Adventures in Angular",
|
"title": "Adventures in Angular",
|
||||||
"url": "https://devchat.tv/adv-in-angular/"
|
"url": "https://devchat.tv/adv-in-angular/"
|
||||||
},
|
},
|
||||||
"sdlkfjsldfkj": {
|
"sdlkfjsldfkj": {
|
||||||
"desc": "Weekly video podcast hosted by Jeff Whelpley with all the latest and greatest happenings in the wild world of Angular.",
|
"desc": "Weekly video podcast hosted by Jeff Whelpley with all the latest and greatest happenings in the wild world of Angular.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "AngularAir",
|
"title": "AngularAir",
|
||||||
"url": "https://angularair.com/"
|
"url": "https://angularair.com/"
|
||||||
},
|
},
|
||||||
"sdlkfjsldfkz": {
|
"sdlkfjsldfkz": {
|
||||||
"desc": "A weekly German podcast for Angular on the go",
|
"desc": "A weekly German podcast for Angular on the go",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Happy Angular Podcast",
|
"title": "Happy Angular Podcast",
|
||||||
"url": "https://happy-angular.de/"
|
"url": "https://happy-angular.de/"
|
||||||
},
|
},
|
||||||
"ngruair": {
|
"ngruair": {
|
||||||
"desc": "Russian language video podcast about Angular.",
|
"desc": "Russian language video podcast about Angular.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "NgRuAir",
|
"title": "NgRuAir",
|
||||||
"url": "https://github.com/ngRuAir/ngruair"
|
"url": "https://github.com/ngRuAir/ngruair"
|
||||||
}
|
}
|
||||||
@ -87,21 +77,18 @@
|
|||||||
"a3b": {
|
"a3b": {
|
||||||
"desc": "Ionic offers a library of mobile-optimized HTML, CSS and JS components and tools for building highly interactive native and progressive web apps.",
|
"desc": "Ionic offers a library of mobile-optimized HTML, CSS and JS components and tools for building highly interactive native and progressive web apps.",
|
||||||
"logo": "http://ionicframework.com/img/ionic-logo-white.svg",
|
"logo": "http://ionicframework.com/img/ionic-logo-white.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Ionic",
|
"title": "Ionic",
|
||||||
"url": "https://ionicframework.com/docs"
|
"url": "https://ionicframework.com/docs"
|
||||||
},
|
},
|
||||||
"a4b": {
|
"a4b": {
|
||||||
"desc": "Electron Platform for Angular.",
|
"desc": "Electron Platform for Angular.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Electron",
|
"title": "Electron",
|
||||||
"url": "https://github.com/maximegris/angular-electron"
|
"url": "https://github.com/maximegris/angular-electron"
|
||||||
},
|
},
|
||||||
"ab": {
|
"ab": {
|
||||||
"desc": "NativeScript is how you build cross-platform, native iOS and Android apps with Angular and TypeScript. Get 100% access to native APIs via JavaScript and reuse of packages from NPM, CocoaPods and Gradle. Open source and backed by Telerik.",
|
"desc": "NativeScript is how you build cross-platform, native iOS and Android apps with Angular and TypeScript. Get 100% access to native APIs via JavaScript and reuse of packages from NPM, CocoaPods and Gradle. Open source and backed by Telerik.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "NativeScript",
|
"title": "NativeScript",
|
||||||
"url": "https://docs.nativescript.org/angular/start/introduction"
|
"url": "https://docs.nativescript.org/angular/start/introduction"
|
||||||
}
|
}
|
||||||
@ -110,55 +97,47 @@
|
|||||||
"Data Libraries": {
|
"Data Libraries": {
|
||||||
"order": 3,
|
"order": 3,
|
||||||
"resources": {
|
"resources": {
|
||||||
"rx-web":{
|
"rx-web": {
|
||||||
"desc":"RxWeb Reactive Form Validators provides all types of complex, conditional, cross field, and dynamic validation on validator-based reactive forms, model-based reactive forms, and template driven forms.",
|
"desc": "RxWeb Reactive Form Validators provides all types of complex, conditional, cross field, and dynamic validation on validator-based reactive forms, model-based reactive forms, and template driven forms.",
|
||||||
"rev": true,
|
|
||||||
"title": "RxWeb Reactive Form Validators",
|
"title": "RxWeb Reactive Form Validators",
|
||||||
"url": "https://www.rxweb.io"
|
"url": "https://www.rxweb.io"
|
||||||
},
|
},
|
||||||
"-KLIzHDRfiB3d7W7vk-e": {
|
"-KLIzHDRfiB3d7W7vk-e": {
|
||||||
"desc": "Reactive Extensions for Angular",
|
"desc": "Reactive Extensions for Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "ngrx",
|
"title": "ngrx",
|
||||||
"url": "https://ngrx.io/"
|
"url": "https://ngrx.io/"
|
||||||
},
|
},
|
||||||
"ngxs": {
|
"ngxs": {
|
||||||
"desc": "NGXS is a state management pattern + library for Angular. NGXS is modeled after the CQRS pattern popularly implemented in libraries like Redux and NgRx but reduces boilerplate by using modern TypeScript features such as classes and decorators.",
|
"desc": "NGXS is a state management pattern + library for Angular. NGXS is modeled after the CQRS pattern popularly implemented in libraries like Redux and NgRx but reduces boilerplate by using modern TypeScript features such as classes and decorators.",
|
||||||
"rev": true,
|
|
||||||
"title": "NGXS",
|
"title": "NGXS",
|
||||||
"url": "https://ngxs.io/"
|
"url": "https://ngxs.io/"
|
||||||
},
|
},
|
||||||
"akita": {
|
"akita": {
|
||||||
"desc": "Akita is a state management pattern, built on top of RxJS, which takes the idea of multiple data stores from Flux and the immutable updates from Redux, along with the concept of streaming data, to create the Observable Data Store model.",
|
"desc": "Akita is a state management pattern, built on top of RxJS, which takes the idea of multiple data stores from Flux and the immutable updates from Redux, along with the concept of streaming data, to create the Observable Data Store model.",
|
||||||
"rev": true,
|
|
||||||
"title": "Akita",
|
"title": "Akita",
|
||||||
"url": "https://netbasal.gitbook.io/akita/"
|
"url": "https://netbasal.gitbook.io/akita/"
|
||||||
},
|
},
|
||||||
"ab": {
|
"ab": {
|
||||||
"desc": "The official library for Firebase and Angular",
|
"desc": "The official library for Firebase and Angular",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Fire",
|
"title": "Angular Fire",
|
||||||
"url": "https://github.com/angular/angularfire2"
|
"url": "https://github.com/angular/angularfire2"
|
||||||
},
|
},
|
||||||
"ab2": {
|
"ab2": {
|
||||||
"desc": "Use Angular and Meteor to build full-stack JavaScript apps for Mobile and Desktop.",
|
"desc": "Use Angular and Meteor to build full-stack JavaScript apps for Mobile and Desktop.",
|
||||||
"logo": "http://www.angular-meteor.com/images/logo.png",
|
"logo": "http://www.angular-meteor.com/images/logo.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Meteor",
|
"title": "Meteor",
|
||||||
"url": "https://github.com/urigo/angular-meteor"
|
"url": "https://github.com/urigo/angular-meteor"
|
||||||
},
|
},
|
||||||
"ab3": {
|
"ab3": {
|
||||||
"desc": "Apollo is a data stack for modern apps, built with GraphQL.",
|
"desc": "Apollo is a data stack for modern apps, built with GraphQL.",
|
||||||
"logo": "http://docs.apollostack.com/logo/large.png",
|
"logo": "http://docs.apollostack.com/logo/large.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Apollo",
|
"title": "Apollo",
|
||||||
"url": "https://www.apollographql.com/docs/angular/"
|
"url": "https://www.apollographql.com/docs/angular/"
|
||||||
},
|
},
|
||||||
"ngx-api-utils": {
|
"ngx-api-utils": {
|
||||||
"desc": "ngx-api-utils is a lean library of utilities and helpers to quickly integrate any HTTP API (REST, Ajax, and any other) with Angular.",
|
"desc": "ngx-api-utils is a lean library of utilities and helpers to quickly integrate any HTTP API (REST, Ajax, and any other) with Angular.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "ngx-api-utils",
|
"title": "ngx-api-utils",
|
||||||
"url": "https://github.com/ngx-api-utils/ngx-api-utils"
|
"url": "https://github.com/ngx-api-utils/ngx-api-utils"
|
||||||
}
|
}
|
||||||
@ -170,33 +149,28 @@
|
|||||||
"ab": {
|
"ab": {
|
||||||
"desc": "VS Code is a Free, Lightweight Tool for Editing and Debugging Web Apps.",
|
"desc": "VS Code is a Free, Lightweight Tool for Editing and Debugging Web Apps.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Visual Studio Code",
|
"title": "Visual Studio Code",
|
||||||
"url": "http://code.visualstudio.com/"
|
"url": "http://code.visualstudio.com/"
|
||||||
},
|
},
|
||||||
"ab2": {
|
"ab2": {
|
||||||
"desc": "Lightweight yet powerful IDE, perfectly equipped for complex client-side development and server-side development with Node.js",
|
"desc": "Lightweight yet powerful IDE, perfectly equipped for complex client-side development and server-side development with Node.js",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "WebStorm",
|
"title": "WebStorm",
|
||||||
"url": "https://www.jetbrains.com/webstorm/"
|
"url": "https://www.jetbrains.com/webstorm/"
|
||||||
},
|
},
|
||||||
"ab3": {
|
"ab3": {
|
||||||
"desc": "Capable and Ergonomic Java * IDE",
|
"desc": "Capable and Ergonomic Java * IDE",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "IntelliJ IDEA",
|
"title": "IntelliJ IDEA",
|
||||||
"url": "https://www.jetbrains.com/idea/"
|
"url": "https://www.jetbrains.com/idea/"
|
||||||
},
|
},
|
||||||
"angular-ide": {
|
"angular-ide": {
|
||||||
"desc": "Built first and foremost for Angular. Turnkey setup for beginners; powerful for experts.",
|
"desc": "Built first and foremost for Angular. Turnkey setup for beginners; powerful for experts.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular IDE by Webclipse",
|
"title": "Angular IDE by Webclipse",
|
||||||
"url": "https://www.genuitec.com/products/angular-ide"
|
"url": "https://www.genuitec.com/products/angular-ide"
|
||||||
},
|
},
|
||||||
"amexio-canvas": {
|
"amexio-canvas": {
|
||||||
"desc": "Amexio Canvas is Drag and Drop Environment to create Fully Responsive Web and Smart Device HTML5/Angular Apps. Code will be auto generated and hot deployed by the Canvas for live testing. Out of the box 50+ Material Design Theme support. Commit your code to GitHub public or private repository.",
|
"desc": "Amexio Canvas is Drag and Drop Environment to create Fully Responsive Web and Smart Device HTML5/Angular Apps. Code will be auto generated and hot deployed by the Canvas for live testing. Out of the box 50+ Material Design Theme support. Commit your code to GitHub public or private repository.",
|
||||||
"rev": true,
|
|
||||||
"title": "Amexio Canvas Web Based Drag and Drop IDE by MetaMagic",
|
"title": "Amexio Canvas Web Based Drag and Drop IDE by MetaMagic",
|
||||||
"url": "https://amexio.tech/"
|
"url": "https://amexio.tech/"
|
||||||
}
|
}
|
||||||
@ -208,53 +182,45 @@
|
|||||||
"a1": {
|
"a1": {
|
||||||
"desc": "A Google Chrome Dev Tools extension for debugging Angular applications.",
|
"desc": "A Google Chrome Dev Tools extension for debugging Angular applications.",
|
||||||
"logo": "https://augury.angular.io/images/augury-logo.svg",
|
"logo": "https://augury.angular.io/images/augury-logo.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Augury",
|
"title": "Augury",
|
||||||
"url": "http://augury.angular.io/"
|
"url": "http://augury.angular.io/"
|
||||||
},
|
},
|
||||||
"b1": {
|
"b1": {
|
||||||
"desc": "Server-side Rendering for Angular apps.",
|
"desc": "Server-side Rendering for Angular apps.",
|
||||||
"logo": "https://cloud.githubusercontent.com/assets/1016365/10639063/138338bc-7806-11e5-8057-d34c75f3cafc.png",
|
"logo": "https://cloud.githubusercontent.com/assets/1016365/10639063/138338bc-7806-11e5-8057-d34c75f3cafc.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Universal",
|
"title": "Angular Universal",
|
||||||
"url": "https://angular.io/guide/universal"
|
"url": "https://angular.io/guide/universal"
|
||||||
},
|
},
|
||||||
"c1": {
|
"c1": {
|
||||||
"desc": "Lightweight development only Node.js® server",
|
"desc": "Lightweight development only Node.js® server",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Lite-server",
|
"title": "Lite-server",
|
||||||
"url": "https://github.com/johnpapa/lite-server"
|
"url": "https://github.com/johnpapa/lite-server"
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"desc": "The official Angular CLI makes it easy to create and develop applications from initial commit to production deployment. It already follows our best practices right out of the box!",
|
"desc": "The official Angular CLI makes it easy to create and develop applications from initial commit to production deployment. It already follows our best practices right out of the box!",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular CLI",
|
"title": "Angular CLI",
|
||||||
"url": "https://cli.angular.io"
|
"url": "https://cli.angular.io"
|
||||||
},
|
},
|
||||||
"d1": {
|
"d1": {
|
||||||
"desc": "Static analysis for Angular projects.",
|
"desc": "Static analysis for Angular projects.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Codelyzer",
|
"title": "Codelyzer",
|
||||||
"url": "https://github.com/mgechev/codelyzer"
|
"url": "https://github.com/mgechev/codelyzer"
|
||||||
},
|
},
|
||||||
"f1": {
|
"f1": {
|
||||||
"desc": "This tool generates dedicated documentation for Angular applications.",
|
"desc": "This tool generates dedicated documentation for Angular applications.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Compodoc",
|
"title": "Compodoc",
|
||||||
"url": "https://github.com/compodoc/compodoc"
|
"url": "https://github.com/compodoc/compodoc"
|
||||||
},
|
},
|
||||||
"angular-playground": {
|
"angular-playground": {
|
||||||
"desc": "UI development environment for building, testing, and documenting Angular applications.",
|
"desc": "UI development environment for building, testing, and documenting Angular applications.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Playground",
|
"title": "Angular Playground",
|
||||||
"url": "http://www.angularplayground.it/"
|
"url": "http://www.angularplayground.it/"
|
||||||
},
|
},
|
||||||
"nx": {
|
"nx": {
|
||||||
"desc": "Nx (Nrwl Extensions for Angular) is an open source toolkit built on top of Angular CLI to help enterprise teams develop Angular at scale.",
|
"desc": "Nx (Nrwl Extensions for Angular) is an open source toolkit built on top of Angular CLI to help enterprise teams develop Angular at scale.",
|
||||||
"rev": true,
|
|
||||||
"title": "Nx",
|
"title": "Nx",
|
||||||
"logo": "https://nrwl.io/assets/nx-logo.png",
|
"logo": "https://nrwl.io/assets/nx-logo.png",
|
||||||
"url": "https://nrwl.io/nx"
|
"url": "https://nrwl.io/nx"
|
||||||
@ -262,14 +228,12 @@
|
|||||||
"uijar": {
|
"uijar": {
|
||||||
"desc": "A drop in module to automatically create a living style guide based on the test you write for your components.",
|
"desc": "A drop in module to automatically create a living style guide based on the test you write for your components.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "UI-jar - Test Driven Style Guide Development",
|
"title": "UI-jar - Test Driven Style Guide Development",
|
||||||
"url": "https://github.com/ui-jar/ui-jar"
|
"url": "https://github.com/ui-jar/ui-jar"
|
||||||
},
|
},
|
||||||
"protactor": {
|
"protactor": {
|
||||||
"desc": "The official end to end testing framework for Angular apps",
|
"desc": "The official end to end testing framework for Angular apps",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Protractor",
|
"title": "Protractor",
|
||||||
"url": "https://protractor.angular.io/"
|
"url": "https://protractor.angular.io/"
|
||||||
}
|
}
|
||||||
@ -280,154 +244,130 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"AngularUIToolkit": {
|
"AngularUIToolkit": {
|
||||||
"desc": "Angular UI Toolkit: 115 professionally maintained UI components ranging from a robust grid to charts and more. Try for free & build Angular apps faster.",
|
"desc": "Angular UI Toolkit: 115 professionally maintained UI components ranging from a robust grid to charts and more. Try for free & build Angular apps faster.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular UI Toolkit",
|
"title": "Angular UI Toolkit",
|
||||||
"url": "https://www.angular-ui-tools.com"
|
"url": "https://www.angular-ui-tools.com"
|
||||||
},
|
},
|
||||||
"SenchaforAngular": {
|
"SenchaforAngular": {
|
||||||
"desc": "Build modern web apps faster with 115+ pre-built UI components. Try for free and download today.",
|
"desc": "Build modern web apps faster with 115+ pre-built UI components. Try for free and download today.",
|
||||||
"rev": true,
|
|
||||||
"title": "Sencha for Angular",
|
"title": "Sencha for Angular",
|
||||||
"url": "https://www.sencha.com/products/extangular/"
|
"url": "https://www.sencha.com/products/extangular/"
|
||||||
},
|
},
|
||||||
"IgniteUIforAngular": {
|
"IgniteUIforAngular": {
|
||||||
"desc": "Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps.",
|
"desc": "Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps.",
|
||||||
"rev": true,
|
|
||||||
"title": "Ignite UI for Angular",
|
"title": "Ignite UI for Angular",
|
||||||
"url": "https://www.infragistics.com/products/ignite-ui-angular?utm_source=angular.io&utm_medium=Referral&utm_campaign=Angular"
|
"url": "https://www.infragistics.com/products/ignite-ui-angular?utm_source=angular.io&utm_medium=Referral&utm_campaign=Angular"
|
||||||
},
|
},
|
||||||
"DevExtreme": {
|
"DevExtreme": {
|
||||||
"desc": "50+ UI components including data grid, pivot grid, scheduler, charts, editors, maps and other multi-purpose controls for creating highly responsive web applications for touch devices and traditional desktops.",
|
"desc": "50+ UI components including data grid, pivot grid, scheduler, charts, editors, maps and other multi-purpose controls for creating highly responsive web applications for touch devices and traditional desktops.",
|
||||||
"rev": true,
|
|
||||||
"title": "DevExtreme",
|
"title": "DevExtreme",
|
||||||
"url": "https://js.devexpress.com/Overview/Angular/"
|
"url": "https://js.devexpress.com/Overview/Angular/"
|
||||||
},
|
},
|
||||||
"234237": {
|
"234237": {
|
||||||
"desc": "UX guidelines, HTML/CSS framework, and Angular components working together to craft exceptional experiences",
|
"desc": "UX guidelines, HTML/CSS framework, and Angular components working together to craft exceptional experiences",
|
||||||
"rev": true,
|
|
||||||
"title": "Clarity Design System",
|
"title": "Clarity Design System",
|
||||||
"url": "https://vmware.github.io/clarity/"
|
"url": "https://vmware.github.io/clarity/"
|
||||||
},
|
},
|
||||||
"-KMVB8P4TDfht8c0L1AE": {
|
"-KMVB8P4TDfht8c0L1AE": {
|
||||||
"desc": "The Angular version of the Angular UI Bootstrap library. This library is being built from scratch in Typescript using the Bootstrap 4 CSS framework.",
|
"desc": "The Angular version of the Angular UI Bootstrap library. This library is being built from scratch in Typescript using the Bootstrap 4 CSS framework.",
|
||||||
"rev": true,
|
|
||||||
"title": "ng-bootstrap",
|
"title": "ng-bootstrap",
|
||||||
"url": "https://ng-bootstrap.github.io/"
|
"url": "https://ng-bootstrap.github.io/"
|
||||||
},
|
},
|
||||||
"4ab": {
|
"4ab": {
|
||||||
"desc": "Native Angular components & directives for Lightning Design System",
|
"desc": "Native Angular components & directives for Lightning Design System",
|
||||||
"logo": "http://ng-lightning.github.io/ng-lightning/img/shield.svg",
|
"logo": "http://ng-lightning.github.io/ng-lightning/img/shield.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "ng-lightning",
|
"title": "ng-lightning",
|
||||||
"url": "http://ng-lightning.github.io/ng-lightning/"
|
"url": "http://ng-lightning.github.io/ng-lightning/"
|
||||||
},
|
},
|
||||||
"7ab": {
|
"7ab": {
|
||||||
"desc": "UI components for hybrid mobile apps with bindings for both Angular & AngularJS.",
|
"desc": "UI components for hybrid mobile apps with bindings for both Angular & AngularJS.",
|
||||||
"rev": true,
|
|
||||||
"title": "Onsen UI",
|
"title": "Onsen UI",
|
||||||
"url": "https://onsen.io/v2/"
|
"url": "https://onsen.io/v2/"
|
||||||
},
|
},
|
||||||
"a2b": {
|
"a2b": {
|
||||||
"desc": "PrimeNG is a collection of rich UI components for Angular",
|
"desc": "PrimeNG is a collection of rich UI components for Angular",
|
||||||
"logo": "http://www.primefaces.org/primeng/showcase/resources/images/primeng.svg",
|
"logo": "http://www.primefaces.org/primeng/showcase/resources/images/primeng.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Prime Faces",
|
"title": "Prime Faces",
|
||||||
"url": "http://www.primefaces.org/primeng/"
|
"url": "http://www.primefaces.org/primeng/"
|
||||||
},
|
},
|
||||||
"a3b": {
|
"a3b": {
|
||||||
"desc": "A professional grade library of Angular UI components written in TypeScript that includes our Data Grid, TreeView, Charts, Editors, DropDowns, DatePickers, and many more. Features include support for AOT compilation, Tree Shaking for high-performance, localization, and accessibility.",
|
"desc": "A professional grade library of Angular UI components written in TypeScript that includes our Data Grid, TreeView, Charts, Editors, DropDowns, DatePickers, and many more. Features include support for AOT compilation, Tree Shaking for high-performance, localization, and accessibility.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Kendo UI",
|
"title": "Kendo UI",
|
||||||
"url": "http://www.telerik.com/kendo-angular-ui/"
|
"url": "http://www.telerik.com/kendo-angular-ui/"
|
||||||
},
|
},
|
||||||
"a5b": {
|
"a5b": {
|
||||||
"desc": "High-performance UI controls with the most complete Angular support available. Wijmo’s controls are all written in TypeScript and have zero dependencies. FlexGrid control includes full declarative markup, including cell templates.",
|
"desc": "High-performance UI controls with the most complete Angular support available. Wijmo’s controls are all written in TypeScript and have zero dependencies. FlexGrid control includes full declarative markup, including cell templates.",
|
||||||
"logo": "http://wijmocdn.azureedge.net/wijmositeblob/wijmo-theme/logos/wijmo-55.png",
|
"logo": "http://wijmocdn.azureedge.net/wijmositeblob/wijmo-theme/logos/wijmo-55.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Wijmo",
|
"title": "Wijmo",
|
||||||
"url": "http://wijmo.com/products/wijmo-5/"
|
"url": "http://wijmo.com/products/wijmo-5/"
|
||||||
},
|
},
|
||||||
"a6b": {
|
"a6b": {
|
||||||
"desc": "Material design inspired UI components for building great web apps. For mobile and desktop.",
|
"desc": "Material design inspired UI components for building great web apps. For mobile and desktop.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Vaadin",
|
"title": "Vaadin",
|
||||||
"url": "https://vaadin.com/elements"
|
"url": "https://vaadin.com/elements"
|
||||||
},
|
},
|
||||||
"a7b": {
|
"a7b": {
|
||||||
"desc": "Native Angular directives for Bootstrap",
|
"desc": "Native Angular directives for Bootstrap",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "ngx-bootstrap",
|
"title": "ngx-bootstrap",
|
||||||
"url": "http://valor-software.com/ngx-bootstrap/#/"
|
"url": "http://valor-software.com/ngx-bootstrap/#/"
|
||||||
},
|
},
|
||||||
"ab": {
|
"ab": {
|
||||||
"desc": "Material Design components for Angular",
|
"desc": "Material Design components for Angular",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Material",
|
"title": "Angular Material",
|
||||||
"url": "https://material.angular.io/"
|
"url": "https://material.angular.io/"
|
||||||
},
|
},
|
||||||
"mcc": {
|
"mcc": {
|
||||||
"desc": "Material components made by the community",
|
"desc": "Material components made by the community",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Material Community Components",
|
"title": "Material Community Components",
|
||||||
"url": "https://github.com/tiaguinho/material-community-components"
|
"url": "https://github.com/tiaguinho/material-community-components"
|
||||||
},
|
},
|
||||||
"mosaic": {
|
"mosaic": {
|
||||||
"desc": "Positive Technologies UI components based on Angular",
|
"desc": "Positive Technologies UI components based on Angular",
|
||||||
"logo": "https://i.ibb.co/fQNPgv6/logo-png-200.png",
|
"logo": "https://i.ibb.co/fQNPgv6/logo-png-200.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Mosaic - Angular UI Components",
|
"title": "Mosaic - Angular UI Components",
|
||||||
"url": "https://github.com/positive-js/mosaic"
|
"url": "https://github.com/positive-js/mosaic"
|
||||||
},
|
},
|
||||||
"ngzorro": {
|
"ngzorro": {
|
||||||
"desc": "A set of enterprise-class UI components based on Ant Design and Angular",
|
"desc": "A set of enterprise-class UI components based on Ant Design and Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "Ant Design of Angular (ng-zorro-antd)",
|
"title": "Ant Design of Angular (ng-zorro-antd)",
|
||||||
"url": "https://ng.ant.design/docs/introduce/en"
|
"url": "https://ng.ant.design/docs/introduce/en"
|
||||||
},
|
},
|
||||||
"ngzorromobile": {
|
"ngzorromobile": {
|
||||||
"desc": "A set of enterprise-class mobile UI components based on Ant Design Mobile and Angular",
|
"desc": "A set of enterprise-class mobile UI components based on Ant Design Mobile and Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "Ant Design Mobile of Angular (ng-zorro-antd-mobile)",
|
"title": "Ant Design Mobile of Angular (ng-zorro-antd-mobile)",
|
||||||
"url": "http://ng.mobile.ant.design/#/docs/introduce/en"
|
"url": "http://ng.mobile.ant.design/#/docs/introduce/en"
|
||||||
},
|
},
|
||||||
"aggrid": {
|
"aggrid": {
|
||||||
"desc": "A datagrid for Angular with enterprise style features such as sorting, filtering, custom rendering, editing, grouping, aggregation and pivoting.",
|
"desc": "A datagrid for Angular with enterprise style features such as sorting, filtering, custom rendering, editing, grouping, aggregation and pivoting.",
|
||||||
"rev": true,
|
|
||||||
"title": "ag-Grid",
|
"title": "ag-Grid",
|
||||||
"url": "https://www.ag-grid.com/best-angular-2-data-grid/"
|
"url": "https://www.ag-grid.com/best-angular-2-data-grid/"
|
||||||
},
|
},
|
||||||
"angular-slickgrid": {
|
"angular-slickgrid": {
|
||||||
"desc": "Angular-SlickGrid is a wrapper of the lightning fast & customizable SlickGrid datagrid library with Bootstrap 3,4 themes",
|
"desc": "Angular-SlickGrid is a wrapper of the lightning fast & customizable SlickGrid datagrid library with Bootstrap 3,4 themes",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular-Slickgrid",
|
"title": "Angular-Slickgrid",
|
||||||
"url": "https://github.com/ghiscoding/Angular-Slickgrid"
|
"url": "https://github.com/ghiscoding/Angular-Slickgrid"
|
||||||
},
|
},
|
||||||
"fancygrid": {
|
"fancygrid": {
|
||||||
"desc": "Angular grid library with charts integration and server communication for Enterprise.",
|
"desc": "Angular grid library with charts integration and server communication for Enterprise.",
|
||||||
"rev": true,
|
|
||||||
"title": "FancyGrid",
|
"title": "FancyGrid",
|
||||||
"url": "https://fancygrid.com/docs/getting-started/angular"
|
"url": "https://fancygrid.com/docs/getting-started/angular"
|
||||||
},
|
},
|
||||||
"ngx-smart-modal": {
|
"ngx-smart-modal": {
|
||||||
"desc": "Angular smart, light and fast modal handler to manage modals and data everywhere.",
|
"desc": "Angular smart, light and fast modal handler to manage modals and data everywhere.",
|
||||||
"rev": true,
|
|
||||||
"title": "ngx-smart-modal",
|
"title": "ngx-smart-modal",
|
||||||
"url": "https://biig-io.github.io/ngx-smart-modal"
|
"url": "https://biig-io.github.io/ngx-smart-modal"
|
||||||
},
|
},
|
||||||
"jqwidgets": {
|
"jqwidgets": {
|
||||||
"desc": "Angular UI Components including data grid, tree grid, pivot grid, scheduler, charts, editors and other multi-purpose components",
|
"desc": "Angular UI Components including data grid, tree grid, pivot grid, scheduler, charts, editors and other multi-purpose components",
|
||||||
"rev": true,
|
|
||||||
"title": "jQWidgets",
|
"title": "jQWidgets",
|
||||||
"url": "https://www.jqwidgets.com/angular/"
|
"url": "https://www.jqwidgets.com/angular/"
|
||||||
},
|
},
|
||||||
"amexio": {
|
"amexio": {
|
||||||
"desc": "Amexio is a rich set of Angular components powered by HTML5 & CSS3 for Responsive Web Design and 80+ built-in Material Design Themes. Amexio has 3 Editions, Standard, Enterprise and Creative. Std Edition consists of basic UI Components which include Grid, Tabs, Form Inputs and so on. While Enterprise Edition consists of components like Calendar, Tree Tabs, Social Media Logins (Facebook, GitHub, Twitter and so on) and Creative Edition is focused building elegant and beautiful websites. With more than 200+ components/features. All the editions are open-sourced and free, based on Apache 2 License.",
|
"desc": "Amexio is a rich set of Angular components powered by HTML5 & CSS3 for Responsive Web Design and 80+ built-in Material Design Themes. Amexio has 3 Editions, Standard, Enterprise and Creative. Std Edition consists of basic UI Components which include Grid, Tabs, Form Inputs and so on. While Enterprise Edition consists of components like Calendar, Tree Tabs, Social Media Logins (Facebook, GitHub, Twitter and so on) and Creative Edition is focused building elegant and beautiful websites. With more than 200+ components/features. All the editions are open-sourced and free, based on Apache 2 License.",
|
||||||
"rev": true,
|
|
||||||
"title": "Amexio - Angular Extensions",
|
"title": "Amexio - Angular Extensions",
|
||||||
"url": "http://www.amexio.tech/",
|
"url": "http://www.amexio.tech/",
|
||||||
"logo": "http://www.amexio.org/amexio-logo.png"
|
"logo": "http://www.amexio.org/amexio-logo.png"
|
||||||
@ -435,56 +375,47 @@
|
|||||||
"bm": {
|
"bm": {
|
||||||
"desc": "A lightweight Material Design library for Angular, based upon Google's Material Components for the Web",
|
"desc": "A lightweight Material Design library for Angular, based upon Google's Material Components for the Web",
|
||||||
"logo": "https://blox.src.zone/assets/bloxmaterial.03ecfe4fa0147a781487749dc1cc4580.svg",
|
"logo": "https://blox.src.zone/assets/bloxmaterial.03ecfe4fa0147a781487749dc1cc4580.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Blox Material",
|
"title": "Blox Material",
|
||||||
"url": "https://github.com/src-zone/material"
|
"url": "https://github.com/src-zone/material"
|
||||||
},
|
},
|
||||||
"essentialjs2": {
|
"essentialjs2": {
|
||||||
"desc": "Essential JS 2 for Angular is a collection modern TypeScript based true Angular Components. It has support for Ahead Of Time (AOT) compilation and Tree-Shaking. All the components are developed from the ground up to be lightweight, responsive, modular and touch friendly.",
|
"desc": "Essential JS 2 for Angular is a collection modern TypeScript based true Angular Components. It has support for Ahead Of Time (AOT) compilation and Tree-Shaking. All the components are developed from the ground up to be lightweight, responsive, modular and touch friendly.",
|
||||||
"rev": true,
|
|
||||||
"title": "Essential JS 2",
|
"title": "Essential JS 2",
|
||||||
"url": "https://www.syncfusion.com/products/angular-js2"
|
"url": "https://www.syncfusion.com/products/angular-js2"
|
||||||
},
|
},
|
||||||
"trulyui": {
|
"trulyui": {
|
||||||
"desc": "TrulyUI is an Angular UI Framework especially developed for Desktop Applications based on Web Components using the greatest technologies of the world.",
|
"desc": "TrulyUI is an Angular UI Framework especially developed for Desktop Applications based on Web Components using the greatest technologies of the world.",
|
||||||
"rev": true,
|
|
||||||
"title": "Truly UI",
|
"title": "Truly UI",
|
||||||
"url": "http://truly-ui.com"
|
"url": "http://truly-ui.com"
|
||||||
},
|
},
|
||||||
"ngsqui": {
|
"ngsqui": {
|
||||||
"desc": "Simple Quality UI (SQ-UI) is a flexible and easily customizable UI-kit, aiming to provide maximum efficiency with as little overhead as possible. Driven by the idea that it should be strictly \"for developers by developers\", every new feature release includes functionalities demanded by the developers who are using it.",
|
"desc": "Simple Quality UI (SQ-UI) is a flexible and easily customizable UI-kit, aiming to provide maximum efficiency with as little overhead as possible. Driven by the idea that it should be strictly \"for developers by developers\", every new feature release includes functionalities demanded by the developers who are using it.",
|
||||||
"logo": "https://sq-ui.github.io/ng-sq-ui/_media/sq-ui-logo.png",
|
"logo": "https://sq-ui.github.io/ng-sq-ui/_media/sq-ui-logo.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Simple Quality UI",
|
"title": "Simple Quality UI",
|
||||||
"url": "https://sq-ui.github.io/ng-sq-ui/#/"
|
"url": "https://sq-ui.github.io/ng-sq-ui/#/"
|
||||||
},
|
},
|
||||||
"smart": {
|
"smart": {
|
||||||
"desc": "Web Components for Angular. Dependency-free Angular components for building modern and mobile-friendly web apps",
|
"desc": "Web Components for Angular. Dependency-free Angular components for building modern and mobile-friendly web apps",
|
||||||
"rev": true,
|
|
||||||
"title": "Smart Web Components",
|
"title": "Smart Web Components",
|
||||||
"url": "https://www.htmlelements.com/angular/"
|
"url": "https://www.htmlelements.com/angular/"
|
||||||
},
|
},
|
||||||
"AlyleUI": {
|
"AlyleUI": {
|
||||||
"desc": "Minimal Design, a set of components for Angular.",
|
"desc": "Minimal Design, a set of components for Angular.",
|
||||||
"rev": true,
|
|
||||||
"title": "Alyle UI",
|
"title": "Alyle UI",
|
||||||
"url": "https://alyle-ui.firebaseapp.com/"
|
"url": "https://alyle-ui.firebaseapp.com/"
|
||||||
},
|
},
|
||||||
"nebular": {
|
"nebular": {
|
||||||
"desc": "Theme System, UI Components, Auth and Security for your next Angular application.",
|
"desc": "Theme System, UI Components, Auth and Security for your next Angular application.",
|
||||||
"rev": true,
|
|
||||||
"title": "Nebular",
|
"title": "Nebular",
|
||||||
"url": "https://akveo.github.io/nebular/"
|
"url": "https://akveo.github.io/nebular/"
|
||||||
},
|
},
|
||||||
"carbondesignsystem": {
|
"carbondesignsystem": {
|
||||||
"desc": "An Angular implementation of the Carbon Design System for IBM.",
|
"desc": "An Angular implementation of the Carbon Design System for IBM.",
|
||||||
"rev": true,
|
|
||||||
"title": "Carbon Components Angular",
|
"title": "Carbon Components Angular",
|
||||||
"url": "https://angular.carbondesignsystem.com/"
|
"url": "https://angular.carbondesignsystem.com/"
|
||||||
},
|
},
|
||||||
"jigsaw": {
|
"jigsaw": {
|
||||||
"desc": "Jigsaw provides a set of web components based on Angular. It is supporting the development of all applications of Big Data Product of ZTE (https://www.zte.com.cn).",
|
"desc": "Jigsaw provides a set of web components based on Angular. It is supporting the development of all applications of Big Data Product of ZTE (https://www.zte.com.cn).",
|
||||||
"rev": true,
|
|
||||||
"title": "Awade Jigsaw (Chinese)",
|
"title": "Awade Jigsaw (Chinese)",
|
||||||
"url": "https://jigsaw-zte.gitee.io"
|
"url": "https://jigsaw-zte.gitee.io"
|
||||||
}
|
}
|
||||||
@ -500,76 +431,64 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"-KLIzGEp8Mh5W-FkiQnL": {
|
"-KLIzGEp8Mh5W-FkiQnL": {
|
||||||
"desc": "Your quick, no-nonsense guide to building real-world apps with Angular",
|
"desc": "Your quick, no-nonsense guide to building real-world apps with Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "Learning Angular - Second Edition",
|
"title": "Learning Angular - Second Edition",
|
||||||
"url": "https://www.packtpub.com/web-development/learning-angular-second-edition"
|
"url": "https://www.packtpub.com/web-development/learning-angular-second-edition"
|
||||||
},
|
},
|
||||||
"3ab": {
|
"3ab": {
|
||||||
"desc": "More than 15 books from O'Reilly about Angular",
|
"desc": "More than 15 books from O'Reilly about Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "O'Reilly Media",
|
"title": "O'Reilly Media",
|
||||||
"url": "https://ssearch.oreilly.com/?q=angular"
|
"url": "https://ssearch.oreilly.com/?q=angular"
|
||||||
},
|
},
|
||||||
"a5b": {
|
"a5b": {
|
||||||
"desc": "The in-depth, complete, and up-to-date book on Angular. Become an Angular expert today.",
|
"desc": "The in-depth, complete, and up-to-date book on Angular. Become an Angular expert today.",
|
||||||
"rev": true,
|
|
||||||
"title": "ng-book",
|
"title": "ng-book",
|
||||||
"url": "https://www.ng-book.com/2/"
|
"url": "https://www.ng-book.com/2/"
|
||||||
},
|
},
|
||||||
"a7b": {
|
"a7b": {
|
||||||
"desc": "This ebook will help you getting the philosophy of the framework: what comes from 1.x, what has been introduced and why",
|
"desc": "This ebook will help you getting the philosophy of the framework: what comes from 1.x, what has been introduced and why",
|
||||||
"rev": true,
|
|
||||||
"title": "Becoming a Ninja with Angular",
|
"title": "Becoming a Ninja with Angular",
|
||||||
"url": "https://books.ninja-squad.com/angular"
|
"url": "https://books.ninja-squad.com/angular"
|
||||||
},
|
},
|
||||||
"ab": {
|
"ab": {
|
||||||
"desc": "More than 10 books from Packt Publishing about Angular",
|
"desc": "More than 10 books from Packt Publishing about Angular",
|
||||||
"rev": true,
|
|
||||||
"title": "Packt Publishing",
|
"title": "Packt Publishing",
|
||||||
"url": "https://www.packtpub.com/catalogsearch/result/?q=angular"
|
"url": "https://www.packtpub.com/catalogsearch/result/?q=angular"
|
||||||
},
|
},
|
||||||
"cnoring-rxjs-fundamentals": {
|
"cnoring-rxjs-fundamentals": {
|
||||||
"desc": "A free book that covers all facets of working with Rxjs from your first Observable to how to make your code run at optimal speed with Schedulers.",
|
"desc": "A free book that covers all facets of working with Rxjs from your first Observable to how to make your code run at optimal speed with Schedulers.",
|
||||||
"rev": true,
|
|
||||||
"title": "RxJS Ultimate",
|
"title": "RxJS Ultimate",
|
||||||
"url": "https://chrisnoring.gitbooks.io/rxjs-5-ultimate/content/"
|
"url": "https://chrisnoring.gitbooks.io/rxjs-5-ultimate/content/"
|
||||||
},
|
},
|
||||||
"vsavkin-angular-router": {
|
"vsavkin-angular-router": {
|
||||||
"desc": "This book is a comprehensive guide to the Angular router written by its designer. The book explores the library in depth, including the mental model, design constraints, subtleties of the API.",
|
"desc": "This book is a comprehensive guide to the Angular router written by its designer. The book explores the library in depth, including the mental model, design constraints, subtleties of the API.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Router",
|
"title": "Angular Router",
|
||||||
"url": "https://leanpub.com/router"
|
"url": "https://leanpub.com/router"
|
||||||
},
|
},
|
||||||
"vsavkin-essential-angular": {
|
"vsavkin-essential-angular": {
|
||||||
"desc": "The book is a short, but at the same time, fairly complete overview of the key aspects of Angular written by its core contributors Victor Savkin and Jeff Cross. The book will give you a strong foundation. It will help you put all the concepts into right places. So you will get a good understanding of why the framework is the way it is.",
|
"desc": "The book is a short, but at the same time, fairly complete overview of the key aspects of Angular written by its core contributors Victor Savkin and Jeff Cross. The book will give you a strong foundation. It will help you put all the concepts into right places. So you will get a good understanding of why the framework is the way it is.",
|
||||||
"rev": true,
|
|
||||||
"title": "Essential Angular",
|
"title": "Essential Angular",
|
||||||
"url": "https://gumroad.com/l/essential_angular"
|
"url": "https://gumroad.com/l/essential_angular"
|
||||||
},
|
},
|
||||||
"angular-buch": {
|
"angular-buch": {
|
||||||
"desc": "The first German book about Angular. It gives you a detailed practical overview of the key concepts of the platform. In each chapter a sample application is built upon with a new Angular topic. All sources are available on GitHub.",
|
"desc": "The first German book about Angular. It gives you a detailed practical overview of the key concepts of the platform. In each chapter a sample application is built upon with a new Angular topic. All sources are available on GitHub.",
|
||||||
"logo": "https://angular-buch.com/assets/img/brand.svg",
|
"logo": "https://angular-buch.com/assets/img/brand.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular-Buch (German)",
|
"title": "Angular-Buch (German)",
|
||||||
"url": "https://angular-buch.com/"
|
"url": "https://angular-buch.com/"
|
||||||
},
|
},
|
||||||
"wishtack-guide-angular": {
|
"wishtack-guide-angular": {
|
||||||
"desc": "The free, open-source and up-to-date Angular guide. This pragmatic guide is focused on best practices and will drive you from scratch to cloud.",
|
"desc": "The free, open-source and up-to-date Angular guide. This pragmatic guide is focused on best practices and will drive you from scratch to cloud.",
|
||||||
"logo": "https://raw.githubusercontent.com/wishtack/gitbook-guide-angular/master/.gitbook/assets/wishtack-logo-with-text.png",
|
"logo": "https://raw.githubusercontent.com/wishtack/gitbook-guide-angular/master/.gitbook/assets/wishtack-logo-with-text.png",
|
||||||
"rev": true,
|
|
||||||
"title": "The Angular Guide by Wishtack (Français)",
|
"title": "The Angular Guide by Wishtack (Français)",
|
||||||
"url": "https://guide-angular.wishtack.io/"
|
"url": "https://guide-angular.wishtack.io/"
|
||||||
},
|
},
|
||||||
"ab5": {
|
"ab5": {
|
||||||
"desc": "How to build Angular applications using NGRX",
|
"desc": "How to build Angular applications using NGRX",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Architecting Angular Applications with NGRX",
|
"title": "Architecting Angular Applications with NGRX",
|
||||||
"url": "https://www.packtpub.com/web-development/architecting-angular-applications-redux"
|
"url": "https://www.packtpub.com/web-development/architecting-angular-applications-redux"
|
||||||
},
|
},
|
||||||
"dwa": {
|
"dwa": {
|
||||||
"desc": "Practical journey with Angular framework, ES6, TypeScript, webpack and Angular CLI.",
|
"desc": "Practical journey with Angular framework, ES6, TypeScript, webpack and Angular CLI.",
|
||||||
"rev": true,
|
|
||||||
"title": "Developing with Angular",
|
"title": "Developing with Angular",
|
||||||
"url": "https://leanpub.com/developing-with-angular"
|
"url": "https://leanpub.com/developing-with-angular"
|
||||||
}
|
}
|
||||||
@ -580,32 +499,27 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"angular-dyma": {
|
"angular-dyma": {
|
||||||
"desc": "Learn Angular and all its ecosystem (Material, Flex-layout, Ngrx and more) from scratch.",
|
"desc": "Learn Angular and all its ecosystem (Material, Flex-layout, Ngrx and more) from scratch.",
|
||||||
"rev": true,
|
|
||||||
"title": "Dyma (French)",
|
"title": "Dyma (French)",
|
||||||
"url": "https://dyma.fr/angular"
|
"url": "https://dyma.fr/angular"
|
||||||
},
|
},
|
||||||
"-KLIBoTWXMiBcvG0dAM6": {
|
"-KLIBoTWXMiBcvG0dAM6": {
|
||||||
"desc": "This course introduces you to the essentials of this \"superheroic\" framework, including declarative templates, two-way data binding, and dependency injection.",
|
"desc": "This course introduces you to the essentials of this \"superheroic\" framework, including declarative templates, two-way data binding, and dependency injection.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular: Essential Training",
|
"title": "Angular: Essential Training",
|
||||||
"url": "https://www.lynda.com/AngularJS-tutorials/Angular-2-Essential-Training/540347-2.html"
|
"url": "https://www.lynda.com/AngularJS-tutorials/Angular-2-Essential-Training/540347-2.html"
|
||||||
},
|
},
|
||||||
"-KLIzGq3CiFeoZUemVyE": {
|
"-KLIzGq3CiFeoZUemVyE": {
|
||||||
"desc": "Learn the core concepts, play with the code, become a competent Angular developer",
|
"desc": "Learn the core concepts, play with the code, become a competent Angular developer",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Concepts, Code and Collective Wisdom",
|
"title": "Angular Concepts, Code and Collective Wisdom",
|
||||||
"url": "https://www.udemy.com/angular-2-concepts-code-and-collective-wisdom/"
|
"url": "https://www.udemy.com/angular-2-concepts-code-and-collective-wisdom/"
|
||||||
},
|
},
|
||||||
"-KLIzHwg-glQLXni1hvL": {
|
"-KLIzHwg-glQLXni1hvL": {
|
||||||
"desc": "Spanish language Angular articles and information",
|
"desc": "Spanish language Angular articles and information",
|
||||||
"rev": true,
|
|
||||||
"title": "Academia Binaria (español)",
|
"title": "Academia Binaria (español)",
|
||||||
"url": "http://academia-binaria.com/"
|
"url": "http://academia-binaria.com/"
|
||||||
},
|
},
|
||||||
"-KN3uNQvxifu26D6WKJW": {
|
"-KN3uNQvxifu26D6WKJW": {
|
||||||
"category": "Education",
|
"category": "Education",
|
||||||
"desc": "Create the future of web applications by taking Angular for a test drive.",
|
"desc": "Create the future of web applications by taking Angular for a test drive.",
|
||||||
"rev": true,
|
|
||||||
"subcategory": "Online Training",
|
"subcategory": "Online Training",
|
||||||
"title": "CodeSchool: Accelerating Through Angular",
|
"title": "CodeSchool: Accelerating Through Angular",
|
||||||
"url": "https://www.codeschool.com/courses/accelerating-through-angular-2"
|
"url": "https://www.codeschool.com/courses/accelerating-through-angular-2"
|
||||||
@ -613,96 +527,81 @@
|
|||||||
"angular-playbook": {
|
"angular-playbook": {
|
||||||
"desc": "Learn advanced Angular best practices for enterprise teams, created by Nrwl.io.",
|
"desc": "Learn advanced Angular best practices for enterprise teams, created by Nrwl.io.",
|
||||||
"logo": "https://nrwl.io/assets/logo_footer_2x.png",
|
"logo": "https://nrwl.io/assets/logo_footer_2x.png",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Enterprise Playbook",
|
"title": "Angular Enterprise Playbook",
|
||||||
"url": "https://angularplaybook.com"
|
"url": "https://angularplaybook.com"
|
||||||
},
|
},
|
||||||
"a2b": {
|
"a2b": {
|
||||||
"desc": "Hundreds of Angular courses for all skill levels",
|
"desc": "Hundreds of Angular courses for all skill levels",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Pluralsight",
|
"title": "Pluralsight",
|
||||||
"url": "https://www.pluralsight.com/paths/angular"
|
"url": "https://www.pluralsight.com/paths/angular"
|
||||||
},
|
},
|
||||||
"ab3": {
|
"ab3": {
|
||||||
"desc": "Angular courses hosted by Udemy",
|
"desc": "Angular courses hosted by Udemy",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Udemy",
|
"title": "Udemy",
|
||||||
"url": "https://www.udemy.com/courses/search/?q=angular"
|
"url": "https://www.udemy.com/courses/search/?q=angular"
|
||||||
},
|
},
|
||||||
"ab4": {
|
"ab4": {
|
||||||
"desc": "Angular Fundamentals and advanced topics focused on Redux Style Angular Applications",
|
"desc": "Angular Fundamentals and advanced topics focused on Redux Style Angular Applications",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Egghead.io",
|
"title": "Egghead.io",
|
||||||
"url": "https://egghead.io/browse/frameworks/angular"
|
"url": "https://egghead.io/browse/frameworks/angular"
|
||||||
},
|
},
|
||||||
"ab5": {
|
"ab5": {
|
||||||
"desc": "Build Web Apps with Angular - recorded video content",
|
"desc": "Build Web Apps with Angular - recorded video content",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Frontend Masters",
|
"title": "Frontend Masters",
|
||||||
"url": "https://frontendmasters.com/courses/angular-core/"
|
"url": "https://frontendmasters.com/courses/angular-core/"
|
||||||
},
|
},
|
||||||
"angular-love": {
|
"angular-love": {
|
||||||
"desc": "Polish language Angular articles and information",
|
"desc": "Polish language Angular articles and information",
|
||||||
"rev": true,
|
|
||||||
"title": "angular.love (Polski)",
|
"title": "angular.love (Polski)",
|
||||||
"url": "http://www.angular.love/"
|
"url": "http://www.angular.love/"
|
||||||
},
|
},
|
||||||
"learn-angular-fr": {
|
"learn-angular-fr": {
|
||||||
"desc": "French language Angular content.",
|
"desc": "French language Angular content.",
|
||||||
"rev": true,
|
|
||||||
"title": "Learn Angular (francais)",
|
"title": "Learn Angular (francais)",
|
||||||
"url": "http://www.learn-angular.fr/"
|
"url": "http://www.learn-angular.fr/"
|
||||||
},
|
},
|
||||||
"upgrading-ajs": {
|
"upgrading-ajs": {
|
||||||
"desc": "The world's most comprehensive, step-by-step course on using best practices and avoiding pitfalls while migrating from AngularJS to Angular.",
|
"desc": "The world's most comprehensive, step-by-step course on using best practices and avoiding pitfalls while migrating from AngularJS to Angular.",
|
||||||
"rev": true,
|
|
||||||
"title": "Upgrading AngularJS",
|
"title": "Upgrading AngularJS",
|
||||||
"url": "https://www.upgradingangularjs.com"
|
"url": "https://www.upgradingangularjs.com"
|
||||||
},
|
},
|
||||||
"toddmotto-ultimateangular": {
|
"toddmotto-ultimateangular": {
|
||||||
"desc": "Online courses providing in-depth coverage of the Angular ecosystem, AngularJS, Angular and TypeScript, with functional code samples and a full-featured seed environment. Get a deep understanding of Angular and TypeScript from foundation to functional application, then move on to advanced topics with Todd Motto and collaborators.",
|
"desc": "Online courses providing in-depth coverage of the Angular ecosystem, AngularJS, Angular and TypeScript, with functional code samples and a full-featured seed environment. Get a deep understanding of Angular and TypeScript from foundation to functional application, then move on to advanced topics with Todd Motto and collaborators.",
|
||||||
"rev": true,
|
|
||||||
"title": "Ultimate Angular",
|
"title": "Ultimate Angular",
|
||||||
"url": "https://ultimateangular.com/"
|
"url": "https://ultimateangular.com/"
|
||||||
},
|
},
|
||||||
"willh-angular-zero": {
|
"willh-angular-zero": {
|
||||||
"desc": "Online video course in Chinese for newbies who need to learning from the scratch in Chinese. It's covering Angular, Angular CLI, TypeScript, VSCode, and some must known knowledge of Angular development.",
|
"desc": "Online video course in Chinese for newbies who need to learning from the scratch in Chinese. It's covering Angular, Angular CLI, TypeScript, VSCode, and some must known knowledge of Angular development.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular in Action: Start From Scratch (正體中文)",
|
"title": "Angular in Action: Start From Scratch (正體中文)",
|
||||||
"url": "https://www.udemy.com/angular-zero/?couponCode=ANGULAR.IO"
|
"url": "https://www.udemy.com/angular-zero/?couponCode=ANGULAR.IO"
|
||||||
},
|
},
|
||||||
"angular-firebase": {
|
"angular-firebase": {
|
||||||
"desc": "Video lessons covering progressive web apps with Angular, Firebase, RxJS, and related APIs.",
|
"desc": "Video lessons covering progressive web apps with Angular, Firebase, RxJS, and related APIs.",
|
||||||
"rev": true,
|
|
||||||
"title": "AngularFirebase.com",
|
"title": "AngularFirebase.com",
|
||||||
"url": "https://angularfirebase.com/"
|
"url": "https://angularfirebase.com/"
|
||||||
},
|
},
|
||||||
"loiane-angulartraining": {
|
"loiane-angulartraining": {
|
||||||
"desc": "Free Angular course in Portuguese.",
|
"desc": "Free Angular course in Portuguese.",
|
||||||
"rev": true,
|
|
||||||
"title": "Loiane Training (Português)",
|
"title": "Loiane Training (Português)",
|
||||||
"url": "https://loiane.training/course/angular/"
|
"url": "https://loiane.training/course/angular/"
|
||||||
},
|
},
|
||||||
"web-dev-angular": {
|
"web-dev-angular": {
|
||||||
"desc": "Build performant and progressive Angular applications.",
|
"desc": "Build performant and progressive Angular applications.",
|
||||||
"rev": true,
|
|
||||||
"title": "web.dev/angular",
|
"title": "web.dev/angular",
|
||||||
"url": "https://web.dev/angular"
|
"url": "https://web.dev/angular"
|
||||||
},
|
},
|
||||||
"mdb-angular-boilerplate": {
|
"mdb-angular-boilerplate": {
|
||||||
"desc": "Angular CRUD application starter with NgRx state management, Firebase backend and installation guide.",
|
"desc": "Angular CRUD application starter with NgRx state management, Firebase backend and installation guide.",
|
||||||
"rev": true,
|
|
||||||
"title": "MDB Angular Boilerplate",
|
"title": "MDB Angular Boilerplate",
|
||||||
"url": "https://github.com/mdbootstrap/Angular-Bootstrap-Boilerplate"
|
"url": "https://github.com/mdbootstrap/Angular-Bootstrap-Boilerplate"
|
||||||
},
|
},
|
||||||
"dotnettricks": {
|
"dotnettricks": {
|
||||||
"desc": "Online videos and training for Angular.",
|
"desc": "Online videos and training for Angular.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "DotNetTricks",
|
"title": "DotNetTricks",
|
||||||
"url": "https://www.dotnettricks.com/courses/angular"
|
"url": "https://www.dotnettricks.com/courses/angular"
|
||||||
}
|
}
|
||||||
@ -713,127 +612,107 @@
|
|||||||
"resources": {
|
"resources": {
|
||||||
"webucator": {
|
"webucator": {
|
||||||
"desc": "Customized in-person instructor-led Angular training for private groups and public online instructor-led Angular classes.",
|
"desc": "Customized in-person instructor-led Angular training for private groups and public online instructor-led Angular classes.",
|
||||||
"rev": true,
|
|
||||||
"title": "Webucator",
|
"title": "Webucator",
|
||||||
"url": "https://www.webucator.com/webdev-training/angular-training"
|
"url": "https://www.webucator.com/webdev-training/angular-training"
|
||||||
},
|
},
|
||||||
"-acceleb": {
|
"-acceleb": {
|
||||||
"desc": "Customized, Instructor-Led Angular Training",
|
"desc": "Customized, Instructor-Led Angular Training",
|
||||||
"rev": true,
|
|
||||||
"title": "Accelebrate",
|
"title": "Accelebrate",
|
||||||
"url": "https://www.accelebrate.com/angular-training"
|
"url": "https://www.accelebrate.com/angular-training"
|
||||||
},
|
},
|
||||||
"-KLIBoFWStce29UCwkvY": {
|
"-KLIBoFWStce29UCwkvY": {
|
||||||
"desc": "Private Angular Training and Mentoring",
|
"desc": "Private Angular Training and Mentoring",
|
||||||
"rev": true,
|
|
||||||
"title": "Chariot Solutions",
|
"title": "Chariot Solutions",
|
||||||
"url": "http://chariotsolutions.com/course/angular2-workshop-fundamentals-architecture/"
|
"url": "http://chariotsolutions.com/course/angular2-workshop-fundamentals-architecture/"
|
||||||
},
|
},
|
||||||
"-KLIBoN0p9be3kwC6-ga": {
|
"-KLIBoN0p9be3kwC6-ga": {
|
||||||
"desc": "Angular Academy is a two day hands-on public course given in-person across Canada!",
|
"desc": "Angular Academy is a two day hands-on public course given in-person across Canada!",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Academy (Canada)",
|
"title": "Angular Academy (Canada)",
|
||||||
"url": "http://www.angularacademy.ca"
|
"url": "http://www.angularacademy.ca"
|
||||||
},
|
},
|
||||||
"at": {
|
"at": {
|
||||||
"desc": "Angular Training teaches Angular on-site all over the world. Also provides consulting and mentoring.",
|
"desc": "Angular Training teaches Angular on-site all over the world. Also provides consulting and mentoring.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Training",
|
"title": "Angular Training",
|
||||||
"url": "http://www.angulartraining.com"
|
"url": "http://www.angulartraining.com"
|
||||||
},
|
},
|
||||||
"-KLIBo_lm-WrK1Sjtt-2": {
|
"-KLIBo_lm-WrK1Sjtt-2": {
|
||||||
"desc": "Basic and Advanced training across Europe in German",
|
"desc": "Basic and Advanced training across Europe in German",
|
||||||
"rev": true,
|
|
||||||
"title": "TheCodeCampus (German)",
|
"title": "TheCodeCampus (German)",
|
||||||
"url": "https://www.thecodecampus.de/schulungen/angular"
|
"url": "https://www.thecodecampus.de/schulungen/angular"
|
||||||
},
|
},
|
||||||
"-KLIzFhfGKi1xttqJ7Uh": {
|
"-KLIzFhfGKi1xttqJ7Uh": {
|
||||||
"desc": "4 day in-depth Angular training in Israel",
|
"desc": "4 day in-depth Angular training in Israel",
|
||||||
"rev": true,
|
|
||||||
"title": "ng-course (Israel)",
|
"title": "ng-course (Israel)",
|
||||||
"url": "http://ng-course.org/"
|
"url": "http://ng-course.org/"
|
||||||
},
|
},
|
||||||
"-KLIzIcRoDq3TzCJWnYc": {
|
"-KLIzIcRoDq3TzCJWnYc": {
|
||||||
"desc": "Virtual and in-person training in Canada and the US",
|
"desc": "Virtual and in-person training in Canada and the US",
|
||||||
"rev": true,
|
|
||||||
"title": "Web Age Solutions",
|
"title": "Web Age Solutions",
|
||||||
"url": "http://www.webagesolutions.com/courses/WA2533-angular-2-programming"
|
"url": "http://www.webagesolutions.com/courses/WA2533-angular-2-programming"
|
||||||
},
|
},
|
||||||
"500tech": {
|
"500tech": {
|
||||||
"desc": "Learn from 500Tech, an Angular consultancy in Israel. This course was built by an expert developer, who lives and breathes Angular, and has practical experience with real world large scale Angular apps.",
|
"desc": "Learn from 500Tech, an Angular consultancy in Israel. This course was built by an expert developer, who lives and breathes Angular, and has practical experience with real world large scale Angular apps.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Hands-on Course (Israel)",
|
"title": "Angular Hands-on Course (Israel)",
|
||||||
"url": "http://angular2.courses.500tech.com/"
|
"url": "http://angular2.courses.500tech.com/"
|
||||||
},
|
},
|
||||||
"9ab": {
|
"9ab": {
|
||||||
"desc": "OnSite Training From the Authors of \"Become A Ninja with Angular\"",
|
"desc": "OnSite Training From the Authors of \"Become A Ninja with Angular\"",
|
||||||
"rev": true,
|
|
||||||
"title": "Ninja Squad",
|
"title": "Ninja Squad",
|
||||||
"url": "http://ninja-squad.com/formations/formation-angular2"
|
"url": "http://ninja-squad.com/formations/formation-angular2"
|
||||||
},
|
},
|
||||||
"a2b": {
|
"a2b": {
|
||||||
"desc": "Angular Boot Camp covers introductory through advanced Angular topics. It includes extensive workshop sessions, with hands-on help from our experienced developer-trainers. We take developers or teams from the beginnings of Angular understanding through a working knowledge of all essential Angular features.",
|
"desc": "Angular Boot Camp covers introductory through advanced Angular topics. It includes extensive workshop sessions, with hands-on help from our experienced developer-trainers. We take developers or teams from the beginnings of Angular understanding through a working knowledge of all essential Angular features.",
|
||||||
"logo": "https://angularbootcamp.com/images/angular-boot-camp-logo.svg",
|
"logo": "https://angularbootcamp.com/images/angular-boot-camp-logo.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Boot Camp",
|
"title": "Angular Boot Camp",
|
||||||
"url": "https://angularbootcamp.com"
|
"url": "https://angularbootcamp.com"
|
||||||
},
|
},
|
||||||
"ab3": {
|
"ab3": {
|
||||||
"desc": "Trainings & Code Reviews. We help people to get a deep understanding of different technologies through trainings and code reviews. Our services can be arranged online, making it possible to join in from anywhere in the world, or on-site to get the best experience possible.",
|
"desc": "Trainings & Code Reviews. We help people to get a deep understanding of different technologies through trainings and code reviews. Our services can be arranged online, making it possible to join in from anywhere in the world, or on-site to get the best experience possible.",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
|
||||||
"title": "Thoughtram",
|
"title": "Thoughtram",
|
||||||
"url": "http://thoughtram.io/"
|
"url": "http://thoughtram.io/"
|
||||||
},
|
},
|
||||||
"jsru": {
|
"jsru": {
|
||||||
"desc": "Complete Angular online course. Constantly updating. Real-time webinars with immediate feedback from the teacher.",
|
"desc": "Complete Angular online course. Constantly updating. Real-time webinars with immediate feedback from the teacher.",
|
||||||
"logo": "https://learn.javascript.ru/img/sitetoolbar__logo_ru.svg",
|
"logo": "https://learn.javascript.ru/img/sitetoolbar__logo_ru.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Learn Javascript (Russian)",
|
"title": "Learn Javascript (Russian)",
|
||||||
"url": "https://learn.javascript.ru/courses/angular"
|
"url": "https://learn.javascript.ru/courses/angular"
|
||||||
},
|
},
|
||||||
"zenika-angular": {
|
"zenika-angular": {
|
||||||
"desc": "Angular trainings delivered by Zenika (FRANCE)",
|
"desc": "Angular trainings delivered by Zenika (FRANCE)",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Trainings (French)",
|
"title": "Angular Trainings (French)",
|
||||||
"url": "https://training.zenika.com/fr/training/angular/description"
|
"url": "https://training.zenika.com/fr/training/angular/description"
|
||||||
},
|
},
|
||||||
"formationjs": {
|
"formationjs": {
|
||||||
"desc": "Angular onsite training in Paris (France). Monthly Angular workshops and custom onsite classes. We are focused on Angular, so we are always up to date.",
|
"desc": "Angular onsite training in Paris (France). Monthly Angular workshops and custom onsite classes. We are focused on Angular, so we are always up to date.",
|
||||||
"rev": true,
|
|
||||||
"title": "Formation JavaScript (French)",
|
"title": "Formation JavaScript (French)",
|
||||||
"url": "https://formationjavascript.com/formation-angular/"
|
"url": "https://formationjavascript.com/formation-angular/"
|
||||||
},
|
},
|
||||||
"humancoders-angular": {
|
"humancoders-angular": {
|
||||||
"desc": "Angular trainings delivered by Human Coders (France)",
|
"desc": "Angular trainings delivered by Human Coders (France)",
|
||||||
"rev": true,
|
|
||||||
"title": "Formation Angular (French)",
|
"title": "Formation Angular (French)",
|
||||||
"url": "https://www.humancoders.com/formations/angular"
|
"url": "https://www.humancoders.com/formations/angular"
|
||||||
},
|
},
|
||||||
"wao": {
|
"wao": {
|
||||||
"desc": "Onsite Angular Training delivered by We Are One Sàrl in Switzerland",
|
"desc": "Onsite Angular Training delivered by We Are One Sàrl in Switzerland",
|
||||||
"logo": "https://weareone.ch/wordpress/wao-content/uploads/2014/12/logo_200_2x.png",
|
"logo": "https://weareone.ch/wordpress/wao-content/uploads/2014/12/logo_200_2x.png",
|
||||||
"rev": true,
|
|
||||||
"title": "We Are One Sàrl",
|
"title": "We Are One Sàrl",
|
||||||
"url": "https://weareone.ch/courses/angular/"
|
"url": "https://weareone.ch/courses/angular/"
|
||||||
},
|
},
|
||||||
"angular-schule": {
|
"angular-schule": {
|
||||||
"desc": "Angular onsite training and public workshops in Germany from the authors of the German Angular book. We also regularly post articles and videos on our blog (in English and German language).",
|
"desc": "Angular onsite training and public workshops in Germany from the authors of the German Angular book. We also regularly post articles and videos on our blog (in English and German language).",
|
||||||
"logo": "https://angular.schule/assets/img/brand.svg",
|
"logo": "https://angular.schule/assets/img/brand.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular.Schule (German)",
|
"title": "Angular.Schule (German)",
|
||||||
"url": "https://angular.schule/"
|
"url": "https://angular.schule/"
|
||||||
},
|
},
|
||||||
"strbrw": {
|
"strbrw": {
|
||||||
"desc": "Angular and RxJS trainings, Code Reviews and consultancy. We help software engineers all over the world to create better web-applications...",
|
"desc": "Angular and RxJS trainings, Code Reviews and consultancy. We help software engineers all over the world to create better web-applications...",
|
||||||
"rev": true,
|
|
||||||
"title": "StrongBrew",
|
"title": "StrongBrew",
|
||||||
"url": "https://strongbrew.io/"
|
"url": "https://strongbrew.io/"
|
||||||
},
|
},
|
||||||
"angular.de": {
|
"angular.de": {
|
||||||
"desc": "Onsite Angular Training delivered by the greatest community in the german speaking area in Germany, Austria and Switzerland. We also regularly post articles and tutorials on our blog.",
|
"desc": "Onsite Angular Training delivered by the greatest community in the german speaking area in Germany, Austria and Switzerland. We also regularly post articles and tutorials on our blog.",
|
||||||
"logo": "https://angular.de/assets/img/angular-de-logo.svg",
|
"logo": "https://angular.de/assets/img/angular-de-logo.svg",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular.de (German)",
|
"title": "Angular.de (German)",
|
||||||
"url": "https://angular.de/"
|
"url": "https://angular.de/"
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/lifecycle-hooks",
|
"url": "guide/lifecycle-hooks",
|
||||||
"title": "Lifecycle Hooks",
|
"title": "Hook into the Component Lifecycle",
|
||||||
"tooltip": "Angular calls lifecycle hook methods on directives and components as it creates, changes, and destroys them."
|
"tooltip": "Angular calls lifecycle hook methods on directives and components as it creates, changes, and destroys them."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -261,13 +261,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/form-validation",
|
"url": "guide/form-validation",
|
||||||
"title": "Form Validation",
|
"title": "Validate form input",
|
||||||
"tooltip": "Validate user's form entries."
|
"tooltip": "Validate user's form entries."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/dynamic-form",
|
"url": "guide/dynamic-form",
|
||||||
"title": "Dynamic Forms",
|
"title": "Building Dynamic Forms",
|
||||||
"tooltip": "Render dynamic forms with FormGroup."
|
"tooltip": "Create dynamic form templates using FormGroup."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -746,17 +746,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"title": "Tutorials",
|
|
||||||
"tooltop": "End-to-end tutorials for learning Angular concepts and patterns.",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"url": "guide/router-tutorial",
|
|
||||||
"title": "Using Angular Routes in a Single-page Application",
|
|
||||||
"tooltip": "A tutorial that covers many patterns associated with Angular routing."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"title": "Release Information",
|
"title": "Release Information",
|
||||||
"tooltip": "Angular release practices, updating, and upgrading.",
|
"tooltip": "Angular release practices, updating, and upgrading.",
|
||||||
@ -772,9 +761,56 @@
|
|||||||
"tooltip": "Angular versioning, release, support, and deprecation policies and practices."
|
"tooltip": "Angular versioning, release, support, and deprecation policies and practices."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/updating-to-version-9",
|
|
||||||
"title": "Updating to Version 9",
|
"title": "Updating to Version 9",
|
||||||
"tooltip": "Support for updating your application from version 8 to 9."
|
"tooltip": "Support for updating your application from version 8 to 9.",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"url": "guide/updating-to-version-9",
|
||||||
|
"title": "Overview",
|
||||||
|
"tooltip": "Everything you need to know for updating your application from version 8 to 9."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/ivy-compatibility",
|
||||||
|
"title": "Ivy Compatibility Guide",
|
||||||
|
"tooltip": "Details to help you make sure your application is compatible with Ivy."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Optional Migrations",
|
||||||
|
"tooltip": "Optional migration details regarding updating to version 9.",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"url": "guide/migration-renderer",
|
||||||
|
"title": "Renderer to Renderer2",
|
||||||
|
"tooltip": "Migration from the deprecated Renderer API to the newer Renderer2 API."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/migration-dynamic-flag",
|
||||||
|
"title": "Dynamic Queries Flag",
|
||||||
|
"tooltip": "Migration to remove unnecessary `static: false` flag from @ViewChild and @ContentChild queries."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/migration-injectable",
|
||||||
|
"title": "Missing @Injectable() Decorators",
|
||||||
|
"tooltip": "Migration to add missing @Injectable() decorators and incomplete provider definitions."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/migration-localize",
|
||||||
|
"title": "$localize Global Import",
|
||||||
|
"tooltip": "Migration to add an import statement for @angular/localize to polyfills.ts."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/migration-module-with-providers",
|
||||||
|
"title": "Missing ModuleWithProviders Generic",
|
||||||
|
"tooltip": "Migration to add a generic type to any ModuleWithProviders usages that are missing the generic."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "guide/migration-undecorated-classes",
|
||||||
|
"title": "Missing @Directive() Decorators",
|
||||||
|
"tooltip": "Migration to add missing @Directive()/@Component() decorators."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/deprecations",
|
"url": "guide/deprecations",
|
||||||
|
@ -86,6 +86,6 @@ Angular offers many more capabilities, and you now have a foundation that empowe
|
|||||||
* Angular provides advanced capabilities for mobile apps, animation, internationalization, server-side rendering, and more.
|
* Angular provides advanced capabilities for mobile apps, animation, internationalization, server-side rendering, and more.
|
||||||
* [Angular Material](https://material.angular.io/ "Angular Material web site") offers an extensive library of Material Design components.
|
* [Angular Material](https://material.angular.io/ "Angular Material web site") offers an extensive library of Material Design components.
|
||||||
* [Angular Protractor](https://protractor.angular.io/ "Angular Protractor web site") offers an end-to-end testing framework for Angular apps.
|
* [Angular Protractor](https://protractor.angular.io/ "Angular Protractor web site") offers an end-to-end testing framework for Angular apps.
|
||||||
* Angular also has an extensive [network of 3rd-party tools and libraries](https://angular.io/resources "Angular resources list").
|
* Angular also has an extensive [network of 3rd-party tools and libraries](resources "Angular resources list").
|
||||||
|
|
||||||
Keep current by following the [Angular blog](https://blog.angular.io/ "Angular blog").
|
Keep current by following the [Angular blog](https://blog.angular.io/ "Angular blog").
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"build-local-with-viewengine": "yarn ~~build",
|
"build-local-with-viewengine": "yarn ~~build",
|
||||||
"prebuild-local-with-viewengine-ci": "node scripts/switch-to-viewengine && yarn setup-local-ci",
|
"prebuild-local-with-viewengine-ci": "node scripts/switch-to-viewengine && yarn setup-local-ci",
|
||||||
"build-local-with-viewengine-ci": "yarn ~~build --progress=false",
|
"build-local-with-viewengine-ci": "yarn ~~build --progress=false",
|
||||||
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js b7d7ee9bd",
|
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js 7653f8616",
|
||||||
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
||||||
"test": "yarn check-env && ng test",
|
"test": "yarn check-env && ng test",
|
||||||
"pree2e": "yarn check-env && yarn update-webdriver",
|
"pree2e": "yarn check-env && yarn update-webdriver",
|
||||||
|
@ -5,13 +5,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-toolbar color="primary" class="app-toolbar no-print" [class.transitioning]="isTransitioning">
|
<mat-toolbar color="primary" class="app-toolbar no-print" [class.transitioning]="isTransitioning">
|
||||||
<mat-toolbar-row class="notification-container">
|
<mat-toolbar-row class="notification-container blm-message">
|
||||||
<aio-notification notificationId="survey-march-2020" expirationDate="2020-04-15" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
|
<aio-notification notificationId="blm-2020" expirationDate="2022-04-15" [dismissOnContentClick]="true" (dismissed)="notificationDismissed()">
|
||||||
<a href="https://goo.gle/angular-survey-2020">
|
#BlackLivesMatter
|
||||||
<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>
|
|
||||||
</a>
|
|
||||||
</aio-notification>
|
</aio-notification>
|
||||||
</mat-toolbar-row>
|
</mat-toolbar-row>
|
||||||
<mat-toolbar-row>
|
<mat-toolbar-row>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<h3 class="subcategory-title">{{subCategory.title}}</h3>
|
<h3 class="subcategory-title">{{subCategory.title}}</h3>
|
||||||
|
|
||||||
<div *ngFor="let resource of subCategory.resources">
|
<div *ngFor="let resource of subCategory.resources">
|
||||||
<div class="c-resource" *ngIf="resource.rev">
|
<div class="c-resource">
|
||||||
<a class="l-flex--column resource-row-link" rel="noopener" target="_blank" [href]="resource.url">
|
<a class="l-flex--column resource-row-link" rel="noopener" target="_blank" [href]="resource.url">
|
||||||
<div>
|
<div>
|
||||||
<h4>{{resource.title}}</h4>
|
<h4>{{resource.title}}</h4>
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
export class Category {
|
export interface Category {
|
||||||
id: string; // "education"
|
id: string; // "education"
|
||||||
title: string; // "Education"
|
title: string; // "Education"
|
||||||
order: number; // 2
|
order: number; // 2
|
||||||
subCategories: SubCategory[];
|
subCategories: SubCategory[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SubCategory {
|
export interface SubCategory {
|
||||||
id: string; // "books"
|
id: string; // "books"
|
||||||
title: string; // "Books"
|
title: string; // "Books"
|
||||||
order: number; // 1
|
order: number; // 1
|
||||||
resources: Resource[];
|
resources: Resource[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Resource {
|
export interface Resource {
|
||||||
category: string; // "Education"
|
category: string; // "Education"
|
||||||
subCategory: string; // "Books"
|
subCategory: string; // "Books"
|
||||||
id: string; // "-KLI8vJ0ZkvWhqPembZ7"
|
id: string; // "-KLI8vJ0ZkvWhqPembZ7"
|
||||||
desc: string; // "This books shows all the steps necessary for the development of SPA"
|
desc: string; // "This books shows all the steps necessary for the development of SPA"
|
||||||
rev: boolean; // true (always true in the original)
|
|
||||||
title: string; // "Practical Angular 2",
|
title: string; // "Practical Angular 2",
|
||||||
url: string; // "https://leanpub.com/practical-angular-2"
|
url: string; // "https://leanpub.com/practical-angular-2"
|
||||||
}
|
}
|
||||||
|
@ -96,13 +96,11 @@ function getTestResources() {
|
|||||||
"resources": {
|
"resources": {
|
||||||
"Cat3 SubCat1 Res1": {
|
"Cat3 SubCat1 Res1": {
|
||||||
"desc": "Meetup in Barcelona, Spain. ",
|
"desc": "Meetup in Barcelona, Spain. ",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Beers",
|
"title": "Angular Beers",
|
||||||
"url": "http://www.meetup.com/AngularJS-Beers/"
|
"url": "http://www.meetup.com/AngularJS-Beers/"
|
||||||
},
|
},
|
||||||
"Cat3 SubCat1 Res2": {
|
"Cat3 SubCat1 Res2": {
|
||||||
"desc": "Angular Camps in Barcelona, Spain.",
|
"desc": "Angular Camps in Barcelona, Spain.",
|
||||||
"rev": true,
|
|
||||||
"title": "Angular Camp",
|
"title": "Angular Camp",
|
||||||
"url": "http://angularcamp.org/"
|
"url": "http://angularcamp.org/"
|
||||||
}
|
}
|
||||||
@ -113,7 +111,6 @@ function getTestResources() {
|
|||||||
"resources": {
|
"resources": {
|
||||||
"Cat3 SubCat2 Res1": {
|
"Cat3 SubCat2 Res1": {
|
||||||
"desc": "A community index of components and libraries",
|
"desc": "A community index of components and libraries",
|
||||||
"rev": true,
|
|
||||||
"title": "Catalog of Angular Components & Libraries",
|
"title": "Catalog of Angular Components & Libraries",
|
||||||
"url": "https://a/b/c"
|
"url": "https://a/b/c"
|
||||||
}
|
}
|
||||||
@ -129,19 +126,16 @@ function getTestResources() {
|
|||||||
"resources": {
|
"resources": {
|
||||||
"S S S": {
|
"S S S": {
|
||||||
"desc": "SSS",
|
"desc": "SSS",
|
||||||
"rev": true,
|
|
||||||
"title": "Sssss",
|
"title": "Sssss",
|
||||||
"url": "http://s/s/s"
|
"url": "http://s/s/s"
|
||||||
},
|
},
|
||||||
"A A A": {
|
"A A A": {
|
||||||
"desc": "AAA",
|
"desc": "AAA",
|
||||||
"rev": true,
|
|
||||||
"title": "Aaaa",
|
"title": "Aaaa",
|
||||||
"url": "http://a/a/a"
|
"url": "http://a/a/a"
|
||||||
},
|
},
|
||||||
"Z Z Z": {
|
"Z Z Z": {
|
||||||
"desc": "ZZZ",
|
"desc": "ZZZ",
|
||||||
"rev": true,
|
|
||||||
"title": "Zzzzz",
|
"title": "Zzzzz",
|
||||||
"url": "http://z/z/z"
|
"url": "http://z/z/z"
|
||||||
}
|
}
|
||||||
|
@ -192,3 +192,32 @@ code {
|
|||||||
color: $mediumgray;
|
color: $mediumgray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.folder-api,
|
||||||
|
.folder-cli,
|
||||||
|
.folder-docs,
|
||||||
|
.folder-guide,
|
||||||
|
.folder-start,
|
||||||
|
.folder-tutorial {
|
||||||
|
|
||||||
|
aio-doc-viewer{
|
||||||
|
a {
|
||||||
|
&[href^="http:"]::after,
|
||||||
|
&[href^="https:"]::after {
|
||||||
|
font-family: "Material Icons";
|
||||||
|
content: "open_in_new";
|
||||||
|
margin-left: 2px;
|
||||||
|
position: relative;
|
||||||
|
@include line-height(24);
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.github-links a {
|
||||||
|
&[href^="http:"]::after,
|
||||||
|
&[href^="https:"]::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -183,8 +183,8 @@ section#intro {
|
|||||||
|
|
||||||
// ANGULAR LINE
|
// ANGULAR LINE
|
||||||
.background-sky {
|
.background-sky {
|
||||||
background-color: $blue;
|
background-color: $black;
|
||||||
background: $bluegradient;
|
background: $black;
|
||||||
color: $white;
|
color: $white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +177,16 @@ button.vertical-menu-item {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding-left: 32px;
|
padding-left: 32px;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
|
|
||||||
|
&.expanded .mat-icon,
|
||||||
|
.level-3.expanded .mat-icon {
|
||||||
|
@include rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.expanded) .mat-icon,
|
||||||
|
.level-3:not(.expanded) .mat-icon {
|
||||||
|
@include rotate(0deg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.level-3 {
|
.level-3 {
|
||||||
@ -185,6 +195,16 @@ button.vertical-menu-item {
|
|||||||
@include font-size(14);
|
@include font-size(14);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-4 {
|
||||||
|
color: $mediumgray;
|
||||||
|
font-family: $main-font;
|
||||||
|
@include font-size(14);
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 48px;
|
||||||
|
text-transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
aio-nav-menu.top-menu {
|
aio-nav-menu.top-menu {
|
||||||
|
@ -20,9 +20,16 @@ mat-toolbar.mat-toolbar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blm-message {
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: #2d2d2d;
|
||||||
|
font-size: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
// HOME PAGE OVERRIDE: TOPNAV TOOLBAR
|
// HOME PAGE OVERRIDE: TOPNAV TOOLBAR
|
||||||
aio-shell.page-home mat-toolbar.mat-toolbar {
|
aio-shell.page-home mat-toolbar.mat-toolbar {
|
||||||
background-color: $blue;
|
background-color: $black;
|
||||||
|
|
||||||
@media (min-width: 481px) {
|
@media (min-width: 481px) {
|
||||||
&:not(.transitioning) {
|
&:not(.transitioning) {
|
||||||
|
@ -23,7 +23,7 @@ const DEFAULT_CLI_EXAMPLE_PORT = 4200;
|
|||||||
const DEFAULT_CLI_SPECS_CONCURRENCY = 1;
|
const DEFAULT_CLI_SPECS_CONCURRENCY = 1;
|
||||||
const IGNORED_EXAMPLES = [
|
const IGNORED_EXAMPLES = [
|
||||||
// temporary ignores
|
// temporary ignores
|
||||||
'upgrade-phonecat-2-hybrid' // https://github.com/angular/angular/issues/36957
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const fixmeIvyExamples = [
|
const fixmeIvyExamples = [
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"angular": "1.7.9",
|
"angular": "1.7.9",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"angular-route": "1.7.9",
|
"angular-route": "1.7.9",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
"@angular/platform-browser": "~9.1.4",
|
"@angular/platform-browser": "~9.1.4",
|
||||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.10.3"
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"@webcomponents/custom-elements": "^1.4.1",
|
"@webcomponents/custom-elements": "^1.4.1",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.10.3"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"@angular/platform-browser": "~9.1.4",
|
"@angular/platform-browser": "~9.1.4",
|
||||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.10.3"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"@angular/platform-browser-dynamic": "~9.1.4",
|
"@angular/platform-browser-dynamic": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"@angular/service-worker": "~9.1.4",
|
"@angular/service-worker": "~9.1.4",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
"zone.js": "~0.10.3"
|
"zone.js": "~0.10.3"
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../out-tsc/app",
|
"outDir": "../out-tsc/app",
|
||||||
"types": [],
|
"types": []
|
||||||
// TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders
|
|
||||||
"skipLibCheck": true
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src/main.ts",
|
"src/main.ts",
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
"@angular/platform-server": "~9.1.4",
|
"@angular/platform-server": "~9.1.4",
|
||||||
"@angular/router": "~9.1.4",
|
"@angular/router": "~9.1.4",
|
||||||
"@nguniversal/express-engine": "~9.0.1",
|
"@nguniversal/express-engine": "~9.0.1",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"express": "^4.15.2",
|
"express": "^4.15.2",
|
||||||
"rxjs": "~6.5.4",
|
"rxjs": "~6.5.4",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
|
@ -17,9 +17,7 @@
|
|||||||
"lib": [
|
"lib": [
|
||||||
"es2018",
|
"es2018",
|
||||||
"dom"
|
"dom"
|
||||||
],
|
]
|
||||||
// TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders
|
|
||||||
"skipLibCheck": true
|
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"enableIvy": false,
|
"enableIvy": false,
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
"@nguniversal/express-engine": "~9.0.1",
|
"@nguniversal/express-engine": "~9.0.1",
|
||||||
"@webcomponents/custom-elements": "^1.4.1",
|
"@webcomponents/custom-elements": "^1.4.1",
|
||||||
"angular": "1.7.9",
|
"angular": "1.7.9",
|
||||||
"angular-in-memory-web-api": "~0.9.0",
|
"angular-in-memory-web-api": "~0.11.0",
|
||||||
"angular-route": "1.7.9",
|
"angular-route": "1.7.9",
|
||||||
"core-js": "^2.5.4",
|
"core-js": "^2.5.4",
|
||||||
"express": "^4.15.2",
|
"express": "^4.15.2",
|
||||||
|
@ -13,9 +13,7 @@
|
|||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
],
|
]
|
||||||
// TODO(FW-2145): turn lib checks back on after fixing in-memory-api and investigating impact of ModuleWithProviders
|
|
||||||
"skipLibCheck": true
|
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"../../../content/examples/*/e2e-spec.ts"
|
"../../../content/examples/*/e2e-spec.ts"
|
||||||
|
@ -1899,10 +1899,10 @@ alphanum-sort@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
|
resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
|
||||||
integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=
|
integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=
|
||||||
|
|
||||||
angular-in-memory-web-api@~0.9.0:
|
angular-in-memory-web-api@~0.11.0:
|
||||||
version "0.9.0"
|
version "0.11.0"
|
||||||
resolved "https://registry.yarnpkg.com/angular-in-memory-web-api/-/angular-in-memory-web-api-0.9.0.tgz#6c98d9494fadc6b98f54e68376a1998ccfff04bc"
|
resolved "https://registry.yarnpkg.com/angular-in-memory-web-api/-/angular-in-memory-web-api-0.11.0.tgz#46e4ad896b36d669f36801fc8cafa7db8278d078"
|
||||||
integrity sha512-//PiJ5qb1+Yf/N7270ioQqR2laf4/Irjavg+M+WEn8y4At9LUoYgbQ5HVwvM5xUTlVlL0XkbJRLxREcGGNdIEw==
|
integrity sha512-QV1qYHm+Zd+wrvlcPLnAcqqGpOmCN1EUj4rRuYHpek8+QqFFdxBNuPZOJCKvU7I97z5QSKHsdc6PNKlpUQr3UA==
|
||||||
|
|
||||||
angular-route@1.7.9:
|
angular-route@1.7.9:
|
||||||
version "1.7.9"
|
version "1.7.9"
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
var _ = require('lodash');
|
|
||||||
|
|
||||||
module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) {
|
module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) {
|
||||||
|
|
||||||
// Add the "directive" docType into those that can be exported from a module
|
// Add the "directive" docType into those that can be exported from a module
|
||||||
@ -10,18 +8,12 @@ module.exports = function extractDecoratedClassesProcessor(EXPORT_DOC_TYPES) {
|
|||||||
$runBefore: ['docs-processed'],
|
$runBefore: ['docs-processed'],
|
||||||
decoratorTypes: ['Directive', 'Component', 'Pipe', 'NgModule'],
|
decoratorTypes: ['Directive', 'Component', 'Pipe', 'NgModule'],
|
||||||
$process: function(docs) {
|
$process: function(docs) {
|
||||||
var decoratorTypes = this.decoratorTypes;
|
const decoratorTypes = this.decoratorTypes;
|
||||||
|
docs.forEach(doc => {
|
||||||
_.forEach(docs, function(doc) {
|
(doc.decorators || []).forEach(decorator => {
|
||||||
|
|
||||||
_.forEach(doc.decorators, function(decorator) {
|
|
||||||
|
|
||||||
if (decoratorTypes.indexOf(decorator.name) !== -1) {
|
if (decoratorTypes.indexOf(decorator.name) !== -1) {
|
||||||
doc.docType = decorator.name.toLowerCase();
|
doc.docType = decorator.name.toLowerCase();
|
||||||
// Directives do not always have an argument (i.e. abstract directives).
|
doc[doc.docType + 'Options'] = decorator.argumentInfo[0];
|
||||||
// We still create options for those, as an empty object literal is equal
|
|
||||||
// to just having an empty object literal as decorator argument.
|
|
||||||
doc[doc.docType + 'Options'] = decorator.argumentInfo[0] || {};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,20 +3,11 @@ module.exports = function processNgModuleDocs(getDocFromAlias, createDocMessage,
|
|||||||
$runAfter: ['extractDecoratedClassesProcessor', 'computeIdsProcessor'],
|
$runAfter: ['extractDecoratedClassesProcessor', 'computeIdsProcessor'],
|
||||||
$runBefore: ['createSitemap'],
|
$runBefore: ['createSitemap'],
|
||||||
exportDocTypes: ['directive', 'pipe'],
|
exportDocTypes: ['directive', 'pipe'],
|
||||||
skipAbstractDirectives: true,
|
|
||||||
$process(docs) {
|
$process(docs) {
|
||||||
// Match all the directives/pipes to their module
|
// Match all the directives/pipes to their module
|
||||||
const errors = [];
|
const errors = [];
|
||||||
docs.forEach(doc => {
|
docs.forEach(doc => {
|
||||||
if (this.exportDocTypes.indexOf(doc.docType) !== -1) {
|
if (this.exportDocTypes.indexOf(doc.docType) !== -1) {
|
||||||
const options = doc[`${doc.docType}Options`];
|
|
||||||
|
|
||||||
// Directives without a selector are considered abstract and do
|
|
||||||
// not need to be part of any `@NgModule`.
|
|
||||||
if (this.skipAbstractDirectives && doc.docType === 'directive' && !options.selector) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!doc.ngModules || doc.ngModules.length === 0) {
|
if (!doc.ngModules || doc.ngModules.length === 0) {
|
||||||
errors.push(createDocMessage(`"${doc.id}" has no @ngModule tag. Docs of type "${doc.docType}" must have this tag.`, doc));
|
errors.push(createDocMessage(`"${doc.id}" has no @ngModule tag. Docs of type "${doc.docType}" must have this tag.`, doc));
|
||||||
return;
|
return;
|
||||||
|
@ -39,12 +39,11 @@ describe('processNgModuleDocs processor', () => {
|
|||||||
|
|
||||||
it('should link directive/pipe docs with their NgModule docs (sorted by id)', () => {
|
it('should link directive/pipe docs with their NgModule docs (sorted by id)', () => {
|
||||||
const aliasMap = injector.get('aliasMap');
|
const aliasMap = injector.get('aliasMap');
|
||||||
const directiveOptions = {selector: 'some-selector'};
|
|
||||||
const ngModule1 = { docType: 'ngmodule', id: 'NgModule1', aliases: ['NgModule1'], ngmoduleOptions: {}};
|
const ngModule1 = { docType: 'ngmodule', id: 'NgModule1', aliases: ['NgModule1'], ngmoduleOptions: {}};
|
||||||
const ngModule2 = { docType: 'ngmodule', id: 'NgModule2', aliases: ['NgModule2'], ngmoduleOptions: {}};
|
const ngModule2 = { docType: 'ngmodule', id: 'NgModule2', aliases: ['NgModule2'], ngmoduleOptions: {}};
|
||||||
const directive1 = { docType: 'directive', id: 'Directive1', ngModules: ['NgModule1'], directiveOptions};
|
const directive1 = { docType: 'directive', id: 'Directive1', ngModules: ['NgModule1']};
|
||||||
const directive2 = { docType: 'directive', id: 'Directive2', ngModules: ['NgModule2'], directiveOptions};
|
const directive2 = { docType: 'directive', id: 'Directive2', ngModules: ['NgModule2']};
|
||||||
const directive3 = { docType: 'directive', id: 'Directive3', ngModules: ['NgModule1', 'NgModule2'], directiveOptions};
|
const directive3 = { docType: 'directive', id: 'Directive3', ngModules: ['NgModule1', 'NgModule2']};
|
||||||
const pipe1 = { docType: 'pipe', id: 'Pipe1', ngModules: ['NgModule1']};
|
const pipe1 = { docType: 'pipe', id: 'Pipe1', ngModules: ['NgModule1']};
|
||||||
const pipe2 = { docType: 'pipe', id: 'Pipe2', ngModules: ['NgModule2']};
|
const pipe2 = { docType: 'pipe', id: 'Pipe2', ngModules: ['NgModule2']};
|
||||||
const pipe3 = { docType: 'pipe', id: 'Pipe3', ngModules: ['NgModule1', 'NgModule2']};
|
const pipe3 = { docType: 'pipe', id: 'Pipe3', ngModules: ['NgModule1', 'NgModule2']};
|
||||||
@ -67,22 +66,10 @@ describe('processNgModuleDocs processor', () => {
|
|||||||
expect(pipe3.ngModules).toEqual([ngModule1, ngModule2]);
|
expect(pipe3.ngModules).toEqual([ngModule1, ngModule2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not error if an abstract directove does not have a `@ngModule` tag', () => {
|
|
||||||
expect(() => {
|
|
||||||
processor.$process([{ docType: 'directive', id: 'AbstractDir', directiveOptions: {} }]);
|
|
||||||
}).not.toThrow();
|
|
||||||
|
|
||||||
expect(() => {
|
|
||||||
processor.$process([{ docType: 'directive', id: 'AbstractDir',
|
|
||||||
directiveOptions: {selector: undefined} }]);
|
|
||||||
}).not.toThrow();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should error if a pipe/directive does not have a `@ngModule` tag', () => {
|
it('should error if a pipe/directive does not have a `@ngModule` tag', () => {
|
||||||
const log = injector.get('log');
|
const log = injector.get('log');
|
||||||
expect(() => {
|
expect(() => {
|
||||||
processor.$process([{ docType: 'directive', id: 'Directive1',
|
processor.$process([{ docType: 'directive', id: 'Directive1' }]);
|
||||||
directiveOptions: {selector: 'dir1'} }]);
|
|
||||||
}).toThrowError('Failed to process NgModule relationships.');
|
}).toThrowError('Failed to process NgModule relationships.');
|
||||||
expect(log.error).toHaveBeenCalledWith(
|
expect(log.error).toHaveBeenCalledWith(
|
||||||
'"Directive1" has no @ngModule tag. Docs of type "directive" must have this tag. - doc "Directive1" (directive) ');
|
'"Directive1" has no @ngModule tag. Docs of type "directive" must have this tag. - doc "Directive1" (directive) ');
|
||||||
@ -97,8 +84,7 @@ describe('processNgModuleDocs processor', () => {
|
|||||||
it('should error if a pipe/directive has an @ngModule tag that does not match an NgModule doc', () => {
|
it('should error if a pipe/directive has an @ngModule tag that does not match an NgModule doc', () => {
|
||||||
const log = injector.get('log');
|
const log = injector.get('log');
|
||||||
expect(() => {
|
expect(() => {
|
||||||
processor.$process([{ docType: 'directive', id: 'Directive1', ngModules: ['MissingNgModule'],
|
processor.$process([{ docType: 'directive', id: 'Directive1', ngModules: ['MissingNgModule'] }]);
|
||||||
directiveOptions: {selector: 'dir1'} }]);
|
|
||||||
}).toThrowError('Failed to process NgModule relationships.');
|
}).toThrowError('Failed to process NgModule relationships.');
|
||||||
expect(log.error).toHaveBeenCalledWith(
|
expect(log.error).toHaveBeenCalledWith(
|
||||||
'"@ngModule MissingNgModule" does not match a public NgModule - doc "Directive1" (directive) ');
|
'"@ngModule MissingNgModule" does not match a public NgModule - doc "Directive1" (directive) ');
|
||||||
@ -119,9 +105,7 @@ describe('processNgModuleDocs processor', () => {
|
|||||||
aliasMap.addDoc(ngModule2);
|
aliasMap.addDoc(ngModule2);
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
processor.$process([{
|
processor.$process([{ docType: 'directive', id: 'Directive1', ngModules: ['NgModuleAlias'] }]);
|
||||||
docType: 'directive', id: 'Directive1', ngModules: ['NgModuleAlias'],
|
|
||||||
directiveOptions: {selector: 'dir1'} }]);
|
|
||||||
}).toThrowError('Failed to process NgModule relationships.');
|
}).toThrowError('Failed to process NgModule relationships.');
|
||||||
expect(log.error).toHaveBeenCalledWith(
|
expect(log.error).toHaveBeenCalledWith(
|
||||||
'"@ngModule NgModuleAlias" is ambiguous. Matches: NgModule1, NgModule2 - doc "Directive1" (directive) ');
|
'"@ngModule NgModuleAlias" is ambiguous. Matches: NgModule1, NgModule2 - doc "Directive1" (directive) ');
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'searchKeywords',
|
name: 'searchKeywords',
|
||||||
description: 'A shorthand for creating elements with search terms. Usage: `{@searchKeywords term1 term2 termN }`',
|
description:
|
||||||
|
'A shorthand for creating elements with search terms. Usage: `{@searchKeywords term1 term2 termN }`',
|
||||||
handler: function(doc, tagName, tagDescription) {
|
handler: function(doc, tagName, tagDescription) {
|
||||||
doc.searchKeywords = tagDescription;
|
doc.searchKeywords = tagDescription;
|
||||||
return doc;
|
return '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -15,25 +15,28 @@ module.exports = function addImageDimensions(getImageDimensions) {
|
|||||||
return (ast, file) => {
|
return (ast, file) => {
|
||||||
visit(ast, node => {
|
visit(ast, node => {
|
||||||
|
|
||||||
if (is(node, 'img')) {
|
if (!is(node, 'img')) {
|
||||||
const props = node.properties;
|
return;
|
||||||
const src = props.src;
|
}
|
||||||
if (!src) {
|
|
||||||
file.message('Missing src in image tag `' + source(node, file) + '`');
|
const props = node.properties;
|
||||||
|
const src = props.src;
|
||||||
|
if (!src) {
|
||||||
|
file.message('Missing src in image tag `' + source(node, file) + '`');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const dimensions = getImageDimensions(addImageDimensionsImpl.basePath, src);
|
||||||
|
if (props.width === undefined && props.height === undefined) {
|
||||||
|
props.width = '' + dimensions.width;
|
||||||
|
props.height = '' + dimensions.height;
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
if (e.code === 'ENOENT') {
|
||||||
|
file.fail('Unable to load src in image tag `' + source(node, file) + '`');
|
||||||
} else {
|
} else {
|
||||||
try {
|
file.fail(e.message);
|
||||||
const dimensions = getImageDimensions(addImageDimensionsImpl.basePath, src);
|
|
||||||
if (props.width === undefined && props.height === undefined) {
|
|
||||||
props.width = '' + dimensions.width;
|
|
||||||
props.height = '' + dimensions.height;
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
if (e.code === 'ENOENT') {
|
|
||||||
file.fail('Unable to load src in image tag `' + source(node, file) + '`');
|
|
||||||
} else {
|
|
||||||
file.fail(e.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
var _ = require('lodash');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dgProcessor checkUnbalancedBackTicks
|
* @dgProcessor checkUnbalancedBackTicks
|
||||||
* @description
|
* @description
|
||||||
@ -9,25 +7,28 @@ var _ = require('lodash');
|
|||||||
*/
|
*/
|
||||||
module.exports = function checkUnbalancedBackTicks(log, createDocMessage) {
|
module.exports = function checkUnbalancedBackTicks(log, createDocMessage) {
|
||||||
|
|
||||||
var BACKTICK_REGEX = /^ *```/gm;
|
const BACKTICK_REGEX = /^ *```/gm;
|
||||||
|
const UNBALANCED_BACKTICK_WARNING = 'checkUnbalancedBackTicks processor: unbalanced backticks found in rendered content';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// $runAfter: ['checkAnchorLinksProcessor'],
|
|
||||||
$runAfter: ['inlineTagProcessor'],
|
$runAfter: ['inlineTagProcessor'],
|
||||||
$runBefore: ['writeFilesProcessor'],
|
$runBefore: ['writeFilesProcessor'],
|
||||||
$process: function(docs) {
|
$process: function(docs) {
|
||||||
_.forEach(docs, function(doc) {
|
docs
|
||||||
if (doc.renderedContent) {
|
.forEach(doc => setUnbalancedBackTicks(doc));
|
||||||
var matches = doc.renderedContent.match(BACKTICK_REGEX);
|
|
||||||
if (matches && matches.length % 2 !== 0) {
|
|
||||||
doc.unbalancedBackTicks = true;
|
|
||||||
log.warn(createDocMessage(
|
|
||||||
'checkUnbalancedBackTicks processor: unbalanced backticks found in rendered content',
|
|
||||||
doc));
|
|
||||||
log.warn(doc.renderedContent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function setUnbalancedBackTicks(doc) {
|
||||||
|
if (!doc.renderedContent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const matches = doc.renderedContent.match(BACKTICK_REGEX);
|
||||||
|
if (matches && matches.length % 2 !== 0) {
|
||||||
|
doc.unbalancedBackTicks = true;
|
||||||
|
log.warn(createDocMessage(UNBALANCED_BACKTICK_WARNING, doc));
|
||||||
|
log.warn(doc.renderedContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
@ -1,23 +1,23 @@
|
|||||||
var _ = require('lodash');
|
|
||||||
|
|
||||||
module.exports = function createOverviewDump() {
|
module.exports = function createOverviewDump() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
$runAfter: ['processing-docs'],
|
$runAfter: ['processing-docs'],
|
||||||
$runBefore: ['docs-processed'],
|
$runBefore: ['docs-processed'],
|
||||||
$process: function(docs) {
|
$process: function(docs) {
|
||||||
var overviewDoc = {
|
const overviewDoc = {
|
||||||
id: 'overview-dump',
|
id: 'overview-dump',
|
||||||
aliases: ['overview-dump'],
|
aliases: ['overview-dump'],
|
||||||
path: 'overview-dump',
|
path: 'overview-dump',
|
||||||
outputPath: 'overview-dump.html',
|
outputPath: 'overview-dump.html',
|
||||||
modules: []
|
modules: []
|
||||||
};
|
};
|
||||||
_.forEach(docs, function(doc) {
|
|
||||||
|
docs.forEach(doc => {
|
||||||
if (doc.docType === 'package') {
|
if (doc.docType === 'package') {
|
||||||
overviewDoc.modules.push(doc);
|
overviewDoc.modules.push(doc);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
docs.push(overviewDoc);
|
docs.push(overviewDoc);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -30,7 +30,16 @@ var CIconfiguration = {
|
|||||||
'Android7': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Android7': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'Android8': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Android8': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'Android9': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
'Android9': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
||||||
'Android10': {unitTest: {target: 'SL', required: true}, e2e: {target: null, required: true}},
|
// Disable Android 10 tests due to infrastructure failure.
|
||||||
|
// ex:
|
||||||
|
// Chrome Mobile 74.0.3729 (Android 0.0.0) ERROR:
|
||||||
|
// Error: XHR error loading
|
||||||
|
// http://angular-ci.local:9876/base/node_modules/rxjs/internal/operators/zip.js
|
||||||
|
//
|
||||||
|
// Error loading http://angular-ci.local:9876/base/node_modules/rxjs/internal/operators/zip.js as
|
||||||
|
// "../internal/operators/zip" from
|
||||||
|
// http://angular-ci.local:9876/base/node_modules/rxjs/operators/index.js
|
||||||
|
'Android10': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
||||||
'Safari12': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
'Safari12': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
||||||
'Safari13': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
'Safari13': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
||||||
'iOS10': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
'iOS10': {unitTest: {target: 'SL', required: false}, e2e: {target: null, required: true}},
|
||||||
|
@ -10,6 +10,7 @@ ts_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//dev-infra/commit-message",
|
"//dev-infra/commit-message",
|
||||||
"//dev-infra/format",
|
"//dev-infra/format",
|
||||||
|
"//dev-infra/pr",
|
||||||
"//dev-infra/pullapprove",
|
"//dev-infra/pullapprove",
|
||||||
"//dev-infra/release",
|
"//dev-infra/release",
|
||||||
"//dev-infra/ts-circular-dependencies",
|
"//dev-infra/ts-circular-dependencies",
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user