Compare commits
135 Commits
6.0.0-rc.4
...
6.0.0
Author | SHA1 | Date | |
---|---|---|---|
d0ccf5f169 | |||
ecde15298a | |||
983e5f2d7e | |||
5fc4299e0a | |||
1823d5dd1c | |||
91d4da0d2f | |||
22eb8e26fc | |||
f6002c1702 | |||
14138f6382 | |||
f11daa2031 | |||
31a435ef5b | |||
3e92b22258 | |||
2e5457c824 | |||
1ab5fba92e | |||
e1e57ddaa7 | |||
ee7cb48877 | |||
a30c57090a | |||
8a49ec4f27 | |||
697b6c040c | |||
4008e36e80 | |||
e47bb52084 | |||
ac2b530f4b | |||
64bf6edf00 | |||
adf6235479 | |||
04c18ac1aa | |||
1b26dd8cdb | |||
f721b06bde | |||
0bc8443e12 | |||
db17231597 | |||
540626a3a6 | |||
391bfcede5 | |||
d8de6488dd | |||
151fb66848 | |||
02424ff0d0 | |||
f0925d9705 | |||
212b806eda | |||
b9431e88fb | |||
7790cfa0d0 | |||
41b5149509 | |||
06f865640d | |||
824f74f27b | |||
5301c43eed | |||
f280d1aef1 | |||
5e741d42a6 | |||
0035d41030 | |||
08f447ceec | |||
8953f123e3 | |||
6274007e3b | |||
ee76be7783 | |||
a8c720bc3a | |||
ac47a3cd93 | |||
041458a3d2 | |||
2cb74b748f | |||
cb0bfe7a43 | |||
8ee11aeaa6 | |||
bf89fcb361 | |||
4f70c5b6f7 | |||
ad3ebec2a5 | |||
3f5d61f2dd | |||
11ada7f78b | |||
0b96bc7456 | |||
fefadadff3 | |||
946057ae29 | |||
d4293aaaaa | |||
e3dcc227f6 | |||
c9230dd90e | |||
234af9ba59 | |||
7204028d3e | |||
f7c55952bf | |||
e38e3bd135 | |||
cd20c01ba1 | |||
12a191ef3f | |||
65e67b3c3a | |||
32e57f6197 | |||
7de69ba29b | |||
44193c0b94 | |||
6db8241ffa | |||
33c594516c | |||
010a4efa8c | |||
c3280b2c2f | |||
d11b249d36 | |||
9c29127723 | |||
43615604d1 | |||
d9792309ec | |||
fd1c39ce42 | |||
896811df64 | |||
fb59b2dd97 | |||
b64a276d4b | |||
815ae29b83 | |||
8f690c9062 | |||
7b63f861c6 | |||
674c3def31 | |||
80e483ceac | |||
ac683d7abb | |||
33630dd3ed | |||
7e581dab5f | |||
102ed3b03c | |||
29b838c35d | |||
328b48b697 | |||
d1177c75f8 | |||
12f90ef428 | |||
2c09b707ce | |||
f4017ce5e3 | |||
4384a92271 | |||
da31db757b | |||
6f213a74f2 | |||
490772e680 | |||
e7ef02722d | |||
d5e7f60f04 | |||
6e73300ff1 | |||
6c2c95851a | |||
08325aaffc | |||
1e1c7fd408 | |||
d1e716b2cb | |||
639d52fe71 | |||
aa27155618 | |||
eac36d7e1a | |||
0224f1aaf3 | |||
74b203a55e | |||
0e10e731dc | |||
9fabe2f5fa | |||
c2a53bbf61 | |||
3bd682f432 | |||
2bb783824e | |||
6199ea5d4a | |||
2e270bb96a | |||
b76dd3b979 | |||
a025f7e2a6 | |||
221ae6998a | |||
b551f844e4 | |||
f958293205 | |||
993eeababb | |||
75febe7511 | |||
b8f4e433d5 | |||
a4e06b685b |
@ -15,8 +15,12 @@
|
|||||||
var_1: &docker_image angular/ngcontainer:0.2.0
|
var_1: &docker_image angular/ngcontainer:0.2.0
|
||||||
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.2.0
|
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.2.0
|
||||||
|
|
||||||
|
# Define common ENV vars
|
||||||
|
var_3: &define_env_vars
|
||||||
|
run: echo "export PROJECT_ROOT=$(pwd)" >> $BASH_ENV
|
||||||
|
|
||||||
# See remote cache documentation in /docs/BAZEL.md
|
# See remote cache documentation in /docs/BAZEL.md
|
||||||
var_3: &setup-bazel-remote-cache
|
var_4: &setup-bazel-remote-cache
|
||||||
run:
|
run:
|
||||||
name: Start up bazel remote cache proxy
|
name: Start up bazel remote cache proxy
|
||||||
command: ~/bazel-remote-proxy -backend circleci://
|
command: ~/bazel-remote-proxy -backend circleci://
|
||||||
@ -63,6 +67,7 @@ jobs:
|
|||||||
<<: *job_defaults
|
<<: *job_defaults
|
||||||
resource_class: xlarge
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
|
- *define_env_vars
|
||||||
- checkout:
|
- checkout:
|
||||||
<<: *post_checkout
|
<<: *post_checkout
|
||||||
# See remote cache documentation in /docs/BAZEL.md
|
# See remote cache documentation in /docs/BAZEL.md
|
||||||
@ -82,6 +87,10 @@ jobs:
|
|||||||
# NOTE: Angular developers should typically just bazel build //packages/... or bazel test //packages/...
|
# NOTE: Angular developers should typically just bazel build //packages/... or bazel test //packages/...
|
||||||
- run: bazel query --output=label //... | xargs bazel test
|
- run: bazel query --output=label //... | xargs bazel test
|
||||||
|
|
||||||
|
# We run the integration tests outside of Bazel for now.
|
||||||
|
# See comments inside this script.
|
||||||
|
- run: xvfb-run --auto-servernum ./integration/run_tests.sh
|
||||||
|
|
||||||
# CircleCI will allow us to go back and view/download these artifacts from past builds.
|
# CircleCI will allow us to go back and view/download these artifacts from past builds.
|
||||||
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
|
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
# alexeagle - Alex Eagle
|
# alexeagle - Alex Eagle
|
||||||
# alxhub - Alex Rickabaugh
|
# alxhub - Alex Rickabaugh
|
||||||
# andrewseguin - Andrew Seguin
|
# andrewseguin - Andrew Seguin
|
||||||
|
# brandonroberts - Brandon Roberts
|
||||||
# brocco - Mike Brocchi
|
# brocco - Mike Brocchi
|
||||||
# chuckjaz - Chuck Jazdzewski
|
# chuckjaz - Chuck Jazdzewski
|
||||||
# filipesilva - Filipe Silva
|
# filipesilva - Filipe Silva
|
||||||
@ -153,7 +154,7 @@ groups:
|
|||||||
- "packages/compiler/src/i18n/*"
|
- "packages/compiler/src/i18n/*"
|
||||||
users:
|
users:
|
||||||
- vicb #primary
|
- vicb #primary
|
||||||
- chuckjaz
|
- alxhub
|
||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
|
||||||
@ -187,7 +188,7 @@ groups:
|
|||||||
- "packages/compiler-cli/src/ngtools*"
|
- "packages/compiler-cli/src/ngtools*"
|
||||||
users:
|
users:
|
||||||
- alexeagle
|
- alexeagle
|
||||||
- chuckjaz
|
- alxhub
|
||||||
- vicb
|
- vicb
|
||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
@ -310,6 +311,7 @@ groups:
|
|||||||
users:
|
users:
|
||||||
- andrewseguin #primary
|
- andrewseguin #primary
|
||||||
- gkalpak
|
- gkalpak
|
||||||
|
- robwormald
|
||||||
- IgorMinar #fallback
|
- IgorMinar #fallback
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
|
||||||
@ -351,6 +353,7 @@ groups:
|
|||||||
- petebacondarwin
|
- petebacondarwin
|
||||||
- gkalpak
|
- gkalpak
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- brandonroberts
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
|
||||||
angular.io-marketing:
|
angular.io-marketing:
|
||||||
@ -365,4 +368,5 @@ groups:
|
|||||||
- petebacondarwin
|
- petebacondarwin
|
||||||
- gkalpak
|
- gkalpak
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- robwormald
|
||||||
- mhevery #fallback
|
- mhevery #fallback
|
||||||
|
@ -45,7 +45,6 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||||
- CI_MODE=e2e
|
- CI_MODE=e2e
|
||||||
- CI_MODE=e2e_2
|
|
||||||
- CI_MODE=js
|
- CI_MODE=js
|
||||||
- CI_MODE=saucelabs_required
|
- CI_MODE=saucelabs_required
|
||||||
# deactivated, see #19768
|
# deactivated, see #19768
|
||||||
|
630
CHANGELOG.md
630
CHANGELOG.md
@ -1,206 +1,248 @@
|
|||||||
<a name="6.0.0-rc.4"></a>
|
<a name="6.0.0"></a>
|
||||||
# [6.0.0-rc.4](https://github.com/angular/angular/compare/6.0.0-rc.3...6.0.0-rc.4) (2018-04-12)
|
# [6.0.0](https://github.com/angular/angular/compare/6.0.0-rc.6...6.0.0) (2018-05-03)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Dependency updates
|
||||||
|
|
||||||
* **bazel:** set rollup output.name and amd.id ([#23274](https://github.com/angular/angular/issues/23274)) ([3e8eef6](https://github.com/angular/angular/commit/3e8eef6)), closes [#23238](https://github.com/angular/angular/issues/23238)
|
* @angular/core now depends on
|
||||||
* **common:** replace i18n locale undefined values by a const ([#23265](https://github.com/angular/angular/issues/23265)) ([5706810](https://github.com/angular/angular/commit/5706810)), closes [#22988](https://github.com/angular/angular/issues/22988)
|
* TypeScript 2.7
|
||||||
* **common:** workaround UMD/webpack limitation ([#23271](https://github.com/angular/angular/issues/23271)) ([5a298b1](https://github.com/angular/angular/commit/5a298b1)), closes [#23217](https://github.com/angular/angular/issues/23217)
|
* RxJS 6.0.0
|
||||||
* **compiler:** Pretty print object instead of [Object object] ([#22689](https://github.com/angular/angular/issues/22689)) ([8555a3a](https://github.com/angular/angular/commit/8555a3a))
|
* tslib 1.9.0
|
||||||
* **compiler-cli:** strictMetadataEmit should not break on non-compliant libraries ([#23275](https://github.com/angular/angular/issues/23275)) ([5814355](https://github.com/angular/angular/commit/5814355)), closes [#22210](https://github.com/angular/angular/issues/22210)
|
* @angular/platform-server now depends on Domino 2.0
|
||||||
* **elements:** avoid exception when window is undefined ([#23324](https://github.com/angular/angular/issues/23324)) ([af46d09](https://github.com/angular/angular/commit/af46d09))
|
|
||||||
* **platform-server:** require node v8+ ([#23331](https://github.com/angular/angular/issues/23331)) ([bbfa1d3](https://github.com/angular/angular/commit/bbfa1d3))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **elements:** add schematics ([#23298](https://github.com/angular/angular/issues/23298)) ([37d2cb4](https://github.com/angular/angular/commit/37d2cb4))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-rc.3"></a>
|
### Small Features
|
||||||
# [6.0.0-rc.3](https://github.com/angular/angular/compare/6.0.0-rc.2...6.0.0-rc.3) (2018-04-06)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** don't produce ngfactory files for ng_packages ([#23237](https://github.com/angular/angular/issues/23237)) ([da58a55](https://github.com/angular/angular/commit/da58a55))
|
|
||||||
* **compiler-cli:** don't lower expressions in flat module metadata ([#23226](https://github.com/angular/angular/issues/23226)) ([11ea3a3](https://github.com/angular/angular/commit/11ea3a3))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-rc.2"></a>
|
|
||||||
# [6.0.0-rc.2](https://github.com/angular/angular/compare/6.0.0-rc.1...6.0.0-rc.2) (2018-04-05)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** `locales` are not being shipped ([#23136](https://github.com/angular/angular/issues/23136)) ([7ca7720](https://github.com/angular/angular/commit/7ca7720))
|
|
||||||
* **common:** properly take className changes into account ([#21937](https://github.com/angular/angular/issues/21937)) ([4a42669](https://github.com/angular/angular/commit/4a42669)), closes [#21932](https://github.com/angular/angular/issues/21932)
|
|
||||||
* **compiler-cli:** flat module index metadata should be transformed ([#23129](https://github.com/angular/angular/issues/23129)) ([f99cb5c](https://github.com/angular/angular/commit/f99cb5c))
|
|
||||||
* **core:** inject() should always work in an NgModule injection scope ([#23148](https://github.com/angular/angular/issues/23148)) ([fab6b39](https://github.com/angular/angular/commit/fab6b39)), closes [angular/material2#10586](https://github.com/angular/material2/issues/10586)
|
|
||||||
* **forms:** improve error message for invalid value accessors ([#22731](https://github.com/angular/angular/issues/22731)) ([23cc3ef](https://github.com/angular/angular/commit/23cc3ef))
|
|
||||||
* **upgrade:** correctly handle downgraded `OnPush` components ([#22209](https://github.com/angular/angular/issues/22209)) ([ad9ce5c](https://github.com/angular/angular/commit/ad9ce5c)), closes [#14286](https://github.com/angular/angular/issues/14286)
|
|
||||||
* **upgrade:** propagate return value of resumeBootstrap ([#22754](https://github.com/angular/angular/issues/22754)) ([a2330ff](https://github.com/angular/angular/commit/a2330ff)), closes [#22723](https://github.com/angular/angular/issues/22723)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
|
* **animations:** only use the WA-polyfill alongside AnimationBuilder ([#22143](https://github.com/angular/angular/issues/22143)) ([b2f366b](https://github.com/angular/angular/commit/b2f366b)), closes [#17496](https://github.com/angular/angular/issues/17496)
|
||||||
|
* **animations:** expose `element` and `params` within transition matchers ([#22693](https://github.com/angular/angular/issues/22693)) ([58b94e6](https://github.com/angular/angular/commit/58b94e6))
|
||||||
|
* **common:** better error message when non-template element used in NgIf ([#22274](https://github.com/angular/angular/issues/22274)) ([67cf11d](https://github.com/angular/angular/commit/67cf11d)), closes [#16410](https://github.com/angular/angular/issues/16410)
|
||||||
|
* **common:** better error message when non-template element used in NgIf ([#22274](https://github.com/angular/angular/issues/22274)) ([67cf11d](https://github.com/angular/angular/commit/67cf11d)), closes [#16410](https://github.com/angular/angular/issues/16410)
|
||||||
|
* **common:** export functions to format numbers, percents, currencies & dates ([#22423](https://github.com/angular/angular/issues/22423)) ([4180912](https://github.com/angular/angular/commit/4180912)), closes [#20536](https://github.com/angular/angular/issues/20536)
|
||||||
|
* **compiler:** lower @NgModule ids if needed ([#23031](https://github.com/angular/angular/issues/23031)) ([bd024c0](https://github.com/angular/angular/commit/bd024c0))
|
||||||
|
* **compiler:** implement "enableIvy" compiler option ([#21427](https://github.com/angular/angular/issues/21427)) ([64d16de](https://github.com/angular/angular/commit/64d16de))
|
||||||
|
* **compiler:** mark @NgModules in provider lists for identification at runtime ([#22005](https://github.com/angular/angular/issues/22005)) ([2d5e7d1](https://github.com/angular/angular/commit/2d5e7d1))
|
||||||
|
* **compiler:** add support for marker tags in xliff serializers ([#21250](https://github.com/angular/angular/issues/21250)) ([f74130c](https://github.com/angular/angular/commit/f74130c)), closes [#21078](https://github.com/angular/angular/issues/21078)
|
||||||
|
* **compiler:** support for singleline, multiline & jsdoc comments ([#22715](https://github.com/angular/angular/issues/22715)) ([3b167be](https://github.com/angular/angular/commit/3b167be))
|
||||||
* **compiler-cli:** lower loadChildren fields to allow dynamic module paths ([#23088](https://github.com/angular/angular/issues/23088)) ([550433a](https://github.com/angular/angular/commit/550433a))
|
* **compiler-cli:** lower loadChildren fields to allow dynamic module paths ([#23088](https://github.com/angular/angular/issues/23088)) ([550433a](https://github.com/angular/angular/commit/550433a))
|
||||||
|
* **compiler-cli:** check unvalidated combination of ngc and TypeScript ([#22293](https://github.com/angular/angular/issues/22293)) ([3ceee99](https://github.com/angular/angular/commit/3ceee99)), closes [#20669](https://github.com/angular/angular/issues/20669)
|
||||||
|
* **compiler-cli:** reflect static methods added to classes in metadata ([#21926](https://github.com/angular/angular/issues/21926)) ([eb8ddd2](https://github.com/angular/angular/commit/eb8ddd2))
|
||||||
|
* **compiler-cli:** Check unvalidated combination of ngc and TypeScript ([#22293](https://github.com/angular/angular/issues/22293)) ([3ceee99](https://github.com/angular/angular/commit/3ceee99)), closes [#20669](https://github.com/angular/angular/issues/20669)
|
||||||
|
* **compiler-cli:** add resource inlining to ngc ([#22615](https://github.com/angular/angular/issues/22615)) ([b5be18f](https://github.com/angular/angular/commit/b5be18f))
|
||||||
|
* **compiler-cli:** require node 8 as runtime engine ([#22669](https://github.com/angular/angular/issues/22669)) ([c602563](https://github.com/angular/angular/commit/c602563))
|
||||||
|
* **core:** add binding name to content changed error ([#20352](https://github.com/angular/angular/issues/20352)) ([d3bf54b](https://github.com/angular/angular/commit/d3bf54b))
|
||||||
|
* **core:** optional generic type for ElementRef ([#20765](https://github.com/angular/angular/issues/20765)) ([d3d9aac](https://github.com/angular/angular/commit/d3d9aac)), closes [#13139](https://github.com/angular/angular/issues/13139)
|
||||||
|
* **core:** set `preserveWhitespaces` to false by default ([#22046](https://github.com/angular/angular/issues/22046)) ([f1a0632](https://github.com/angular/angular/commit/f1a0632)), closes [#22027](https://github.com/angular/angular/issues/22027)
|
||||||
|
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([5c89d6b](https://github.com/angular/angular/commit/5c89d6b)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
||||||
|
* **core:** change @Injectable() to support tree-shakeable tokens ([#22005](https://github.com/angular/angular/issues/22005)) ([235a235](https://github.com/angular/angular/commit/235a235))
|
||||||
|
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([b7544cc](https://github.com/angular/angular/commit/b7544cc)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
||||||
|
* **core:** allow direct scoping of @Injectables to the root injector ([#22185](https://github.com/angular/angular/issues/22185)) ([7ac34e4](https://github.com/angular/angular/commit/7ac34e4))
|
||||||
|
* **core:** add task tracking to Testability ([#16863](https://github.com/angular/angular/issues/16863)) ([37fedd0](https://github.com/angular/angular/commit/37fedd0))
|
||||||
|
* **forms:** handle string with and without line boundary on pattern validator ([#19256](https://github.com/angular/angular/issues/19256)) ([54bf179](https://github.com/angular/angular/commit/54bf179))
|
||||||
|
* **forms:** multiple validators for array method ([#20766](https://github.com/angular/angular/issues/20766)) ([941e88f](https://github.com/angular/angular/commit/941e88f)), closes [#20665](https://github.com/angular/angular/issues/20665)
|
||||||
|
* **forms:** allow markAsPending to emit events ([#20212](https://github.com/angular/angular/issues/20212)) ([e86b64b](https://github.com/angular/angular/commit/e86b64b)), closes [#17958](https://github.com/angular/angular/issues/17958)
|
||||||
|
* **platform-browser:** add token marking which the type of animation module nearest in the injector tree ([#23075](https://github.com/angular/angular/issues/23075)) ([b551f84](https://github.com/angular/angular/commit/b551f84))
|
||||||
|
* **platform-browser:** do not throw error when Hammer.js not loaded ([#22257](https://github.com/angular/angular/issues/22257)) ([991300b](https://github.com/angular/angular/commit/991300b)), closes [#16992](https://github.com/angular/angular/issues/16992)
|
||||||
|
* **platform-browser:** fix [#19604](https://github.com/angular/angular/issues/19604), can config hammerOptions ([#21979](https://github.com/angular/angular/issues/21979)) ([1d571b2](https://github.com/angular/angular/commit/1d571b2))
|
||||||
|
* **platform-server:** bump Domino to v2.0 ([#22411](https://github.com/angular/angular/issues/22411)) ([d3827a0](https://github.com/angular/angular/commit/d3827a0))
|
||||||
|
* **router:** add navigationSource and restoredState to NavigationStart event ([#21728](https://github.com/angular/angular/issues/21728)) ([c40ae7f](https://github.com/angular/angular/commit/c40ae7f))
|
||||||
|
* **service-worker:** add support for configuring navigations URLs ([#23339](https://github.com/angular/angular/issues/23339)) ([08325aa](https://github.com/angular/angular/commit/08325aa)), closes [#20404](https://github.com/angular/angular/issues/20404)
|
||||||
|
* **service-worker:** add helper script which will uninstall SW ([#21863](https://github.com/angular/angular/issues/21863)) ([b10540a](https://github.com/angular/angular/commit/b10540a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-rc.1"></a>
|
|
||||||
# [6.0.0-rc.1](https://github.com/angular/angular/compare/6.0.0-rc.0...6.0.0-rc.1) (2018-03-30)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **animations:** report correct totalTime value even during noOp animations ([#22225](https://github.com/angular/angular/issues/22225)) ([e1bf067](https://github.com/angular/angular/commit/e1bf067))
|
||||||
* **animations:** avoid animation insertions during router back/refresh ([#21977](https://github.com/angular/angular/issues/21977)) ([f88fba0](https://github.com/angular/angular/commit/f88fba0)), closes [#19712](https://github.com/angular/angular/issues/19712)
|
* **animations:** avoid animation insertions during router back/refresh ([#21977](https://github.com/angular/angular/issues/21977)) ([f88fba0](https://github.com/angular/angular/commit/f88fba0)), closes [#19712](https://github.com/angular/angular/issues/19712)
|
||||||
* **animations:** treat numeric state name values as strings ([#22923](https://github.com/angular/angular/issues/22923)) ([e5e1b0d](https://github.com/angular/angular/commit/e5e1b0d))
|
* **animations:** treat numeric state name values as strings ([#22923](https://github.com/angular/angular/issues/22923)) ([e5e1b0d](https://github.com/angular/angular/commit/e5e1b0d))
|
||||||
* **bazel:** complete the rollup globals list for all angular entrypoints ([#23080](https://github.com/angular/angular/issues/23080)) ([439030f](https://github.com/angular/angular/commit/439030f))
|
* **animations:** report correct totalTime value even during noOp animations ([#22225](https://github.com/angular/angular/issues/22225)) ([e1bf067](https://github.com/angular/angular/commit/e1bf067))
|
||||||
* **bazel:** don't inline tslib into fesms ([#23044](https://github.com/angular/angular/issues/23044)) ([0049743](https://github.com/angular/angular/commit/0049743))
|
* **animations:** fix increment/decrement aliases example ([#18323](https://github.com/angular/angular/issues/18323)) ([d2aa8ac](https://github.com/angular/angular/commit/d2aa8ac))
|
||||||
* **bazel:** don't try to do flatmoduleindex under Blaze ([#23083](https://github.com/angular/angular/issues/23083)) ([be10bf5](https://github.com/angular/angular/commit/be10bf5))
|
* **common:** NgClass should properly take className changes into account ([#21937](https://github.com/angular/angular/issues/21937)) ([4a42669](https://github.com/angular/angular/commit/4a42669)), closes [#21932](https://github.com/angular/angular/issues/21932)
|
||||||
* **bazel:** downlevel decorators in fesm5 files ([#23078](https://github.com/angular/angular/issues/23078)) ([481b22e](https://github.com/angular/angular/commit/481b22e))
|
* **common:** fix the titlecase pipe ([#22600](https://github.com/angular/angular/issues/22600)) ([7966744](https://github.com/angular/angular/commit/7966744))
|
||||||
* **bazel:** ng_package packages attr not forwarded to npm_package ([#22967](https://github.com/angular/angular/issues/22967)) ([2aabbc5](https://github.com/angular/angular/commit/2aabbc5))
|
* **common:** add locale currency values ([#21783](https://github.com/angular/angular/issues/21783)) ([420cc7a](https://github.com/angular/angular/commit/420cc7a)), closes [#20385](https://github.com/angular/angular/issues/20385)
|
||||||
* **bazel:** ng_package should include private exports in fesms ([#23054](https://github.com/angular/angular/issues/23054)) ([0d9140c](https://github.com/angular/angular/commit/0d9140c))
|
* **common:** round currencies based on decimal digits in `CurrencyPipe` ([#21783](https://github.com/angular/angular/issues/21783)) ([44154e7](https://github.com/angular/angular/commit/44154e7)), closes [#10189](https://github.com/angular/angular/issues/10189)
|
||||||
* **bazel:** pass --global option to rollup ([#23073](https://github.com/angular/angular/issues/23073)) ([45e090b](https://github.com/angular/angular/commit/45e090b))
|
* **common:** weaken AsyncPipe transform signature ([#22169](https://github.com/angular/angular/issues/22169)) ([be59c3a](https://github.com/angular/angular/commit/be59c3a))
|
||||||
* **common:** titlecase pipe ([#22600](https://github.com/angular/angular/issues/22600)) ([7966744](https://github.com/angular/angular/commit/7966744))
|
* **common:** http testing library should not convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([8b14488](https://github.com/angular/angular/commit/8b14488)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
||||||
|
* **common:** correct mapping of Observable methods ([#20518](https://github.com/angular/angular/issues/20518)) ([2639b4b](https://github.com/angular/angular/commit/2639b4b)), closes [#20516](https://github.com/angular/angular/issues/20516)
|
||||||
|
* **common:** then and else template might be set to null ([#22298](https://github.com/angular/angular/issues/22298)) ([8115edc](https://github.com/angular/angular/commit/8115edc))
|
||||||
|
* **common:** A null value should remove the style on IE ([#21679](https://github.com/angular/angular/issues/21679)) ([7d49443](https://github.com/angular/angular/commit/7d49443)), closes [#21064](https://github.com/angular/angular/issues/21064)
|
||||||
|
* **common:** fallback to last defined value for named date and time formats ([#21299](https://github.com/angular/angular/issues/21299)) ([879756d](https://github.com/angular/angular/commit/879756d)), closes [#21282](https://github.com/angular/angular/issues/21282)
|
||||||
|
* **common:** set correct timezone for ISO8601 dates in Safari ([#21506](https://github.com/angular/angular/issues/21506)) ([05208b8](https://github.com/angular/angular/commit/05208b8)), closes [#21491](https://github.com/angular/angular/issues/21491)
|
||||||
|
* **compiler:** fix ICU select messages to use male/female/other ([#21713](https://github.com/angular/angular/issues/21713)) ([cb5090c](https://github.com/angular/angular/commit/cb5090c))
|
||||||
|
* **compiler:** avoid a crash in ngc-wrapped. ([#23468](https://github.com/angular/angular/issues/23468)) ([0bc8443](https://github.com/angular/angular/commit/0bc8443))
|
||||||
|
* **compiler:** handle undefined annotation metadata ([#23349](https://github.com/angular/angular/issues/23349)) ([b9431e8](https://github.com/angular/angular/commit/b9431e8))
|
||||||
* **compiler:** don't typecheck all inputs ([#22899](https://github.com/angular/angular/issues/22899)) ([838a610](https://github.com/angular/angular/commit/838a610))
|
* **compiler:** don't typecheck all inputs ([#22899](https://github.com/angular/angular/issues/22899)) ([838a610](https://github.com/angular/angular/commit/838a610))
|
||||||
* consistently rewrite Injector to INJECTOR ([#23008](https://github.com/angular/angular/issues/23008)) ([884bf0e](https://github.com/angular/angular/commit/884bf0e))
|
|
||||||
* **compiler:** fix support for html-like text in translatable attributes ([#23053](https://github.com/angular/angular/issues/23053)) ([28058b7](https://github.com/angular/angular/commit/28058b7))
|
* **compiler:** fix support for html-like text in translatable attributes ([#23053](https://github.com/angular/angular/issues/23053)) ([28058b7](https://github.com/angular/angular/commit/28058b7))
|
||||||
* **compiler:** take quoting into account when determining if object literals can be shared ([#22942](https://github.com/angular/angular/issues/22942)) ([d98e9e7](https://github.com/angular/angular/commit/d98e9e7))
|
* **compiler:** take quoting into account when determining if object literals can be shared ([#22942](https://github.com/angular/angular/issues/22942)) ([d98e9e7](https://github.com/angular/angular/commit/d98e9e7))
|
||||||
|
* **compiler:** do not emit line/char in ngsummary files. ([#22840](https://github.com/angular/angular/issues/22840)) ([5c387a7](https://github.com/angular/angular/commit/5c387a7))
|
||||||
|
* **compiler:** make unary plus operator consistent to JavaScript ([#22154](https://github.com/angular/angular/issues/22154)) ([72f8abd](https://github.com/angular/angular/commit/72f8abd)), closes [#22089](https://github.com/angular/angular/issues/22089)
|
||||||
|
* **compiler:** allow tree-shakeable injectables to depend on string tokens ([#22376](https://github.com/angular/angular/issues/22376)) ([dd53447](https://github.com/angular/angular/commit/dd53447))
|
||||||
|
* **compiler:** don't strip `/*# sourceURL ... */` ([#16088](https://github.com/angular/angular/issues/16088)) ([5f681f9](https://github.com/angular/angular/commit/5f681f9))
|
||||||
|
* **compiler:** cache external reference resolution ([#21359](https://github.com/angular/angular/issues/21359)) ([e3e2fc0](https://github.com/angular/angular/commit/e3e2fc0))
|
||||||
|
* **compiler:** make `.ngsummary.json` files idempotent ([#21448](https://github.com/angular/angular/issues/21448)) ([e64b1e9](https://github.com/angular/angular/commit/e64b1e9))
|
||||||
|
* **compiler-cli:** shorten resolved module name in fileNameToModuleName to npm package name for typings ([#23231](https://github.com/angular/angular/issues/23231)) ([6199ea5](https://github.com/angular/angular/commit/6199ea5))
|
||||||
|
* **compiler-cli:** strictMetadataEmit should not break on non-compliant libraries ([#23275](https://github.com/angular/angular/issues/23275)) ([5814355](https://github.com/angular/angular/commit/5814355)), closes [#22210](https://github.com/angular/angular/issues/22210)
|
||||||
|
* **compiler-cli:** flat module index metadata should be transformed ([#23129](https://github.com/angular/angular/issues/23129)) ([f99cb5c](https://github.com/angular/angular/commit/f99cb5c))
|
||||||
* **compiler-cli:** use numeric comparison for TypeScript version ([#22705](https://github.com/angular/angular/issues/22705)) ([193737a](https://github.com/angular/angular/commit/193737a)), closes [#22593](https://github.com/angular/angular/issues/22593)
|
* **compiler-cli:** use numeric comparison for TypeScript version ([#22705](https://github.com/angular/angular/issues/22705)) ([193737a](https://github.com/angular/angular/commit/193737a)), closes [#22593](https://github.com/angular/angular/issues/22593)
|
||||||
* **core:** don't override ngInjectableDef in the decorator if present on the type ([#22943](https://github.com/angular/angular/issues/22943)) ([6f01917](https://github.com/angular/angular/commit/6f01917))
|
* **compiler-cli:** disableTypeScriptVersionCheck should be applied even for older tsc versions ([#22669](https://github.com/angular/angular/issues/22669)) ([3f70aba](https://github.com/angular/angular/commit/3f70aba))
|
||||||
|
* **compiler-cli:** emit correct css string escape sequences ([#22776](https://github.com/angular/angular/issues/22776)) ([6e5e819](https://github.com/angular/angular/commit/6e5e819))
|
||||||
|
* **compiler-cli:** do not fold errors past calls in the collector ([#21708](https://github.com/angular/angular/issues/21708)) ([dd86790](https://github.com/angular/angular/commit/dd86790))
|
||||||
|
* **compiler-cli:** do not lower expressions in non-modules ([#21649](https://github.com/angular/angular/issues/21649)) ([7f93aad](https://github.com/angular/angular/commit/7f93aad))
|
||||||
|
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#20640](https://github.com/angular/angular/issues/20640)) ([f791e9f](https://github.com/angular/angular/commit/f791e9f))
|
||||||
|
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([e81606c](https://github.com/angular/angular/commit/e81606c)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
||||||
|
* **core:** fix chained http call ([#20924](https://github.com/angular/angular/issues/20924)) ([7e3f9a4](https://github.com/angular/angular/commit/7e3f9a4)), closes [#20921](https://github.com/angular/angular/issues/20921)
|
||||||
|
* **core:** should check Zone existence when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([3a86940](https://github.com/angular/angular/commit/3a86940))
|
||||||
|
* **core:** avoid eager providers re-initialization ([#23559](https://github.com/angular/angular/issues/23559)) ([697b6c0](https://github.com/angular/angular/commit/697b6c0))
|
||||||
|
* **core:** add stacktrace in log when error during cleanup component in TestBed ([#22162](https://github.com/angular/angular/issues/22162)) ([16d1700](https://github.com/angular/angular/commit/16d1700))
|
||||||
|
* **core:** ensure initial value of QueryList length ([#21980](https://github.com/angular/angular/issues/21980)) ([#21982](https://github.com/angular/angular/issues/21982)) ([e56de10](https://github.com/angular/angular/commit/e56de10)), closes [#21980](https://github.com/angular/angular/issues/21980)
|
||||||
|
* **core:** use appropriate inert document strategy for Firefox & Safari ([#17019](https://github.com/angular/angular/issues/17019)) ([a751649](https://github.com/angular/angular/commit/a751649))
|
||||||
|
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([a7ebf5a](https://github.com/angular/angular/commit/a7ebf5a)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
||||||
|
* **core:** require factory to be provided for shakeable InjectionToken ([#22207](https://github.com/angular/angular/issues/22207)) ([f755db7](https://github.com/angular/angular/commit/f755db7)), closes [#22205](https://github.com/angular/angular/issues/22205)
|
||||||
|
* **core:** remove core animation import symbols ([#22692](https://github.com/angular/angular/issues/22692)) ([f5a98f4](https://github.com/angular/angular/commit/f5a98f4))
|
||||||
|
* **forms:** improve error message for invalid value accessors ([#22731](https://github.com/angular/angular/issues/22731)) ([23cc3ef](https://github.com/angular/angular/commit/23cc3ef))
|
||||||
|
* **forms:** make Validators.email support optional controls ([#20869](https://github.com/angular/angular/issues/20869)) ([140e7c0](https://github.com/angular/angular/commit/140e7c0))
|
||||||
|
* **forms:** prevent event emission on enable/disable when emitEvent is false ([#12366](https://github.com/angular/angular/issues/12366)) ([#21018](https://github.com/angular/angular/issues/21018)) ([0bcfae7](https://github.com/angular/angular/commit/0bcfae7))
|
||||||
|
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([9744a1c](https://github.com/angular/angular/commit/9744a1c)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
||||||
|
* **forms:** publish missing types ([#19941](https://github.com/angular/angular/issues/19941)) ([2707012](https://github.com/angular/angular/commit/2707012))
|
||||||
|
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([3e6a86f](https://github.com/angular/angular/commit/3e6a86f)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
||||||
|
* **language-service:** Clear caches when program changes ([#21337](https://github.com/angular/angular/issues/21337)) ([43e1520](https://github.com/angular/angular/commit/43e1520)), closes [#19405](https://github.com/angular/angular/issues/19405)
|
||||||
|
* **platform-browser:** add @Injectable where it was missing ([#22005](https://github.com/angular/angular/issues/22005)) ([0a1a397](https://github.com/angular/angular/commit/0a1a397))
|
||||||
|
* **platform-browser:** support 0/false/null values in transfer_state ([#22179](https://github.com/angular/angular/issues/22179)) ([6435ecd](https://github.com/angular/angular/commit/6435ecd))
|
||||||
|
* **platform-browser:** do not throw error when Hammer.js not loaded ([#22257](https://github.com/angular/angular/issues/22257)) ([991300b](https://github.com/angular/angular/commit/991300b)), closes [#16992](https://github.com/angular/angular/issues/16992)
|
||||||
|
* **platform-browser:** fix [#19604](https://github.com/angular/angular/issues/19604), can config hammerOptions ([#21979](https://github.com/angular/angular/issues/21979)) ([1d571b2](https://github.com/angular/angular/commit/1d571b2))
|
||||||
|
* **platform-server:** require node v8+ ([#23331](https://github.com/angular/angular/issues/23331)) ([bbfa1d3](https://github.com/angular/angular/commit/bbfa1d3))
|
||||||
|
* **platform-server:** generate correct stylings for camel case names ([#22263](https://github.com/angular/angular/issues/22263)) ([40ba009](https://github.com/angular/angular/commit/40ba009)), closes [#19235](https://github.com/angular/angular/issues/19235)
|
||||||
|
* **platform-server:** add styles to elements correctly ([#22527](https://github.com/angular/angular/issues/22527)) ([cd2ebd2](https://github.com/angular/angular/commit/cd2ebd2))
|
||||||
|
* **router:** cache route handle if found ([#22475](https://github.com/angular/angular/issues/22475)) ([d8de648](https://github.com/angular/angular/commit/d8de648)), closes [#22474](https://github.com/angular/angular/issues/22474)
|
||||||
|
* **router:** don't use spread operator to workaround an issue in closure compiler ([#22884](https://github.com/angular/angular/issues/22884)) ([e6c731f](https://github.com/angular/angular/commit/e6c731f))
|
||||||
|
* **router:** make locationSyncBootstrapListener public due to change in output after TS 2.7 update in [#22669](https://github.com/angular/angular/issues/22669) ([#22896](https://github.com/angular/angular/issues/22896)) ([623d769](https://github.com/angular/angular/commit/623d769))
|
||||||
|
* **router:** correct over-encoding of URL fragment ([#22687](https://github.com/angular/angular/issues/22687)) ([0bf6fa5](https://github.com/angular/angular/commit/0bf6fa5))
|
||||||
|
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([45eff4c](https://github.com/angular/angular/commit/45eff4c)), closes [#22203](https://github.com/angular/angular/issues/22203)
|
||||||
|
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([094666d](https://github.com/angular/angular/commit/094666d)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
||||||
|
* **router:** don't use ParamsInheritanceStrategy in declarations ([#21574](https://github.com/angular/angular/issues/21574)) ([925e654](https://github.com/angular/angular/commit/925e654)), closes [#21456](https://github.com/angular/angular/issues/21456)
|
||||||
|
* **service-worker:** add badge to NOTIFICATION_OPTION_NAMES ([#23241](https://github.com/angular/angular/issues/23241)) ([fb59b2d](https://github.com/angular/angular/commit/fb59b2d)), closes [#23196](https://github.com/angular/angular/issues/23196)
|
||||||
|
* **service-worker:** let `*` match 0 characters in globs ([#23339](https://github.com/angular/angular/issues/23339)) ([6c2c958](https://github.com/angular/angular/commit/6c2c958))
|
||||||
* **service-worker:** do not enter degraded mode when offline ([#22883](https://github.com/angular/angular/issues/22883)) ([9e9b8dd](https://github.com/angular/angular/commit/9e9b8dd)), closes [#21636](https://github.com/angular/angular/issues/21636)
|
* **service-worker:** do not enter degraded mode when offline ([#22883](https://github.com/angular/angular/issues/22883)) ([9e9b8dd](https://github.com/angular/angular/commit/9e9b8dd)), closes [#21636](https://github.com/angular/angular/issues/21636)
|
||||||
* **service-worker:** fix LruList bugs ([#22769](https://github.com/angular/angular/issues/22769)) ([8c2a578](https://github.com/angular/angular/commit/8c2a578)), closes [#22218](https://github.com/angular/angular/issues/22218) [#22768](https://github.com/angular/angular/issues/22768)
|
* **service-worker:** fix LruList bugs ([#22769](https://github.com/angular/angular/issues/22769)) ([8c2a578](https://github.com/angular/angular/commit/8c2a578)), closes [#22218](https://github.com/angular/angular/issues/22218) [#22768](https://github.com/angular/angular/issues/22768)
|
||||||
* **service-worker:** ignore invalid `only-if-cached` requests ([#22883](https://github.com/angular/angular/issues/22883)) ([d9dc46e](https://github.com/angular/angular/commit/d9dc46e)), closes [#22362](https://github.com/angular/angular/issues/22362)
|
* **service-worker:** ignore invalid `only-if-cached` requests ([#22883](https://github.com/angular/angular/issues/22883)) ([d9dc46e](https://github.com/angular/angular/commit/d9dc46e)), closes [#22362](https://github.com/angular/angular/issues/22362)
|
||||||
|
* **service-worker:** properly handle invalid hashes in all scenarios ([#21288](https://github.com/angular/angular/issues/21288)) ([3951098](https://github.com/angular/angular/commit/3951098))
|
||||||
|
* **upgrade:** correctly handle downgraded `OnPush` components ([#22209](https://github.com/angular/angular/issues/22209)) ([ad9ce5c](https://github.com/angular/angular/commit/ad9ce5c)), closes [#14286](https://github.com/angular/angular/issues/14286)
|
||||||
### Features
|
* **upgrade:** propagate return value of resumeBootstrap ([#22754](https://github.com/angular/angular/issues/22754)) ([a2330ff](https://github.com/angular/angular/commit/a2330ff)), closes [#22723](https://github.com/angular/angular/issues/22723)
|
||||||
|
|
||||||
* **bazel:** prefix private-export (barred-latin-o) symbols ([#23007](https://github.com/angular/angular/issues/23007)) ([27e14b2](https://github.com/angular/angular/commit/27e14b2))
|
|
||||||
* **compiler:** lower @NgModule ids if needed ([#23031](https://github.com/angular/angular/issues/23031)) ([bd024c0](https://github.com/angular/angular/commit/bd024c0))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-rc.0"></a>
|
|
||||||
# [6.0.0-rc.0](https://github.com/angular/angular/compare/6.0.0-beta.8...6.0.0-rc.0) (2018-03-21)
|
|
||||||
|
|
||||||
v6 framework is now feature complete, the cli and material/cdk parts of the v6 release and other integrations are still
|
|
||||||
in works and will be completed by the time we cut v6.0.0.
|
|
||||||
|
|
||||||
Please [file new issues](https://github.com/angular/angular/issues/new) at our issue tracker with as many details as
|
|
||||||
possible, and ideally also a include a good reproduction of the problem.
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** correct expected outs for external sources in ng_module ([#22755](https://github.com/angular/angular/issues/22755)) ([bfe077a](https://github.com/angular/angular/commit/bfe077a))
|
|
||||||
* **compiler:** do not emit line/char in ngsummary files. ([#22840](https://github.com/angular/angular/issues/22840)) ([5c387a7](https://github.com/angular/angular/commit/5c387a7))
|
|
||||||
* correct several esm2015 entry-points in package.jsons ([#22892](https://github.com/angular/angular/issues/22892)) ([7d095b9](https://github.com/angular/angular/commit/7d095b9))
|
|
||||||
* **router:** don't use spread operator to workaround an issue in closure compiler ([#22884](https://github.com/angular/angular/issues/22884)) ([e6c731f](https://github.com/angular/angular/commit/e6c731f))
|
|
||||||
* **router:** make locationSyncBootstrapListener public due to change in output after TS 2.7 update in [#22669](https://github.com/angular/angular/issues/22669) ([#22896](https://github.com/angular/angular/issues/22896)) ([623d769](https://github.com/angular/angular/commit/623d769))
|
|
||||||
* **upgrade:** two-way binding and listening for event ([#22772](https://github.com/angular/angular/issues/22772)) ([2b3de63](https://github.com/angular/angular/commit/2b3de63)), closes [#22734](https://github.com/angular/angular/issues/22734)
|
* **upgrade:** two-way binding and listening for event ([#22772](https://github.com/angular/angular/issues/22772)) ([2b3de63](https://github.com/angular/angular/commit/2b3de63)), closes [#22734](https://github.com/angular/angular/issues/22734)
|
||||||
|
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([8a85888](https://github.com/angular/angular/commit/8a85888)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
||||||
|
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([f089bf5](https://github.com/angular/angular/commit/f089bf5))
|
||||||
### Features
|
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([13ab91e](https://github.com/angular/angular/commit/13ab91e)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||||
|
|
||||||
* **core:** update the package output of build.sh to [APF v6](https://goo.gl/jB3GVv) ([#22808](https://github.com/angular/angular/issues/22808)) ([ce63dc6](https://github.com/angular/angular/commit/ce63dc6))
|
|
||||||
* **core:** upgrade rxjs to 6.0.0-beta.0, please see this [RxJS Upgrade Guide](https://goo.gl/osWFzo) for more info ([#22573](https://github.com/angular/angular/issues/22573)) ([b43f8bc](https://github.com/angular/angular/commit/b43f8bc))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.8"></a>
|
### POSSIBLE BREAKING CHANGES
|
||||||
# [6.0.0-beta.8](https://github.com/angular/angular/compare/6.0.0-beta.7...6.0.0-beta.8) (2018-03-16)
|
|
||||||
|
* **animations:** When animation is triggered within a disabled zone, the associated event (which an instance of AnimationEvent) will no longer report the totalTime as 0 (it will emit the actual time of the animation).
|
||||||
|
|
||||||
|
To detect if an animation event is reporting a disabled animation then the `event.disabled` property can be used instead.
|
||||||
|
|
||||||
|
|
||||||
|
* **compiler:** The `<template>` tag was deprecated in Angular v4 to avoid collisions (i.e. when using Web Components).
|
||||||
|
|
||||||
|
This change removes support for `<template>`. `<ng-template>` should be used instead.
|
||||||
|
|
||||||
|
BEFORE:
|
||||||
|
|
||||||
|
<!-- html template -->
|
||||||
|
<template>some template content</template>
|
||||||
|
|
||||||
|
# tsconfig.json
|
||||||
|
{
|
||||||
|
# ...
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
# ...
|
||||||
|
# This option is no more supported and will have no effect
|
||||||
|
"enableLegacyTemplate": [true|false]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AFTER:
|
||||||
|
|
||||||
|
<!-- html template -->
|
||||||
|
<ng-template>some template content</ng-template>
|
||||||
|
|
||||||
|
* **core:** it is no longer possible to import animation-related functions from @angular/core. All animation symbols must now be imported from @angular/animations.
|
||||||
|
|
||||||
|
|
||||||
|
* **forms:** - `AbstractControl#statusChanges` now emits an event of `'PENDING'` when you call `AbstractControl#markAsPending`
|
||||||
|
- Previously it did not emit an event when you called `markAsPending`
|
||||||
|
- To migrate you would need to ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`
|
||||||
|
|
||||||
|
|
||||||
|
* **forms:** ngModelChange is now emitted after the value/validity is updated on its control.
|
||||||
|
|
||||||
|
Previously, ngModelChange was emitted before its underlying control was updated.
|
||||||
|
This was fine if you passed through the value directly through the $event keyword, e.g.
|
||||||
|
|
||||||
|
```
|
||||||
|
<input [(ngModel)]="name" (ngModelChange)="onChange($event)">
|
||||||
|
|
||||||
|
onChange(value) {
|
||||||
|
console.log(value); // would log updated value
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
However, if you had a handler for the ngModelChange event that checked the value through the control,
|
||||||
|
you would get the old value rather than the updated value. e.g:
|
||||||
|
|
||||||
|
```
|
||||||
|
<input #modelDir="ngModel" [(ngModel)]="name" (ngModelChange)="onChange(modelDir)">
|
||||||
|
|
||||||
|
onChange(ngModel: NgModel) {
|
||||||
|
console.log(ngModel.value); // would log old value, not updated value
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Now the value and validity will be updated before the ngModelChange event is emitted,
|
||||||
|
so the same setup will log the updated value.
|
||||||
|
|
||||||
|
```
|
||||||
|
onChange(ngModel: NgModel) {
|
||||||
|
console.log(ngModel.value); // will log updated value
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
We think this order will be less confusing when the control is checked directly.
|
||||||
|
You will only need to update your app if it has relied on this bug to keep track of the old control value.
|
||||||
|
If that is the case, you should be able to track the old value directly by saving it on your component.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="5.2.10"></a>
|
||||||
|
## [5.2.10](https://github.com/angular/angular/compare/5.2.9...5.2.10) (2018-04-16)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* **aio:** constrain error logging to improve reporting ([#22713](https://github.com/angular/angular/issues/22713)) ([049757b](https://github.com/angular/angular/commit/049757b))
|
* **animations:** avoid animation insertions during router back/refresh ([#21977](https://github.com/angular/angular/issues/21977)) ([641cc49](https://github.com/angular/angular/commit/641cc49)), closes [#19712](https://github.com/angular/angular/issues/19712)
|
||||||
* **compiler-cli:** annotate Ivy fields as [@nocollapse](https://github.com/nocollapse) in closure mode ([#22691](https://github.com/angular/angular/issues/22691)) ([6e00410](https://github.com/angular/angular/commit/6e00410))
|
* **common:** properly take className changes into account ([#21937](https://github.com/angular/angular/issues/21937)) ([54e9108](https://github.com/angular/angular/commit/54e9108)), closes [#21932](https://github.com/angular/angular/issues/21932)
|
||||||
* **compiler-cli:** disableTypeScriptVersionCheck should be applied even for older tsc versions ([#22669](https://github.com/angular/angular/issues/22669)) ([3f70aba](https://github.com/angular/angular/commit/3f70aba))
|
* **compiler:** fix support for html-like text in translatable attributes ([#23053](https://github.com/angular/angular/issues/23053)) ([4f7c369](https://github.com/angular/angular/commit/4f7c369))
|
||||||
* **compiler-cli:** emit correct css string escape sequences ([#22776](https://github.com/angular/angular/issues/22776)) ([6e5e819](https://github.com/angular/angular/commit/6e5e819))
|
* **compiler-cli:** emit correct css string escape sequences ([#22776](https://github.com/angular/angular/issues/22776)) ([db0afa9](https://github.com/angular/angular/commit/db0afa9))
|
||||||
* **compiler-cli:** enableResourceInlining handles both styles and styleUrls ([#22688](https://github.com/angular/angular/issues/22688)) ([40315be](https://github.com/angular/angular/commit/40315be))
|
* **forms:** improve error message for invalid value accessors ([#22731](https://github.com/angular/angular/issues/22731)) ([dd61595](https://github.com/angular/angular/commit/dd61595))
|
||||||
* **compiler-cli:** generate proper exports.* identifiers in cjs output ([#22564](https://github.com/angular/angular/issues/22564)) ([0d8deb0](https://github.com/angular/angular/commit/0d8deb0))
|
* **service-worker:** add badge to NOTIFICATION_OPTION_NAMES ([#23241](https://github.com/angular/angular/issues/23241)) ([7b23983](https://github.com/angular/angular/commit/7b23983)), closes [#23196](https://github.com/angular/angular/issues/23196)
|
||||||
* **compiler-cli:** resolve resource URLs before loading them under enableResourceInlining ([#22688](https://github.com/angular/angular/issues/22688)) ([123efba](https://github.com/angular/angular/commit/123efba))
|
* **service-worker:** do not enter degraded mode when offline ([#22883](https://github.com/angular/angular/issues/22883)) ([ae9c25f](https://github.com/angular/angular/commit/ae9c25f)), closes [#21636](https://github.com/angular/angular/issues/21636)
|
||||||
* **core:** remove core animation import symbols ([#22692](https://github.com/angular/angular/issues/22692)) ([f5a98f4](https://github.com/angular/angular/commit/f5a98f4))
|
* **service-worker:** fix LruList bugs ([#22769](https://github.com/angular/angular/issues/22769)) ([65f8943](https://github.com/angular/angular/commit/65f8943)), closes [#22218](https://github.com/angular/angular/issues/22218) [#22768](https://github.com/angular/angular/issues/22768)
|
||||||
* **elements:** fix elements test bootstrap ([#22839](https://github.com/angular/angular/issues/22839)) ([5d82d8d](https://github.com/angular/angular/commit/5d82d8d))
|
* **service-worker:** ignore invalid `only-if-cached` requests ([#22883](https://github.com/angular/angular/issues/22883)) ([0d4fe38](https://github.com/angular/angular/commit/0d4fe38)), closes [#22362](https://github.com/angular/angular/issues/22362)
|
||||||
* overloading a function doesn't generate all of the signatures ([#22569](https://github.com/angular/angular/issues/22569)) ([e8326e6](https://github.com/angular/angular/commit/e8326e6))
|
* **upgrade:** correctly handle downgraded `OnPush` components ([#22209](https://github.com/angular/angular/issues/22209)) ([f43fba6](https://github.com/angular/angular/commit/f43fba6)), closes [#14286](https://github.com/angular/angular/issues/14286)
|
||||||
* **platform-server:** add styles to elements correctly ([#22527](https://github.com/angular/angular/issues/22527)) ([cd2ebd2](https://github.com/angular/angular/commit/cd2ebd2))
|
* **upgrade:** propagate return value of resumeBootstrap ([#22754](https://github.com/angular/angular/issues/22754)) ([ae76eec](https://github.com/angular/angular/commit/ae76eec)), closes [#22723](https://github.com/angular/angular/issues/22723)
|
||||||
* **router:** correct over-encoding of URL fragment ([#22687](https://github.com/angular/angular/issues/22687)) ([0bf6fa5](https://github.com/angular/angular/commit/0bf6fa5))
|
* **upgrade:** two-way binding and listening for event ([#22772](https://github.com/angular/angular/issues/22772)) ([5391f96](https://github.com/angular/angular/commit/5391f96)), closes [#22734](https://github.com/angular/angular/issues/22734)
|
||||||
|
|
||||||
|
|
||||||
### Code Refactoring
|
|
||||||
|
|
||||||
* **compiler:** Drop support for the deprecated `<template>`. Use `<ng-template>` instead ([#22783](https://github.com/angular/angular/issues/22783)) ([0ebd577](https://github.com/angular/angular/commit/0ebd577))
|
<a name="4.4.7"></a>
|
||||||
|
## [4.4.7](https://github.com/angular/angular/compare/4.4.6...4.4.7) (2018-04-16)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Bug Fixes
|
||||||
|
|
||||||
* **aio:** add hack, remove me ([#22413](https://github.com/angular/angular/issues/22413)) ([4d506ac](https://github.com/angular/angular/commit/4d506ac))
|
* **core:** use appropriate inert document strategy for Firefox & Safari ([#22077](https://github.com/angular/angular/issues/22077)) ([2c5cf19](https://github.com/angular/angular/commit/2c5cf19))
|
||||||
* **aio:** migrate embedded comp to elements ([#22413](https://github.com/angular/angular/issues/22413)) ([7c9b411](https://github.com/angular/angular/commit/7c9b411))
|
|
||||||
* **aio:** update payload size ([#22413](https://github.com/angular/angular/issues/22413)) ([400460c](https://github.com/angular/angular/commit/400460c))
|
|
||||||
* **animations:** expose `element` and `params` within transition matchers ([#22693](https://github.com/angular/angular/issues/22693)) ([58b94e6](https://github.com/angular/angular/commit/58b94e6))
|
|
||||||
* **bazel:** change ng_package rule to APF v6 ([#22782](https://github.com/angular/angular/issues/22782)) ([88b3198](https://github.com/angular/angular/commit/88b3198))
|
|
||||||
* **compiler:** support for singleline, multiline & jsdoc comments ([#22715](https://github.com/angular/angular/issues/22715)) ([3b167be](https://github.com/angular/angular/commit/3b167be))
|
|
||||||
* **compiler-cli:** add resource inlining to ngc ([#22615](https://github.com/angular/angular/issues/22615)) ([b5be18f](https://github.com/angular/angular/commit/b5be18f))
|
|
||||||
* **compiler-cli:** require node 8 as runtime engine ([#22669](https://github.com/angular/angular/issues/22669)) ([c602563](https://github.com/angular/angular/commit/c602563))
|
|
||||||
* **core:** add task tracking to Testability ([#16863](https://github.com/angular/angular/issues/16863)) ([37fedd0](https://github.com/angular/angular/commit/37fedd0))
|
|
||||||
* **elements:** add polyfill for elements es5 shim ([#22413](https://github.com/angular/angular/issues/22413)) ([863aff1](https://github.com/angular/angular/commit/863aff1))
|
|
||||||
* **elements:** add support for creating custom elements ([#22413](https://github.com/angular/angular/issues/22413)) ([22b96b9](https://github.com/angular/angular/commit/22b96b9))
|
|
||||||
* **elements:** add tests for component factory strategy ([#22413](https://github.com/angular/angular/issues/22413)) ([d2be675](https://github.com/angular/angular/commit/d2be675))
|
|
||||||
* **elements:** another polyfill solution ([#22413](https://github.com/angular/angular/issues/22413)) ([cf3ff7d](https://github.com/angular/angular/commit/cf3ff7d))
|
|
||||||
* **elements:** fix lint ([#22413](https://github.com/angular/angular/issues/22413)) ([0b45dfa](https://github.com/angular/angular/commit/0b45dfa))
|
|
||||||
* **elements:** fix payload size ([#22413](https://github.com/angular/angular/issues/22413)) ([fe21437](https://github.com/angular/angular/commit/fe21437))
|
|
||||||
* **elements:** fix test ([#22413](https://github.com/angular/angular/issues/22413)) ([44f637a](https://github.com/angular/angular/commit/44f637a))
|
|
||||||
* **elements:** George's comments ([#22413](https://github.com/angular/angular/issues/22413)) ([46efd4b](https://github.com/angular/angular/commit/46efd4b))
|
|
||||||
* **elements:** injector create ([#22413](https://github.com/angular/angular/issues/22413)) ([87f60bc](https://github.com/angular/angular/commit/87f60bc))
|
|
||||||
* **elements:** make bazel happy ([#22413](https://github.com/angular/angular/issues/22413)) ([39a12d2](https://github.com/angular/angular/commit/39a12d2))
|
|
||||||
* **elements:** provide type, not factory; remove config need ([#22413](https://github.com/angular/angular/issues/22413)) ([1936808](https://github.com/angular/angular/commit/1936808))
|
|
||||||
* **elements:** rebase ([#22413](https://github.com/angular/angular/issues/22413)) ([d72f445](https://github.com/angular/angular/commit/d72f445))
|
|
||||||
* **elements:** remove attribute/input from config ([#22413](https://github.com/angular/angular/issues/22413)) ([688096b](https://github.com/angular/angular/commit/688096b))
|
|
||||||
* **elements:** rename API to createCustomElement ([#22413](https://github.com/angular/angular/issues/22413)) ([167fdf7](https://github.com/angular/angular/commit/167fdf7))
|
|
||||||
* **elements:** update package.json with latest ([#22413](https://github.com/angular/angular/issues/22413)) ([2e450f6](https://github.com/angular/angular/commit/2e450f6))
|
|
||||||
* mark angular packages as side-effect free ([#22785](https://github.com/angular/angular/issues/22785)) ([44de10e](https://github.com/angular/angular/commit/44de10e))
|
|
||||||
* tree-shakeable providers API updates ([#22655](https://github.com/angular/angular/issues/22655)) ([db56836](https://github.com/angular/angular/commit/db56836))
|
|
||||||
* update tslib to 1.9.0 ([#22667](https://github.com/angular/angular/issues/22667)) ([489fec1](https://github.com/angular/angular/commit/489fec1))
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **compiler:** The `<template>` tag was deprecated in Angular v4 to avoid collisions (i.e. when
|
|
||||||
using Web Components).
|
|
||||||
|
|
||||||
This commit removes support for `<template>`. `<ng-template>` should be used
|
|
||||||
instead.
|
|
||||||
|
|
||||||
BEFORE:
|
|
||||||
|
|
||||||
<!-- html template -->
|
|
||||||
<template>some template content</template>
|
|
||||||
|
|
||||||
# tsconfig.json
|
|
||||||
{
|
|
||||||
# ...
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
# ...
|
|
||||||
# This option is no more supported and will have no effect
|
|
||||||
"enableLegacyTemplate": [true|false]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AFTER:
|
|
||||||
|
|
||||||
<!-- html template -->
|
|
||||||
<ng-template>some template content</ng-template>
|
|
||||||
* **core:** it is no longer possible to import
|
|
||||||
animation-related functions from @angular/core. All
|
|
||||||
animation symbols must now be imported from @angular/animations.
|
|
||||||
* after this change, npm and yarn will issue incompatible peerDependencies warning
|
|
||||||
|
|
||||||
We don't expect this to actually break an application, but the application/library package.json
|
|
||||||
will need to be updated to provide tslib 1.9.0 or higher.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -215,18 +257,6 @@ will need to be updated to provide tslib 1.9.0 or higher.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.7"></a>
|
|
||||||
# [6.0.0-beta.7](https://github.com/angular/angular/compare/6.0.0-beta.6...6.0.0-beta.7) (2018-03-07)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** fixes for ng_package on Windows ([#22597](https://github.com/angular/angular/issues/22597)) ([4c40812](https://github.com/angular/angular/commit/4c40812))
|
|
||||||
* **compiler:** allow tree-shakeable injectables to depend on string tokens ([#22376](https://github.com/angular/angular/issues/22376)) ([dd53447](https://github.com/angular/angular/commit/dd53447))
|
|
||||||
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([fa974c7](https://github.com/angular/angular/commit/fa974c7)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.8"></a>
|
<a name="5.2.8"></a>
|
||||||
## [5.2.8](https://github.com/angular/angular/compare/5.2.7...5.2.8) (2018-03-07)
|
## [5.2.8](https://github.com/angular/angular/compare/5.2.7...5.2.8) (2018-03-07)
|
||||||
|
|
||||||
@ -241,63 +271,6 @@ will need to be updated to provide tslib 1.9.0 or higher.
|
|||||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.6"></a>
|
|
||||||
# [6.0.0-beta.6](https://github.com/angular/angular/compare/6.0.0-beta.5...6.0.0-beta.6) (2018-02-28)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** only use the WA-polyfill alongside AnimationBuilder ([#22143](https://github.com/angular/angular/issues/22143)) ([b2f366b](https://github.com/angular/angular/commit/b2f366b)), closes [#17496](https://github.com/angular/angular/issues/17496)
|
|
||||||
* **animations:** report correct totalTime value even during noOp animations ([#22225](https://github.com/angular/angular/issues/22225)) ([e1bf067](https://github.com/angular/angular/commit/e1bf067))
|
|
||||||
* **bazel:** ng_package includes transitive .d.ts and flatModuleMetadata ([#22499](https://github.com/angular/angular/issues/22499)) ([aabe16c](https://github.com/angular/angular/commit/aabe16c)), closes [#22419](https://github.com/angular/angular/issues/22419)
|
|
||||||
* **common:** correct mapping of Observable methods ([#20518](https://github.com/angular/angular/issues/20518)) ([2639b4b](https://github.com/angular/angular/commit/2639b4b)), closes [#20516](https://github.com/angular/angular/issues/20516)
|
|
||||||
* **common:** then and else template might be set to null ([#22298](https://github.com/angular/angular/issues/22298)) ([8115edc](https://github.com/angular/angular/commit/8115edc))
|
|
||||||
* **compiler-cli:** add missing entry point to package, update tsickle ([#22295](https://github.com/angular/angular/issues/22295)) ([28ac244](https://github.com/angular/angular/commit/28ac244))
|
|
||||||
* **core:** export inject() from [@angular](https://github.com/angular)/core ([#22389](https://github.com/angular/angular/issues/22389)) ([f8749bf](https://github.com/angular/angular/commit/f8749bf)), closes [#22388](https://github.com/angular/angular/issues/22388)
|
|
||||||
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([a7ebf5a](https://github.com/angular/angular/commit/a7ebf5a)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
|
||||||
* **core:** require factory to be provided for shakeable InjectionToken ([#22207](https://github.com/angular/angular/issues/22207)) ([f755db7](https://github.com/angular/angular/commit/f755db7)), closes [#22205](https://github.com/angular/angular/issues/22205)
|
|
||||||
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([3e6a86f](https://github.com/angular/angular/commit/3e6a86f)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
|
||||||
* **platform-server:** generate correct stylings for camel case names ([#22263](https://github.com/angular/angular/issues/22263)) ([40ba009](https://github.com/angular/angular/commit/40ba009)), closes [#19235](https://github.com/angular/angular/issues/19235)
|
|
||||||
* **router:** don't mutate route configs ([#22358](https://github.com/angular/angular/issues/22358)) ([45eff4c](https://github.com/angular/angular/commit/45eff4c)), closes [#22203](https://github.com/angular/angular/issues/22203)
|
|
||||||
* **router:** fix URL serialization so special characters are only encoded where needed ([#22337](https://github.com/angular/angular/issues/22337)) ([094666d](https://github.com/angular/angular/commit/094666d)), closes [#10280](https://github.com/angular/angular/issues/10280)
|
|
||||||
* **upgrade:** correctly destroy nested downgraded component ([#22400](https://github.com/angular/angular/issues/22400)) ([8a85888](https://github.com/angular/angular/commit/8a85888)), closes [#22392](https://github.com/angular/angular/issues/22392)
|
|
||||||
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([f089bf5](https://github.com/angular/angular/commit/f089bf5))
|
|
||||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([13ab91e](https://github.com/angular/angular/commit/13ab91e)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **bazel:** add an ng_package rule ([#22221](https://github.com/angular/angular/issues/22221)) ([b43b164](https://github.com/angular/angular/commit/b43b164))
|
|
||||||
* **bazel:** introduce a binary stamping feature ([#22176](https://github.com/angular/angular/issues/22176)) ([bba65e0](https://github.com/angular/angular/commit/bba65e0))
|
|
||||||
* **bazel:** ng_module produces bundle index ([#22176](https://github.com/angular/angular/issues/22176)) ([029dbf0](https://github.com/angular/angular/commit/029dbf0))
|
|
||||||
* **bazel:** ng_package adds package.json props ([#22499](https://github.com/angular/angular/issues/22499)) ([b6c9410](https://github.com/angular/angular/commit/b6c9410)), closes [#22416](https://github.com/angular/angular/issues/22416)
|
|
||||||
* **common:** better error message when non-template element used in NgIf ([#22274](https://github.com/angular/angular/issues/22274)) ([67cf11d](https://github.com/angular/angular/commit/67cf11d)), closes [#16410](https://github.com/angular/angular/issues/16410)
|
|
||||||
* **common:** export functions to format numbers, percents, currencies & dates ([#22423](https://github.com/angular/angular/issues/22423)) ([4180912](https://github.com/angular/angular/commit/4180912)), closes [#20536](https://github.com/angular/angular/issues/20536)
|
|
||||||
* **compiler-cli:** Check unvalidated combination of ngc and TypeScript ([#22293](https://github.com/angular/angular/issues/22293)) ([3ceee99](https://github.com/angular/angular/commit/3ceee99)), closes [#20669](https://github.com/angular/angular/issues/20669)
|
|
||||||
* **core:** set preserveWhitespaces to false by default ([#22046](https://github.com/angular/angular/issues/22046)) ([f1a0632](https://github.com/angular/angular/commit/f1a0632)), closes [#22027](https://github.com/angular/angular/issues/22027)
|
|
||||||
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([5c89d6b](https://github.com/angular/angular/commit/5c89d6b)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
|
||||||
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([b7544cc](https://github.com/angular/angular/commit/b7544cc)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
|
||||||
* **forms:** allow markAsPending to emit events ([#20212](https://github.com/angular/angular/issues/20212)) ([e86b64b](https://github.com/angular/angular/commit/e86b64b)), closes [#17958](https://github.com/angular/angular/issues/17958)
|
|
||||||
* allow direct scoping of @Injectables to the root injector ([#22185](https://github.com/angular/angular/issues/22185)) ([7ac34e4](https://github.com/angular/angular/commit/7ac34e4))
|
|
||||||
* **platform-browser:** do not throw error when Hammer.js not loaded ([#22257](https://github.com/angular/angular/issues/22257)) ([991300b](https://github.com/angular/angular/commit/991300b)), closes [#16992](https://github.com/angular/angular/issues/16992)
|
|
||||||
* **platform-browser:** fix [#19604](https://github.com/angular/angular/issues/19604), can config hammerOptions ([#21979](https://github.com/angular/angular/issues/21979)) ([1d571b2](https://github.com/angular/angular/commit/1d571b2))
|
|
||||||
* **platform-server:** bump Domino to v2.0 ([#22411](https://github.com/angular/angular/issues/22411)) ([d3827a0](https://github.com/angular/angular/commit/d3827a0))
|
|
||||||
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **platform-server:** * Bump the dependency on Domino to 2.0 to resolve issues with
|
|
||||||
namespacing
|
|
||||||
* **forms:** - `AbstractControl#statusChanges` now emits an event of `'PENDING'` when you call `AbstractControl#markAsPending`
|
|
||||||
- Previously it did not emit an event when you called `markAsPending`
|
|
||||||
- To migrate you would need to ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`
|
|
||||||
* **animations:** When animation is trigged within a disabled zone, the
|
|
||||||
associated event (which an instance of AnimationEvent) will no longer
|
|
||||||
report the totalTime as 0 (it will emit the actual time of the
|
|
||||||
animation). To detect if an animation event is reporting a disabled
|
|
||||||
animation then the `event.disabled` property can be used instead.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.7"></a>
|
<a name="5.2.7"></a>
|
||||||
## [5.2.7](https://github.com/angular/angular/compare/5.2.6...5.2.7) (2018-02-28)
|
## [5.2.7](https://github.com/angular/angular/compare/5.2.6...5.2.7) (2018-02-28)
|
||||||
@ -311,72 +284,7 @@ animation then the `event.disabled` property can be used instead.
|
|||||||
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
* **upgrade:** correctly handle `=` bindings in `[@angular](https://github.com/angular)/upgrade` ([#22167](https://github.com/angular/angular/issues/22167)) ([6638390](https://github.com/angular/angular/commit/6638390))
|
||||||
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
* **upgrade:** fix empty transclusion content with AngularJS@>=1.5.8 ([#22167](https://github.com/angular/angular/issues/22167)) ([a9a0e27](https://github.com/angular/angular/commit/a9a0e27)), closes [#22175](https://github.com/angular/angular/issues/22175)
|
||||||
|
|
||||||
<a name="6.0.0-beta.5"></a>
|
|
||||||
# [6.0.0-beta.5](https://github.com/angular/angular/compare/6.0.0-beta.4...6.0.0-beta.5) (2018-02-22)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** report correct totalTime value even during noOp animations ([#22225](https://github.com/angular/angular/issues/22225)) ([e1bf067](https://github.com/angular/angular/commit/e1bf067))
|
|
||||||
* **common:** correct mapping of Observable methods ([#20518](https://github.com/angular/angular/issues/20518)) ([2639b4b](https://github.com/angular/angular/commit/2639b4b)), closes [#20516](https://github.com/angular/angular/issues/20516)
|
|
||||||
* **common:** then and else template might be set to null ([#22298](https://github.com/angular/angular/issues/22298)) ([8115edc](https://github.com/angular/angular/commit/8115edc))
|
|
||||||
* **compiler-cli:** add missing entry point to package, update tsickle ([#22295](https://github.com/angular/angular/issues/22295)) ([28ac244](https://github.com/angular/angular/commit/28ac244))
|
|
||||||
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([a7ebf5a](https://github.com/angular/angular/commit/a7ebf5a)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
|
||||||
* **core:** require factory to be provided for shakeable InjectionToken ([#22207](https://github.com/angular/angular/issues/22207)) ([f755db7](https://github.com/angular/angular/commit/f755db7)), closes [#22205](https://github.com/angular/angular/issues/22205)
|
|
||||||
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([3e6a86f](https://github.com/angular/angular/commit/3e6a86f)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
|
||||||
* **core:** set `preserveWhitespaces` to false by default ([#22046](https://github.com/angular/angular/issues/22046)) ([f1a0632](https://github.com/angular/angular/commit/f1a0632)), closes [#22027](https://github.com/angular/angular/issues/22027)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **common:** better error message when non-template element used in NgIf ([#22274](https://github.com/angular/angular/issues/22274)) ([67cf11d](https://github.com/angular/angular/commit/67cf11d)), closes [#16410](https://github.com/angular/angular/issues/16410)
|
|
||||||
* **compiler-cli:** Check unvalidated combination of ngc and TypeScript ([#22293](https://github.com/angular/angular/issues/22293)) ([3ceee99](https://github.com/angular/angular/commit/3ceee99)), closes [#20669](https://github.com/angular/angular/issues/20669)
|
|
||||||
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([5c89d6b](https://github.com/angular/angular/commit/5c89d6b)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
|
||||||
* **platform-browser:** do not throw error when Hammer.js not loaded ([#22257](https://github.com/angular/angular/issues/22257)) ([991300b](https://github.com/angular/angular/commit/991300b)), closes [#16992](https://github.com/angular/angular/issues/16992)
|
|
||||||
* **platform-browser:** fix [#19604](https://github.com/angular/angular/issues/19604), can config hammerOptions ([#21979](https://github.com/angular/angular/issues/21979)) ([1d571b2](https://github.com/angular/angular/commit/1d571b2))
|
|
||||||
|
|
||||||
### BREAKING CHANGES
|
|
||||||
|
|
||||||
* **animations:** When animation is triggered within a disabled zone, the
|
|
||||||
associated event (which an instance of AnimationEvent) will no longer
|
|
||||||
report the totalTime as 0 (it will emit the actual time of the
|
|
||||||
animation). To detect if an animation event is reporting a disabled
|
|
||||||
animation then the `event.disabled` property can be used instead.
|
|
||||||
|
|
||||||
* **forms:** ngModelChange is now emitted after the value/validity is updated on its control.
|
|
||||||
|
|
||||||
Previously, ngModelChange was emitted before its underlying control was updated.
|
|
||||||
This was fine if you passed through the value directly through the $event keyword, e.g.
|
|
||||||
|
|
||||||
```
|
|
||||||
<input [(ngModel)]="name" (ngModelChange)="onChange($event)">
|
|
||||||
|
|
||||||
onChange(value) {
|
|
||||||
console.log(value); // would log updated value
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
However, if you had a handler for the ngModelChange event that checked the value through the control,
|
|
||||||
you would get the old value rather than the updated value. e.g:
|
|
||||||
|
|
||||||
```
|
|
||||||
<input #modelDir="ngModel" [(ngModel)]="name" (ngModelChange)="onChange(modelDir)">
|
|
||||||
|
|
||||||
onChange(ngModel: NgModel) {
|
|
||||||
console.log(ngModel.value); // would log old value, not updated value
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Now the value and validity will be updated before the ngModelChange event is emitted,
|
|
||||||
so the same setup will log the updated value.
|
|
||||||
|
|
||||||
```
|
|
||||||
onChange(ngModel: NgModel) {
|
|
||||||
console.log(ngModel.value); // will log updated value
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
We think this order will be less confusing when the control is checked directly.
|
|
||||||
You will only need to update your app if it has relied on this bug to keep track of the old control value.
|
|
||||||
If that is the case, you should be able to track the old value directly by saving it on your component.
|
|
||||||
|
|
||||||
<a name="5.2.6"></a>
|
<a name="5.2.6"></a>
|
||||||
## [5.2.6](https://github.com/angular/angular/compare/5.2.5...5.2.6) (2018-02-22)
|
## [5.2.6](https://github.com/angular/angular/compare/5.2.5...5.2.6) (2018-02-22)
|
||||||
@ -389,34 +297,7 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([5ec38f2](https://github.com/angular/angular/commit/5ec38f2)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
* **core:** properly handle function without prototype in reflector ([#22284](https://github.com/angular/angular/issues/22284)) ([5ec38f2](https://github.com/angular/angular/commit/5ec38f2)), closes [#19978](https://github.com/angular/angular/issues/19978)
|
||||||
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([ee91de9](https://github.com/angular/angular/commit/ee91de9)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
* **core:** support metadata reflection for native class types ([#22356](https://github.com/angular/angular/issues/22356)) ([ee91de9](https://github.com/angular/angular/commit/ee91de9)), closes [#21731](https://github.com/angular/angular/issues/21731)
|
||||||
|
|
||||||
<a name="6.0.0-beta.4"></a>
|
|
||||||
# [6.0.0-beta.4](https://github.com/angular/angular/compare/6.0.0-beta.3...6.0.0-beta.4) (2018-02-14)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **bazel:** allow TS to read ambient typings ([#21876](https://github.com/angular/angular/issues/21876)) ([b081dfe](https://github.com/angular/angular/commit/b081dfe)), closes [#21872](https://github.com/angular/angular/issues/21872)
|
|
||||||
* **bazel:** improve error message for missing assets ([#22096](https://github.com/angular/angular/issues/22096)) ([dcf64a0](https://github.com/angular/angular/commit/dcf64a0)), closes [#22095](https://github.com/angular/angular/issues/22095)
|
|
||||||
* **common:** add locale currency values ([#21783](https://github.com/angular/angular/issues/21783)) ([420cc7a](https://github.com/angular/angular/commit/420cc7a)), closes [#20385](https://github.com/angular/angular/issues/20385)
|
|
||||||
* **common:** round currencies based on decimal digits in `CurrencyPipe` ([#21783](https://github.com/angular/angular/issues/21783)) ([44154e7](https://github.com/angular/angular/commit/44154e7)), closes [#10189](https://github.com/angular/angular/issues/10189)
|
|
||||||
* **common:** weaken AsyncPipe transform signature ([#22169](https://github.com/angular/angular/issues/22169)) ([be59c3a](https://github.com/angular/angular/commit/be59c3a))
|
|
||||||
* **compiler:** make unary plus operator consistent to JavaScript ([#22154](https://github.com/angular/angular/issues/22154)) ([72f8abd](https://github.com/angular/angular/commit/72f8abd)), closes [#22089](https://github.com/angular/angular/issues/22089)
|
|
||||||
* **core:** add stacktrace in log when error during cleanup component in TestBed ([#22162](https://github.com/angular/angular/issues/22162)) ([16d1700](https://github.com/angular/angular/commit/16d1700))
|
|
||||||
* **core:** ensure initial value of QueryList length ([#21980](https://github.com/angular/angular/issues/21980)) ([#21982](https://github.com/angular/angular/issues/21982)) ([e56de10](https://github.com/angular/angular/commit/e56de10)), closes [#21980](https://github.com/angular/angular/issues/21980)
|
|
||||||
* **core:** use appropriate inert document strategy for Firefox & Safari ([#17019](https://github.com/angular/angular/issues/17019)) ([a751649](https://github.com/angular/angular/commit/a751649))
|
|
||||||
* **forms:** make Validators.email support optional controls ([#20869](https://github.com/angular/angular/issues/20869)) ([140e7c0](https://github.com/angular/angular/commit/140e7c0))
|
|
||||||
* **forms:** prevent event emission on enable/disable when emitEvent is false ([#12366](https://github.com/angular/angular/issues/12366)) ([#21018](https://github.com/angular/angular/issues/21018)) ([0bcfae7](https://github.com/angular/angular/commit/0bcfae7))
|
|
||||||
* **forms:** set state before emitting a value from ngModelChange ([#21514](https://github.com/angular/angular/issues/21514)) ([9744a1c](https://github.com/angular/angular/commit/9744a1c)), closes [#21513](https://github.com/angular/angular/issues/21513)
|
|
||||||
* **language-service:** correct instructions to install the language service ([#22000](https://github.com/angular/angular/issues/22000)) ([b37cee3](https://github.com/angular/angular/commit/b37cee3))
|
|
||||||
* **platform-browser:** add @Injectable where it was missing ([#22005](https://github.com/angular/angular/issues/22005)) ([0a1a397](https://github.com/angular/angular/commit/0a1a397))
|
|
||||||
* **platform-browser:** support 0/false/null values in transfer_state ([#22179](https://github.com/angular/angular/issues/22179)) ([6435ecd](https://github.com/angular/angular/commit/6435ecd))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **bazel:** allow explicit specification of factories ([#22003](https://github.com/angular/angular/issues/22003)) ([e442881](https://github.com/angular/angular/commit/e442881))
|
|
||||||
* **compiler:** mark @NgModules in provider lists for identification at runtime ([#22005](https://github.com/angular/angular/issues/22005)) ([2d5e7d1](https://github.com/angular/angular/commit/2d5e7d1))
|
|
||||||
* **forms:** multiple validators for array method ([#20766](https://github.com/angular/angular/issues/20766)) ([941e88f](https://github.com/angular/angular/commit/941e88f)), closes [#20665](https://github.com/angular/angular/issues/20665)
|
|
||||||
* change @Injectable() to support tree-shakeable tokens ([#22005](https://github.com/angular/angular/issues/22005)) ([235a235](https://github.com/angular/angular/commit/235a235))
|
|
||||||
|
|
||||||
<a name="5.2.5"></a>
|
<a name="5.2.5"></a>
|
||||||
## [5.2.5](https://github.com/angular/angular/compare/5.2.4...5.2.5) (2018-02-14)
|
## [5.2.5](https://github.com/angular/angular/compare/5.2.4...5.2.5) (2018-02-14)
|
||||||
@ -435,34 +316,6 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
* **language-service:** correct instructions to install the language service ([#22000](https://github.com/angular/angular/issues/22000)) ([0b23573](https://github.com/angular/angular/commit/0b23573))
|
* **language-service:** correct instructions to install the language service ([#22000](https://github.com/angular/angular/issues/22000)) ([0b23573](https://github.com/angular/angular/commit/0b23573))
|
||||||
* **platform-browser:** support 0/false/null values in transfer_state ([#22179](https://github.com/angular/angular/issues/22179)) ([da6ab91](https://github.com/angular/angular/commit/da6ab91))
|
* **platform-browser:** support 0/false/null values in transfer_state ([#22179](https://github.com/angular/angular/issues/22179)) ([da6ab91](https://github.com/angular/angular/commit/da6ab91))
|
||||||
|
|
||||||
<a name="6.0.0-beta.3"></a>
|
|
||||||
# [6.0.0-beta.3](https://github.com/angular/angular/compare/6.0.0-beta.2...6.0.0-beta.3) (2018-02-07)
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** don't convert null to a string when flushing a mock request ([#21417](https://github.com/angular/angular/issues/21417)) ([8b14488](https://github.com/angular/angular/commit/8b14488)), closes [#20744](https://github.com/angular/angular/issues/20744)
|
|
||||||
* **core:** fix [#20582](https://github.com/angular/angular/issues/20582), don't need to wrap zone in location change listener ([#20640](https://github.com/angular/angular/issues/20640)) ([f791e9f](https://github.com/angular/angular/commit/f791e9f))
|
|
||||||
* **core:** fix proper propagation of subscriptions in EventEmitter ([#22016](https://github.com/angular/angular/issues/22016)) ([e81606c](https://github.com/angular/angular/commit/e81606c)), closes [#21999](https://github.com/angular/angular/issues/21999)
|
|
||||||
* **core:** should check Zone existence when scheduleMicroTask ([#20656](https://github.com/angular/angular/issues/20656)) ([3a86940](https://github.com/angular/angular/commit/3a86940))
|
|
||||||
* **forms:** publish missing types ([#19941](https://github.com/angular/angular/issues/19941)) ([2707012](https://github.com/angular/angular/commit/2707012))
|
|
||||||
* **ivy:** generate correct interpolations ([#21946](https://github.com/angular/angular/issues/21946)) ([3cc1d76](https://github.com/angular/angular/commit/3cc1d76))
|
|
||||||
* **ivy:** generate lifecycle pattern ([#21865](https://github.com/angular/angular/issues/21865)) ([f816666](https://github.com/angular/angular/commit/f816666))
|
|
||||||
* **ivy:** improve `bindV` perf and memory usage ([#21881](https://github.com/angular/angular/issues/21881)) ([0846784](https://github.com/angular/angular/commit/0846784))
|
|
||||||
* **ivy:** remove unnecessary parameter of NgOnChangesFeature ([#21879](https://github.com/angular/angular/issues/21879)) ([65cf1ad](https://github.com/angular/angular/commit/65cf1ad))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **compiler-cli:** reflect static methods added to classes in metadata ([#21926](https://github.com/angular/angular/issues/21926)) ([eb8ddd2](https://github.com/angular/angular/commit/eb8ddd2))
|
|
||||||
* **ivy:** add canonical example of a pipe. ([#21834](https://github.com/angular/angular/issues/21834)) ([743d8bc](https://github.com/angular/angular/commit/743d8bc))
|
|
||||||
* **ivy:** add support for attributes on ng-content nodes ([#21935](https://github.com/angular/angular/issues/21935)) ([1aa2947](https://github.com/angular/angular/commit/1aa2947))
|
|
||||||
* **ivy:** memoize array literals in render3 ([#21973](https://github.com/angular/angular/issues/21973)) ([4d62be6](https://github.com/angular/angular/commit/4d62be6))
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **ivy:** improve Uglify configuration in hello world integration test ([#21985](https://github.com/angular/angular/issues/21985)) ([7e51e52](https://github.com/angular/angular/commit/7e51e52))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.4"></a>
|
<a name="5.2.4"></a>
|
||||||
@ -478,17 +331,6 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.2"></a>
|
|
||||||
# [6.0.0-beta.2](https://github.com/angular/angular/compare/6.0.0-beta.1...6.0.0-beta.2) (2018-01-31)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **router:** add navigationSource and restoredState to NavigationStart event ([#21728](https://github.com/angular/angular/issues/21728)) ([c40ae7f](https://github.com/angular/angular/commit/c40ae7f))
|
|
||||||
* **service-worker:** add helper script which will uninstall SW ([#21863](https://github.com/angular/angular/issues/21863)) ([b10540a](https://github.com/angular/angular/commit/b10540a))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.3"></a>
|
<a name="5.2.3"></a>
|
||||||
## [5.2.3](https://github.com/angular/angular/compare/5.2.2...5.2.3) (2018-01-31)
|
## [5.2.3](https://github.com/angular/angular/compare/5.2.2...5.2.3) (2018-01-31)
|
||||||
|
|
||||||
@ -506,32 +348,6 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.1"></a>
|
|
||||||
# [6.0.0-beta.1](https://github.com/angular/angular/compare/6.0.0-beta.0...6.0.0-beta.1) (2018-01-25)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **common:** A null value should remove the style on IE ([#21679](https://github.com/angular/angular/issues/21679)) ([7d49443](https://github.com/angular/angular/commit/7d49443)), closes [#21064](https://github.com/angular/angular/issues/21064)
|
|
||||||
* avoid triggering a cli bug ([#21611](https://github.com/angular/angular/issues/21611)) ([0eabd07](https://github.com/angular/angular/commit/0eabd07))
|
|
||||||
* **common:** don't remove special characters when extracting CLDR data ([#21626](https://github.com/angular/angular/issues/21626)) ([135a282](https://github.com/angular/angular/commit/135a282))
|
|
||||||
* **common:** extract plural function from i18n locale data files for TS 2.6 ([#21626](https://github.com/angular/angular/issues/21626)) ([97b18b2](https://github.com/angular/angular/commit/97b18b2)), closes [#21608](https://github.com/angular/angular/issues/21608)
|
|
||||||
* **common:** fallback to last defined value for named date and time formats ([#21299](https://github.com/angular/angular/issues/21299)) ([879756d](https://github.com/angular/angular/commit/879756d)), closes [#21282](https://github.com/angular/angular/issues/21282)
|
|
||||||
* **compiler:** add support for marker tags in xliff serializers ([#21250](https://github.com/angular/angular/issues/21250)) ([f74130c](https://github.com/angular/angular/commit/f74130c)), closes [#21078](https://github.com/angular/angular/issues/21078)
|
|
||||||
* **compiler:** Don't strip `/*# sourceURL ... */` ([#16088](https://github.com/angular/angular/issues/16088)) ([5f681f9](https://github.com/angular/angular/commit/5f681f9))
|
|
||||||
* **compiler:** fix ICU select messages to use male/female/other ([#21713](https://github.com/angular/angular/issues/21713)) ([cb5090c](https://github.com/angular/angular/commit/cb5090c))
|
|
||||||
* **compiler-cli:** do not fold errors past calls in the collector ([#21708](https://github.com/angular/angular/issues/21708)) ([dd86790](https://github.com/angular/angular/commit/dd86790))
|
|
||||||
* **compiler-cli:** do not lower expressions in non-modules ([#21649](https://github.com/angular/angular/issues/21649)) ([7f93aad](https://github.com/angular/angular/commit/7f93aad))
|
|
||||||
* **router:** don't use ParamsInheritanceStrategy in declarations ([#21574](https://github.com/angular/angular/issues/21574)) ([925e654](https://github.com/angular/angular/commit/925e654)), closes [#21456](https://github.com/angular/angular/issues/21456)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **compiler:** implement "enableIvy" compiler option ([#21427](https://github.com/angular/angular/issues/21427)) ([64d16de](https://github.com/angular/angular/commit/64d16de))
|
|
||||||
* **core:** optional generic type for ElementRef ([#20765](https://github.com/angular/angular/issues/20765)) ([d3d9aac](https://github.com/angular/angular/commit/d3d9aac)), closes [#13139](https://github.com/angular/angular/issues/13139)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.2"></a>
|
<a name="5.2.2"></a>
|
||||||
## [5.2.2](https://github.com/angular/angular/compare/5.2.1...5.2.2) (2018-01-25)
|
## [5.2.2](https://github.com/angular/angular/compare/5.2.1...5.2.2) (2018-01-25)
|
||||||
|
|
||||||
@ -551,36 +367,6 @@ If that is the case, you should be able to track the old value directly by savin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="6.0.0-beta.0"></a>
|
|
||||||
# [6.0.0-beta.0](https://github.com/angular/angular/compare/5.2.0...6.0.0-beta.0) (2018-01-17)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* **animations:** fix increment/decrement aliases example ([#18323](https://github.com/angular/angular/issues/18323)) ([d2aa8ac](https://github.com/angular/angular/commit/d2aa8ac))
|
|
||||||
* **benchpress:** should still support selenium_webdriver < 3.6.0 ([#21477](https://github.com/angular/angular/issues/21477)) ([9b84a32](https://github.com/angular/angular/commit/9b84a32))
|
|
||||||
* **common:** set correct timezone for ISO8601 dates in Safari ([#21506](https://github.com/angular/angular/issues/21506)) ([05208b8](https://github.com/angular/angular/commit/05208b8)), closes [#21491](https://github.com/angular/angular/issues/21491)
|
|
||||||
* **compiler:** cache external reference resolution ([#21359](https://github.com/angular/angular/issues/21359)) ([e3e2fc0](https://github.com/angular/angular/commit/e3e2fc0))
|
|
||||||
* **compiler:** make `.ngsummary.json` files idempotent ([#21448](https://github.com/angular/angular/issues/21448)) ([e64b1e9](https://github.com/angular/angular/commit/e64b1e9))
|
|
||||||
* **core:** fix chained http call ([#20924](https://github.com/angular/angular/issues/20924)) ([7e3f9a4](https://github.com/angular/angular/commit/7e3f9a4)), closes [#20921](https://github.com/angular/angular/issues/20921)
|
|
||||||
* **ivy:** Add workaround for AJD in google3 ([#21488](https://github.com/angular/angular/issues/21488)) ([6af3672](https://github.com/angular/angular/commit/6af3672))
|
|
||||||
* **language-service:** Clear caches when program changes ([#21337](https://github.com/angular/angular/issues/21337)) ([43e1520](https://github.com/angular/angular/commit/43e1520)), closes [#19405](https://github.com/angular/angular/issues/19405)
|
|
||||||
* **service-worker:** properly handle invalid hashes in all scenarios ([#21288](https://github.com/angular/angular/issues/21288)) ([3951098](https://github.com/angular/angular/commit/3951098))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* **bazel:** allow ng_module rules to control whether type checking is enabled ([#21460](https://github.com/angular/angular/issues/21460)) ([cffa0fe](https://github.com/angular/angular/commit/cffa0fe))
|
|
||||||
* **core:** add binding name to content changed error ([#20352](https://github.com/angular/angular/issues/20352)) ([d3bf54b](https://github.com/angular/angular/commit/d3bf54b))
|
|
||||||
* **forms:** handle string with and without line boundary on pattern validator ([#19256](https://github.com/angular/angular/issues/19256)) ([54bf179](https://github.com/angular/angular/commit/54bf179))
|
|
||||||
|
|
||||||
|
|
||||||
### Performance Improvements
|
|
||||||
|
|
||||||
* **ivy:** add missing dom element in render3_function tree benchmark ([#21476](https://github.com/angular/angular/issues/21476)) ([9b5a485](https://github.com/angular/angular/commit/9b5a485))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="5.2.1"></a>
|
<a name="5.2.1"></a>
|
||||||
## [5.2.1](https://github.com/angular/angular/compare/5.2.0...5.2.1) (2018-01-17)
|
## [5.2.1](https://github.com/angular/angular/compare/5.2.0...5.2.1) (2018-01-17)
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ yarn_install(
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "build_bazel_rules_typescript",
|
name = "build_bazel_rules_typescript",
|
||||||
url = "https://github.com/bazelbuild/rules_typescript/archive/0.11.1.zip",
|
url = "https://github.com/bazelbuild/rules_typescript/archive/0.12.1.zip",
|
||||||
strip_prefix = "rules_typescript-0.11.1",
|
strip_prefix = "rules_typescript-0.12.1",
|
||||||
sha256 = "7406bea7954e1c906f075115dfa176551a881119f6820b126ea1eacb09f34a1a",
|
sha256 = "24e2c36f60508c6d270ae4265b89b381e3f66d550e70c367ed3755ad8d7ce3b0",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
||||||
"project": {
|
|
||||||
"name": "site"
|
|
||||||
},
|
|
||||||
"apps": [
|
|
||||||
{
|
|
||||||
"root": "src",
|
|
||||||
"outDir": "dist",
|
|
||||||
"assets": [
|
|
||||||
"assets",
|
|
||||||
"generated",
|
|
||||||
"app/search/search-worker.js",
|
|
||||||
"favicon.ico",
|
|
||||||
"pwa-manifest.json",
|
|
||||||
"google385281288605d160.html",
|
|
||||||
{ "glob": "custom-elements.min.js", "input": "../node_modules/@webcomponents/custom-elements", "output": "./assets/js" },
|
|
||||||
{ "glob": "native-shim.js", "input": "../node_modules/@webcomponents/custom-elements/src", "output": "./assets/js" }
|
|
||||||
],
|
|
||||||
"index": "index.html",
|
|
||||||
"main": "main.ts",
|
|
||||||
"polyfills": "polyfills.ts",
|
|
||||||
"test": "test.ts",
|
|
||||||
"tsconfig": "tsconfig.app.json",
|
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
|
||||||
"prefix": "aio",
|
|
||||||
"serviceWorker": false,
|
|
||||||
"styles": [
|
|
||||||
"styles.scss"
|
|
||||||
],
|
|
||||||
"scripts": [
|
|
||||||
],
|
|
||||||
"environmentSource": "environments/environment.ts",
|
|
||||||
"environments": {
|
|
||||||
"dev": "environments/environment.ts",
|
|
||||||
"next": "environments/environment.next.ts",
|
|
||||||
"stable": "environments/environment.stable.ts",
|
|
||||||
"archive": "environments/environment.archive.ts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"e2e": {
|
|
||||||
"protractor": {
|
|
||||||
"config": "tests/e2e/protractor.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": [
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.app.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "src/tsconfig.spec.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"project": "tests/e2e/tsconfig.e2e.json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"test": {
|
|
||||||
"karma": {
|
|
||||||
"config": "src/karma.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaults": {
|
|
||||||
"styleExt": "scss",
|
|
||||||
"component": {
|
|
||||||
"inlineStyle": true
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"namedChunks": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"packageManager": "yarn"
|
|
||||||
}
|
|
@ -22,7 +22,8 @@ Here are the most important tasks you might need to use:
|
|||||||
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
||||||
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
||||||
* `yarn lint` - check that the doc-viewer code follows our style rules.
|
* `yarn lint` - check that the doc-viewer code follows our style rules.
|
||||||
* `yarn test` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
|
* `yarn test` - run all the unit tests once.
|
||||||
|
* `yarn test --watch` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
|
||||||
* `yarn e2e` - run all the e2e tests for the doc-viewer.
|
* `yarn e2e` - run all the e2e tests for the doc-viewer.
|
||||||
|
|
||||||
* `yarn docs` - generate all the docs from the source files.
|
* `yarn docs` - generate all the docs from the source files.
|
||||||
|
240
aio/angular.json
Normal file
240
aio/angular.json
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"cli": {
|
||||||
|
"packageManager": "yarn"
|
||||||
|
},
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"site": {
|
||||||
|
"root": "",
|
||||||
|
"projectType": "application",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"main": "src/main.ts",
|
||||||
|
"tsConfig": "src/tsconfig.app.json",
|
||||||
|
"aot": true,
|
||||||
|
"optimization": true,
|
||||||
|
"buildOptimizer": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": true,
|
||||||
|
"statsJson": true,
|
||||||
|
"extractCss": true,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"namedChunks": true,
|
||||||
|
"vendorChunk": false,
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "src/assets",
|
||||||
|
"output": "/assets"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "src/generated",
|
||||||
|
"output": "/generated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "app/search/search-worker.js",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "favicon.ico",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "pwa-manifest.json",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "google385281288605d160.html",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "custom-elements.min.js",
|
||||||
|
"input": "node_modules/@webcomponents/custom-elements",
|
||||||
|
"output": "/assets/js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "native-shim.js",
|
||||||
|
"input": "node_modules/@webcomponents/custom-elements/src",
|
||||||
|
"output": "/assets/js"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
{
|
||||||
|
"input": "src/styles.scss"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"fast": {
|
||||||
|
"optimization": false
|
||||||
|
},
|
||||||
|
"next": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"src": "src/environments/environment.ts",
|
||||||
|
"replaceWith": "src/environments/environment.next.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"stable": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"src": "src/environments/environment.ts",
|
||||||
|
"replaceWith": "src/environments/environment.stable.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"archive": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"src": "src/environments/environment.ts",
|
||||||
|
"replaceWith": "src/environments/environment.archive.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "site:build"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"fast": {
|
||||||
|
"browserTarget": "site:build:fast"
|
||||||
|
},
|
||||||
|
"next": {
|
||||||
|
"browserTarget": "site:build:next"
|
||||||
|
},
|
||||||
|
"stable": {
|
||||||
|
"browserTarget": "site:build:stable"
|
||||||
|
},
|
||||||
|
"archive": {
|
||||||
|
"browserTarget": "site:build:archive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
|
"options": {
|
||||||
|
"browserTarget": "site:build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "src/test.ts",
|
||||||
|
"karmaConfig": "src/karma.conf.js",
|
||||||
|
"polyfills": "src/polyfills.ts",
|
||||||
|
"tsConfig": "src/tsconfig.spec.json",
|
||||||
|
"scripts": [],
|
||||||
|
"styles": [
|
||||||
|
{
|
||||||
|
"input": "src/styles.scss"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "src/assets",
|
||||||
|
"output": "/assets"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "src/generated",
|
||||||
|
"output": "/generated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "app/search/search-worker.js",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "favicon.ico",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "pwa-manifest.json",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "google385281288605d160.html",
|
||||||
|
"input": "src",
|
||||||
|
"output": "/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "custom-elements.min.js",
|
||||||
|
"input": "node_modules/@webcomponents/custom-elements",
|
||||||
|
"output": "/assets/js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "native-shim.js",
|
||||||
|
"input": "node_modules/@webcomponents/custom-elements/src",
|
||||||
|
"output": "/assets/js"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"src/tsconfig.app.json",
|
||||||
|
"src/tsconfig.spec.json"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"site-e2e": {
|
||||||
|
"root": "",
|
||||||
|
"projectType": "application",
|
||||||
|
"cli": {},
|
||||||
|
"schematics": {},
|
||||||
|
"architect": {
|
||||||
|
"e2e": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "tests/e2e/protractor.conf.js",
|
||||||
|
"devServerTarget": "site:serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": [
|
||||||
|
"tests/e2e/tsconfig.e2e.json"
|
||||||
|
],
|
||||||
|
"exclude": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"inlineStyle": true,
|
||||||
|
"prefix": "aio",
|
||||||
|
"styleext": "scss"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"prefix": "aio"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
aio/content/examples/.gitignore
vendored
6
aio/content/examples/.gitignore
vendored
@ -13,18 +13,20 @@
|
|||||||
**/src/tsconfig.app.json
|
**/src/tsconfig.app.json
|
||||||
**/src/tsconfig.spec.json
|
**/src/tsconfig.spec.json
|
||||||
**/src/typings.d.ts
|
**/src/typings.d.ts
|
||||||
**/e2e/app.po.ts
|
**/e2e/src/app.po.ts
|
||||||
**/e2e/tsconfig.e2e.json
|
**/e2e/tsconfig.e2e.json
|
||||||
|
**/src/karma.conf.js
|
||||||
**/.angular-cli.json
|
**/.angular-cli.json
|
||||||
**/.editorconfig
|
**/.editorconfig
|
||||||
|
**/angular.json
|
||||||
**/tsconfig.json
|
**/tsconfig.json
|
||||||
**/bs-config.e2e.json
|
**/bs-config.e2e.json
|
||||||
**/bs-config.json
|
**/bs-config.json
|
||||||
**/package.json
|
**/package.json
|
||||||
**/tslint.json
|
**/tslint.json
|
||||||
**/karma.conf.js
|
|
||||||
**/karma-test-shim.js
|
**/karma-test-shim.js
|
||||||
**/browser-test-shim.js
|
**/browser-test-shim.js
|
||||||
|
**/browserslist
|
||||||
**/node_modules
|
**/node_modules
|
||||||
|
|
||||||
# built files
|
# built files
|
||||||
|
@ -15,7 +15,7 @@ export class BackendService {
|
|||||||
|
|
||||||
getAll(type: Type<any>): PromiseLike<any[]> {
|
getAll(type: Type<any>): PromiseLike<any[]> {
|
||||||
if (type === Hero) {
|
if (type === Hero) {
|
||||||
// TODO get from the database
|
// TODO: get from the database
|
||||||
return Promise.resolve<Hero[]>(HEROES);
|
return Promise.resolve<Hero[]>(HEROES);
|
||||||
}
|
}
|
||||||
let err = new Error('Cannot get object of this type');
|
let err = new Error('Cannot get object of this type');
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"!**/*.d.ts",
|
"!**/*.d.ts",
|
||||||
"!**/*.js",
|
"!**/*.js",
|
||||||
"!**/*.[0-9].*",
|
"!**/*.[0-9].*",
|
||||||
".angular-cli.json",
|
"angular.json",
|
||||||
"protractor.conf.js"
|
"protractor.conf.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import { MinimalLogger } from './minimal-logger.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-hero-of-the-month',
|
selector: 'app-hero-of-the-month',
|
||||||
templateUrl: './hero-of-the-month.component.html',
|
templateUrl: './hero-of-the-month.component.html',
|
||||||
// Todo: move this aliasing, `useExisting` provider to the AppModule
|
// TODO: move this aliasing, `useExisting` provider to the AppModule
|
||||||
providers: [{ provide: MinimalLogger, useExisting: LoggerService }]
|
providers: [{ provide: MinimalLogger, useExisting: LoggerService }]
|
||||||
})
|
})
|
||||||
export class HeroOfTheMonthComponent {
|
export class HeroOfTheMonthComponent {
|
||||||
|
@ -5,7 +5,7 @@ import { Hero } from './hero';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class HeroService {
|
export class HeroService {
|
||||||
|
|
||||||
// TODO move to database
|
// TODO: move to database
|
||||||
private heroes: Array<Hero> = [
|
private heroes: Array<Hero> = [
|
||||||
new Hero(1, 'RubberMan', 'Hero of many talents', '123-456-7899'),
|
new Hero(1, 'RubberMan', 'Hero of many talents', '123-456-7899'),
|
||||||
new Hero(2, 'Magma', 'Hero of all trades', '555-555-5555'),
|
new Hero(2, 'Magma', 'Hero of all trades', '555-555-5555'),
|
||||||
|
@ -50,7 +50,7 @@ const templateC = `
|
|||||||
})
|
})
|
||||||
// #docregion carol-class
|
// #docregion carol-class
|
||||||
export class CarolComponent {
|
export class CarolComponent {
|
||||||
name= 'Carol';
|
name = 'Carol';
|
||||||
// #docregion carol-ctor
|
// #docregion carol-ctor
|
||||||
constructor( @Optional() public parent: Parent ) { }
|
constructor( @Optional() public parent: Parent ) { }
|
||||||
// #enddocregion carol-ctor
|
// #enddocregion carol-ctor
|
||||||
@ -63,7 +63,7 @@ export class CarolComponent {
|
|||||||
template: templateC
|
template: templateC
|
||||||
})
|
})
|
||||||
export class ChrisComponent {
|
export class ChrisComponent {
|
||||||
name= 'Chris';
|
name = 'Chris';
|
||||||
constructor( @Optional() public parent: Parent ) { }
|
constructor( @Optional() public parent: Parent ) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ export class BarryComponent implements Parent {
|
|||||||
providers: [ provideParent(BobComponent) ]
|
providers: [ provideParent(BobComponent) ]
|
||||||
})
|
})
|
||||||
export class BobComponent implements Parent {
|
export class BobComponent implements Parent {
|
||||||
name= 'Bob';
|
name = 'Bob';
|
||||||
constructor( @SkipSelf() @Optional() public parent: Parent ) { }
|
constructor( @SkipSelf() @Optional() public parent: Parent ) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ export class BobComponent implements Parent {
|
|||||||
// #enddocregion beth-providers
|
// #enddocregion beth-providers
|
||||||
})
|
})
|
||||||
export class BethComponent implements Parent {
|
export class BethComponent implements Parent {
|
||||||
name= 'Beth';
|
name = 'Beth';
|
||||||
constructor( @SkipSelf() @Optional() public parent: Parent ) { }
|
constructor( @SkipSelf() @Optional() public parent: Parent ) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,13 +151,13 @@ export class BethComponent implements Parent {
|
|||||||
// #docregion alex-1
|
// #docregion alex-1
|
||||||
})
|
})
|
||||||
// #enddocregion alex-1
|
// #enddocregion alex-1
|
||||||
// Todo: Add `... implements Parent` to class signature
|
// TODO: Add `... implements Parent` to class signature
|
||||||
// #docregion alex-1
|
// #docregion alex-1
|
||||||
// #docregion alex-class-signature
|
// #docregion alex-class-signature
|
||||||
export class AlexComponent extends Base
|
export class AlexComponent extends Base
|
||||||
// #enddocregion alex-class-signature
|
// #enddocregion alex-class-signature
|
||||||
{
|
{
|
||||||
name= 'Alex';
|
name = 'Alex';
|
||||||
}
|
}
|
||||||
// #enddocregion alex, alex-1
|
// #enddocregion alex, alex-1
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ export class AlexComponent extends Base
|
|||||||
export class AliceComponent implements Parent
|
export class AliceComponent implements Parent
|
||||||
// #enddocregion alice-class-signature
|
// #enddocregion alice-class-signature
|
||||||
{
|
{
|
||||||
name= 'Alice';
|
name = 'Alice';
|
||||||
}
|
}
|
||||||
// #enddocregion alice
|
// #enddocregion alice
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ describe('Dependency Injection Tests', function () {
|
|||||||
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
|
|
||||||
let filteredHeroes = heroes.filter(function(elem: ElementFinder, index: number){
|
let filteredHeroes = heroes.filter(function(elem: ElementFinder, index: number) {
|
||||||
return elem.getText().then(function(text: string) {
|
return elem.getText().then(function(text: string) {
|
||||||
return /secret/.test(text);
|
return /secret/.test(text);
|
||||||
});
|
});
|
@ -7,7 +7,7 @@ export class User {
|
|||||||
public isAuthorized = false) { }
|
public isAuthorized = false) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo: get the user; don't 'new' it.
|
// TODO: get the user; don't 'new' it.
|
||||||
let alice = new User('Alice', true);
|
let alice = new User('Alice', true);
|
||||||
let bob = new User('Bob', false);
|
let bob = new User('Bob', false);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import { AdComponent } from './ad.component';
|
|||||||
// #docregion class
|
// #docregion class
|
||||||
export class AdBannerComponent implements OnInit, OnDestroy {
|
export class AdBannerComponent implements OnInit, OnDestroy {
|
||||||
@Input() ads: AdItem[];
|
@Input() ads: AdItem[];
|
||||||
currentAdIndex: number = -1;
|
currentAdIndex = -1;
|
||||||
@ViewChild(AdDirective) adHost: AdDirective;
|
@ViewChild(AdDirective) adHost: AdDirective;
|
||||||
interval: any;
|
interval: any;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ describe('Dynamic Form', function () {
|
|||||||
element(by.css('select option[value="solid"]')).click();
|
element(by.css('select option[value="solid"]')).click();
|
||||||
|
|
||||||
let saveButton = element.all(by.css('button')).get(0);
|
let saveButton = element.all(by.css('button')).get(0);
|
||||||
saveButton.click().then(function(){
|
saveButton.click().then(function() {
|
||||||
expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
|
expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
@ -1,5 +1,5 @@
|
|||||||
// #docregion
|
// #docregion
|
||||||
export class QuestionBase<T>{
|
export class QuestionBase<T> {
|
||||||
value: T;
|
value: T;
|
||||||
key: string;
|
key: string;
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -8,8 +8,8 @@ import { TextboxQuestion } from './question-textbox';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class QuestionService {
|
export class QuestionService {
|
||||||
|
|
||||||
// Todo: get from a remote source of question metadata
|
// TODO: get from a remote source of question metadata
|
||||||
// Todo: make asynchronous
|
// TODO: make asynchronous
|
||||||
getQuestions() {
|
getQuestions() {
|
||||||
|
|
||||||
let questions: QuestionBase<any>[] = [
|
let questions: QuestionBase<any>[] = [
|
||||||
|
@ -14,7 +14,7 @@ export class UploadInterceptor implements HttpInterceptor {
|
|||||||
if (req.url.indexOf('/upload/file') === -1) {
|
if (req.url.indexOf('/upload/file') === -1) {
|
||||||
return next.handle(req);
|
return next.handle(req);
|
||||||
}
|
}
|
||||||
const delay = 300; // Todo: inject delay?
|
const delay = 300; // TODO: inject delay?
|
||||||
return createUploadEvents(delay);
|
return createUploadEvents(delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ describe('HttpClient testing', () => {
|
|||||||
|
|
||||||
// Create mock ErrorEvent, raised when something goes wrong at the network level.
|
// Create mock ErrorEvent, raised when something goes wrong at the network level.
|
||||||
// Connection timeout, DNS error, offline, etc
|
// Connection timeout, DNS error, offline, etc
|
||||||
const errorEvent = new ErrorEvent('so sad', {
|
const mockError = new ErrorEvent('Network error', {
|
||||||
message: emsg,
|
message: emsg,
|
||||||
// #enddocregion network-error
|
// #enddocregion network-error
|
||||||
// The rest of this is optional and not used.
|
// The rest of this is optional and not used.
|
||||||
@ -162,7 +162,7 @@ describe('HttpClient testing', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Respond with mock error
|
// Respond with mock error
|
||||||
req.error(errorEvent);
|
req.error(mockError);
|
||||||
});
|
});
|
||||||
// #enddocregion network-error
|
// #enddocregion network-error
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export class HeroListComponent implements OnInit {
|
|||||||
getHeroes() {
|
getHeroes() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.heroes = this.heroService.getHeroes()
|
this.heroes = this.heroService.getHeroes()
|
||||||
// Todo: error handling
|
// TODO: error handling
|
||||||
.pipe(finalize(() => this.isLoading = false));
|
.pipe(finalize(() => this.isLoading = false));
|
||||||
this.selectedHero = undefined;
|
this.selectedHero = undefined;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,8 @@ describe('Router', () => {
|
|||||||
await crisisCenterEdit(2, true);
|
await crisisCenterEdit(2, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can cancel changed crisis details', async () => {
|
// TODO: Figure out why this test is failing now
|
||||||
|
xit('can cancel changed crisis details', async () => {
|
||||||
const page = getPageStruct();
|
const page = getPageStruct();
|
||||||
await page.crisisHref.click();
|
await page.crisisHref.click();
|
||||||
await crisisCenterEdit(3, false);
|
await crisisCenterEdit(3, false);
|
@ -1,6 +1,6 @@
|
|||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
// #docregion
|
||||||
// TODO SOMEDAY: Feature Componetized like HeroCenter
|
// TODO: Feature Componetized like HeroCenter
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
// #docregion
|
||||||
// TODO SOMEDAY: Feature Componetized like CrisisCenter
|
// TODO: Feature Componetized like CrisisCenter
|
||||||
// #docregion rxjs-imports
|
// #docregion rxjs-imports
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
|
@ -37,8 +37,8 @@ export class ValueService {
|
|||||||
// #docregion MasterService
|
// #docregion MasterService
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MasterService {
|
export class MasterService {
|
||||||
constructor(private masterService: ValueService) { }
|
constructor(private valueService: ValueService) { }
|
||||||
getValue() { return this.masterService.getValue(); }
|
getValue() { return this.valueService.getValue(); }
|
||||||
}
|
}
|
||||||
// #enddocregion MasterService
|
// #enddocregion MasterService
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ describe ('HeroesService (with spies)', () => {
|
|||||||
let heroService: HeroService;
|
let heroService: HeroService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Todo: spy on other methods too
|
// TODO: spy on other methods too
|
||||||
httpClientSpy = jasmine.createSpyObj('HttpClient', ['get']);
|
httpClientSpy = jasmine.createSpyObj('HttpClient', ['get']);
|
||||||
heroService = new HeroService(<any> httpClientSpy);
|
heroService = new HeroService(<any> httpClientSpy);
|
||||||
});
|
});
|
||||||
|
@ -26,7 +26,7 @@ export class HeroService {
|
|||||||
// #docregion getHeroes, getHeroes-1
|
// #docregion getHeroes, getHeroes-1
|
||||||
getHeroes(): Observable<Hero[]> {
|
getHeroes(): Observable<Hero[]> {
|
||||||
// #enddocregion getHeroes-1
|
// #enddocregion getHeroes-1
|
||||||
// Todo: send the message _after_ fetching the heroes
|
// TODO: send the message _after_ fetching the heroes
|
||||||
this.messageService.add('HeroService: fetched heroes');
|
this.messageService.add('HeroService: fetched heroes');
|
||||||
// #docregion getHeroes-1
|
// #docregion getHeroes-1
|
||||||
return of(HEROES);
|
return of(HEROES);
|
||||||
|
@ -12,14 +12,14 @@ export class HeroService {
|
|||||||
constructor(private messageService: MessageService) { }
|
constructor(private messageService: MessageService) { }
|
||||||
|
|
||||||
getHeroes(): Observable<Hero[]> {
|
getHeroes(): Observable<Hero[]> {
|
||||||
// Todo: send the message _after_ fetching the heroes
|
// TODO: send the message _after_ fetching the heroes
|
||||||
this.messageService.add('HeroService: fetched heroes');
|
this.messageService.add('HeroService: fetched heroes');
|
||||||
return of(HEROES);
|
return of(HEROES);
|
||||||
}
|
}
|
||||||
|
|
||||||
// #docregion getHero
|
// #docregion getHero
|
||||||
getHero(id: number): Observable<Hero> {
|
getHero(id: number): Observable<Hero> {
|
||||||
// Todo: send the message _after_ fetching the hero
|
// TODO: send the message _after_ fetching the hero
|
||||||
this.messageService.add(`HeroService: fetched hero id=${id}`);
|
this.messageService.add(`HeroService: fetched hero id=${id}`);
|
||||||
return of(HEROES.find(hero => hero.id === id));
|
return of(HEROES.find(hero => hero.id === id));
|
||||||
}
|
}
|
||||||
|
@ -44,10 +44,7 @@ class Hero {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(i): temorarily disable these tests because angular-in-memory-web-api is not compatible with rxjs v6 yet
|
describe('Tutorial part 6', () => {
|
||||||
// and we don't have the backwards compatibility package yet.
|
|
||||||
// Reenable after rxjs v6 compatibility package is out or angular-in-memory-web-api is compatible with rxjs v6
|
|
||||||
xdescribe('Tutorial part 6', () => {
|
|
||||||
|
|
||||||
beforeAll(() => browser.get(''));
|
beforeAll(() => browser.get(''));
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"compileOnSave": false,
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "./dist/out-tsc",
|
|
||||||
"sourceMap": true,
|
|
||||||
"declaration": false,
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"target": "es5",
|
|
||||||
"typeRoots": [
|
|
||||||
"node_modules/@types"
|
|
||||||
],
|
|
||||||
"lib": [
|
|
||||||
"es2017",
|
|
||||||
"dom"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -36,10 +36,6 @@
|
|||||||
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
|
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
|
||||||
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
|
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
|
||||||
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' },
|
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' },
|
||||||
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' },
|
|
||||||
'rxjs': { main: 'index.js', defaultExtension: 'js' },
|
'rxjs': { main: 'index.js', defaultExtension: 'js' },
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1256,7 +1256,7 @@ also encapsulate a style sheet within a specific component.
|
|||||||
### Styles configuration
|
### Styles configuration
|
||||||
<code-example hideCopy path="ajs-quick-reference/.angular-cli.1.json" region="styles" linenums="false"></code-example>
|
<code-example hideCopy path="ajs-quick-reference/.angular-cli.1.json" region="styles" linenums="false"></code-example>
|
||||||
|
|
||||||
With the Angular CLI, you can configure your global styles in the `.angular-cli.json` file.
|
With the Angular CLI, you can configure your global styles in the `angular.json` file.
|
||||||
You can rename the extension to `.scss` to use sass.
|
You can rename the extension to `.scss` to use sass.
|
||||||
|
|
||||||
### StyleUrls
|
### StyleUrls
|
||||||
|
@ -103,7 +103,7 @@ You can control your app compilation by providing template compiler options in t
|
|||||||
This option tells the compiler not to produce `.metadata.json` files.
|
This option tells the compiler not to produce `.metadata.json` files.
|
||||||
The option is `false` by default.
|
The option is `false` by default.
|
||||||
|
|
||||||
`.metadata.json` files contain infomration needed by the template compiler from a `.ts`
|
`.metadata.json` files contain information needed by the template compiler from a `.ts`
|
||||||
file that is not included in the `.d.ts` file produced by the TypeScript compiler. This information contains,
|
file that is not included in the `.d.ts` file produced by the TypeScript compiler. This information contains,
|
||||||
for example, the content of annotations (such as a component's template) which TypeScript
|
for example, the content of annotations (such as a component's template) which TypeScript
|
||||||
emits to the `.js` file but not to the `.d.ts` file.
|
emits to the `.js` file but not to the `.d.ts` file.
|
||||||
@ -987,7 +987,7 @@ import { configuration } from './configuration';
|
|||||||
The compiler encountered a type and can't determine which module exports that type.
|
The compiler encountered a type and can't determine which module exports that type.
|
||||||
|
|
||||||
This can happen if you refer to an ambient type.
|
This can happen if you refer to an ambient type.
|
||||||
For example, the `Window` type is an ambiant type declared in the global `.d.ts` file.
|
For example, the `Window` type is an ambient type declared in the global `.d.ts` file.
|
||||||
|
|
||||||
You'll get an error if you reference it in the component constructor,
|
You'll get an error if you reference it in the component constructor,
|
||||||
which the compiler must statically analyze.
|
which the compiler must statically analyze.
|
||||||
@ -999,17 +999,17 @@ export class MyComponent {
|
|||||||
constructor (private win: Window) { ... }
|
constructor (private win: Window) { ... }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
TypeScript understands ambiant types so you don't import them.
|
TypeScript understands ambient types so you don't import them.
|
||||||
The Angular compiler does not understand a type that you neglect to export or import.
|
The Angular compiler does not understand a type that you neglect to export or import.
|
||||||
|
|
||||||
In this case, the compiler doesn't understand how to inject something with the `Window` token.
|
In this case, the compiler doesn't understand how to inject something with the `Window` token.
|
||||||
|
|
||||||
Do not refer to ambient types in metadata expressions.
|
Do not refer to ambient types in metadata expressions.
|
||||||
|
|
||||||
If you must inject an instance of an ambiant type,
|
If you must inject an instance of an ambient type,
|
||||||
you can finesse the problem in four steps:
|
you can finesse the problem in four steps:
|
||||||
|
|
||||||
1. Create an injection token for an instance of the ambiant type.
|
1. Create an injection token for an instance of the ambient type.
|
||||||
1. Create a factory function that returns that instance.
|
1. Create a factory function that returns that instance.
|
||||||
1. Add a `useFactory` provider with that factory function.
|
1. Add a `useFactory` provider with that factory function.
|
||||||
1. Use `@Inject` to inject the instance.
|
1. Use `@Inject` to inject the instance.
|
||||||
|
@ -22,7 +22,7 @@ Angular creates, updates, and destroys components as the user moves through the
|
|||||||
|
|
||||||
<img src="generated/images/guide/architecture/metadata.png" alt="Metadata" class="left">
|
<img src="generated/images/guide/architecture/metadata.png" alt="Metadata" class="left">
|
||||||
|
|
||||||
The `@Component` decorator identifies the class immediately below it as a component class, and specifies its metadata. In the example code below, you can see that `HeroListComponent` is just a class, with no special Angular notation or syntax at all. It's not a component until mark it as one with the `@Component` decorator.
|
The `@Component` decorator identifies the class immediately below it as a component class, and specifies its metadata. In the example code below, you can see that `HeroListComponent` is just a class, with no special Angular notation or syntax at all. It's not a component until you mark it as one with the `@Component` decorator.
|
||||||
|
|
||||||
The metadata for a component tells Angular where to get the major building blocks it needs to create and present the component and its view. In particular, it associates a _template_ with the component, either directly with inline code, or by reference. Together, the component and its template describe a _view_.
|
The metadata for a component tells Angular where to get the major building blocks it needs to create and present the component and its view. In particular, it associates a _template_ with the component, either directly with inline code, or by reference. Together, the component and its template describe a _view_.
|
||||||
|
|
||||||
|
@ -177,4 +177,4 @@ root module's `bootstrap` array.
|
|||||||
## More about Angular Modules
|
## More about Angular Modules
|
||||||
|
|
||||||
For more on NgModules you're likely to see frequently in apps,
|
For more on NgModules you're likely to see frequently in apps,
|
||||||
see [Frequently Used Modules](#).
|
see [Frequently Used Modules](guide/frequent-ngmodules).
|
||||||
|
@ -311,11 +311,11 @@ so the <code>@Directive</code> configuration applies to components as well</p>
|
|||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterViewInit()</b> { ... }</code></td>
|
<td><code><b>ngAfterViewInit()</b> { ... }</code></td>
|
||||||
<td><p>Called after <code>ngAfterContentInit</code> when the component's view has been initialized. Applies to components only.</p>
|
<td><p>Called after <code>ngAfterContentInit</code> when the component's views and child views / the view that a directive is in has been initialized.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngAfterViewChecked()</b> { ... }</code></td>
|
<td><code><b>ngAfterViewChecked()</b> { ... }</code></td>
|
||||||
<td><p>Called after every check of the component's view. Applies to components only.</p>
|
<td><p>Called after every check of the component's views and child views / the view that a directive is in.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><code><b>ngOnDestroy()</b> { ... }</code></td>
|
<td><code><b>ngOnDestroy()</b> { ... }</code></td>
|
||||||
|
@ -249,7 +249,7 @@ An observable produces values over time. An array is created as a static set of
|
|||||||
<pre>➞5</pre>
|
<pre>➞5</pre>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre>arr.find((v) => v>10)</pre>
|
<pre>arr.find((v) => v>3)</pre>
|
||||||
<pre>5</pre>
|
<pre>5</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -273,8 +273,8 @@ An observable produces values over time. An array is created as a static set of
|
|||||||
1
|
1
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
4
|
5
|
||||||
5</pre>
|
7</pre>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre>arr.forEach((v) => {
|
<pre>arr.forEach((v) => {
|
||||||
@ -283,8 +283,8 @@ An observable produces values over time. An array is created as a static set of
|
|||||||
1
|
1
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
4
|
5
|
||||||
5</pre>
|
7</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -61,7 +61,7 @@ The running application displays three heroes:
|
|||||||
E2E test that all children were instantiated and displayed as expected:
|
E2E test that all children were instantiated and displayed as expected:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="parent-to-child" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="parent-to-child" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Here's the `NameParentComponent` demonstrating name variations including a name
|
|||||||
E2E tests of input property setter with empty and non-empty names:
|
E2E tests of input property setter with empty and non-empty names:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="parent-to-child-setter" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="parent-to-child-setter" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ Test that ***both*** input properties are set initially and that button clicks t
|
|||||||
the expected `ngOnChanges` calls and values:
|
the expected `ngOnChanges` calls and values:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="parent-to-child-onchanges" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="parent-to-child-onchanges" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ and the method processes it:
|
|||||||
Test that clicking the *Agree* and *Disagree* buttons update the appropriate counters:
|
Test that clicking the *Agree* and *Disagree* buttons update the appropriate counters:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="child-to-parent" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="child-to-parent" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ match the seconds displayed in the child's status message.
|
|||||||
Test also that clicking the *Stop* button pauses the countdown timer:
|
Test also that clicking the *Stop* button pauses the countdown timer:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="countdown-timer-tests" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="countdown-timer-tests" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ Tests click buttons of both the parent `MissionControlComponent` and the `Astron
|
|||||||
and verify that the history meets expectations:
|
and verify that the history meets expectations:
|
||||||
|
|
||||||
|
|
||||||
<code-example path="component-interaction/e2e/app.e2e-spec.ts" region="bidirectional-service" title="component-interaction/e2e/app.e2e-spec.ts">
|
<code-example path="component-interaction/e2e/src/app.e2e-spec.ts" region="bidirectional-service" title="component-interaction/e2e/src/app.e2e-spec.ts">
|
||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ In this case, the URL is relative to the CSS file into which you're importing.
|
|||||||
|
|
||||||
### External and global style files
|
### External and global style files
|
||||||
|
|
||||||
When building with the CLI, you must configure the `.angular-cli.json` to include _all external assets_, including external style files.
|
When building with the CLI, you must configure the `angular.json` to include _all external assets_, including external style files.
|
||||||
|
|
||||||
Register **global** style files in the `styles` section which, by default, is pre-configured with the global `styles.css` file.
|
Register **global** style files in the `styles` section which, by default, is pre-configured with the global `styles.css` file.
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ It serves build artifacts from memory instead for a faster development experienc
|
|||||||
<div class="l-sub-section">
|
<div class="l-sub-section">
|
||||||
|
|
||||||
The output folder is `dist/` by default.
|
The output folder is `dist/` by default.
|
||||||
To output to a different folder, change the `outDir` in `.angular-cli.json`.
|
To output to a different folder, change the `outputPath` in `angular.json`.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
# Angular Elements Overview
|
# Angular Elements Overview
|
||||||
|
|
||||||
|
Angular Elements are Angular components packaged as custom elements, a web standard for defining new html elements in a framework-agnostic way.
|
||||||
|
|
||||||
[Custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) are a Web Platform feature currently supported by Chrome, Opera, and Safari, and available in other browsers through polyfills (see [Browser Support](#browser-support)).
|
[Custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) are a Web Platform feature currently supported by Chrome, Opera, and Safari, and available in other browsers through polyfills (see [Browser Support](#browser-support)).
|
||||||
A custom element extends HTML by allowing you to define a tag whose content is created and controlled by JavaScript code.
|
A custom element extends HTML by allowing you to define a tag whose content is created and controlled by JavaScript code.
|
||||||
The browser maintains a `CustomElementRegistry` of defined custom elements (also called Web Components), which maps an instantiable JavaScript class to an HTML tag.
|
The browser maintains a `CustomElementRegistry` of defined custom elements (also called Web Components), which maps an instantiable JavaScript class to an HTML tag.
|
||||||
@ -109,12 +111,14 @@ The recently-developed [custom elements](https://developer.mozilla.org/en-US/doc
|
|||||||
<tr>
|
<tr>
|
||||||
<td>Edge</td>
|
<td>Edge</td>
|
||||||
<td>Working on an implementation. <br>
|
<td>Working on an implementation. <br>
|
||||||
Use the <a href="https://cli.angular.io/" target="_blanks">CLI</a> to automatically set up your project with the correct polyfill: <code>ng add @angular/elements</code>.
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
In browsers that support Custom Elements natively, the specification requires developers use ES2015 classes to define Custom Elements - developers can opt-in to this by setting the `target: "es2015"` property in their project's `tsconfig.json`. As Custom Element and ES2015 support may not be available in all browsers, developers can instead choose to use a polyfill to support older browsers and ES5 code.
|
||||||
|
|
||||||
|
Use the [Angular CLI](https://cli.angular.io/) to automatically set up your project with the correct polyfill: `ng add @angular/elements --name=*your_project_name*`.
|
||||||
- For more information about polyfills, see [polyfill documentation](https://www.webcomponents.org/polyfills).
|
- For more information about polyfills, see [polyfill documentation](https://www.webcomponents.org/polyfills).
|
||||||
|
|
||||||
- For more information about Angular browser support, see [Browser Support](guide/browser-support).
|
- For more information about Angular browser support, see [Browser Support](guide/browser-support).
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Angular Glossary
|
# Angular Glossary
|
||||||
|
|
||||||
Angular has its own vocabulary.
|
Angular has its own vocabulary.
|
||||||
Most Angular terms are common English words
|
Most Angular terms are common English words or computing terms
|
||||||
with a specific meaning within the Angular system.
|
that have a specific meaning within the Angular system.
|
||||||
|
|
||||||
This glossary lists the most prominent terms
|
This glossary lists the most prominent terms
|
||||||
and a few less familiar ones that have unusual or
|
and a few less familiar ones that have unusual or
|
||||||
@ -19,14 +19,19 @@ unexpected definitions.
|
|||||||
|
|
||||||
## Ahead-of-time (AOT) compilation
|
## Ahead-of-time (AOT) compilation
|
||||||
|
|
||||||
You can compile Angular applications at build time.
|
The Angular ahead-of-time (AOT) compiler converts your Angular HTML and TypeScript code
|
||||||
By compiling your application using the compiler-cli, `ngc`, you can bootstrap directly to a module factory, meaning you don't need to include the Angular compiler in your JavaScript bundle.
|
into efficient JavaScript code during the build phase before the browser downloads
|
||||||
Ahead-of-time compiled applications also benefit from decreased load time and increased performance.
|
and runs that code.
|
||||||
|
This is the best compilation mode for production environments, with decreased load time and increased performance.
|
||||||
|
|
||||||
|
By compiling your application using the `ngc` command-line tool, you can bootstrap directly to a module factory, meaning you don't need to include the Angular compiler in your JavaScript bundle.
|
||||||
|
|
||||||
|
Compare [just-in-time (JIT) compilation](guide/glossary#jit).
|
||||||
|
|
||||||
|
|
||||||
## Annotation
|
## Annotation
|
||||||
|
|
||||||
In practice, a synonym for [Decoration](guide/glossary#decorator).
|
A structure that provides metadata for a class. See [Decorator](guide/glossary#decorator).
|
||||||
|
|
||||||
|
|
||||||
{@a attribute-directive}
|
{@a attribute-directive}
|
||||||
@ -41,107 +46,72 @@ A category of [directive](guide/glossary#directive) that can listen to and modif
|
|||||||
other HTML elements, attributes, properties, and components. They are usually represented
|
other HTML elements, attributes, properties, and components. They are usually represented
|
||||||
as HTML attributes, hence the name.
|
as HTML attributes, hence the name.
|
||||||
|
|
||||||
For example, you can use the `ngClass` directive to add and remove CSS class names.
|
Learn more in the [_Attribute Directives_](guide/attribute-directives) guide.
|
||||||
|
|
||||||
Learn about them in the [_Attribute Directives_](guide/attribute-directives) guide.
|
|
||||||
|
|
||||||
|
|
||||||
{@a B}
|
{@a B}
|
||||||
|
|
||||||
## Barrel
|
|
||||||
|
|
||||||
A way to *roll up exports* from several ES2015 modules into a single convenient ES2015 module.
|
|
||||||
The barrel itself is an ES2015 module file that re-exports selected exports of other ES2015 modules.
|
|
||||||
|
|
||||||
For example, imagine three ES2015 modules in a `heroes` folder:
|
|
||||||
|
|
||||||
<code-example>
|
|
||||||
// heroes/hero.component.ts
|
|
||||||
export class HeroComponent {}
|
|
||||||
|
|
||||||
// heroes/hero.model.ts
|
|
||||||
export class Hero {}
|
|
||||||
|
|
||||||
// heroes/hero.service.ts
|
|
||||||
export class HeroService {}
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
Without a barrel, a consumer needs three import statements:
|
|
||||||
|
|
||||||
<code-example>
|
|
||||||
import { HeroComponent } from '../heroes/hero.component.ts';
|
|
||||||
import { Hero } from '../heroes/hero.model.ts';
|
|
||||||
import { HeroService } from '../heroes/hero.service.ts';
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
You can add a barrel to the `heroes` folder (called `index`, by convention) that exports all of these items:
|
|
||||||
|
|
||||||
<code-example>
|
|
||||||
export * from './hero.model.ts'; // re-export all of its exports
|
|
||||||
export * from './hero.service.ts'; // re-export all of its exports
|
|
||||||
export { HeroComponent } from './hero.component.ts'; // re-export the named thing
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Now a consumer can import what it needs from the barrel.
|
|
||||||
|
|
||||||
<code-example>
|
|
||||||
import { Hero, HeroService } from '../heroes'; // index is implied
|
|
||||||
</code-example>
|
|
||||||
|
|
||||||
|
|
||||||
The Angular [scoped packages](guide/glossary#scoped-package) each have a barrel named `index`.
|
|
||||||
|
|
||||||
<div class="alert is-important">
|
|
||||||
|
|
||||||
You can often achieve the same result using [NgModules](guide/glossary#ngmodule) instead.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Binding
|
## Binding
|
||||||
|
|
||||||
Usually refers to [data binding](guide/glossary#data-binding) and the act of
|
Generally, the practice of setting a variable or property to a data value.
|
||||||
binding an HTML object property to a data object property.
|
Within Angular, typically refers to [data binding](guide/glossary#data-binding),
|
||||||
|
which coordinates DOM object properties with data object properties.
|
||||||
|
|
||||||
Sometimes refers to a [dependency-injection](guide/glossary#dependency-injection) binding
|
Sometimes refers to a [dependency-injection](guide/glossary#dependency-injection) binding
|
||||||
between a "token"—also referred to as a "key"—and a dependency [provider](guide/glossary#provider).
|
between a [token](guide/glossary#token) and a dependency [provider](guide/glossary#provider).
|
||||||
|
|
||||||
|
|
||||||
## Bootstrap
|
## Bootstrap
|
||||||
|
|
||||||
You launch an Angular application by "bootstrapping" it using the application root NgModule (`AppModule`).
|
A way to initialize and launch an app or system.
|
||||||
|
|
||||||
Bootstrapping identifies an application's top level "root" [component](guide/glossary#component),
|
In Angular, an app's root NgModule (`AppModule`) has a `bootstrap` property that identifies the app's top-level [components](guide/glossary#component).
|
||||||
which is the first component that is loaded for the application.
|
During the bootstrap process, Angular creates and inserts these components into the `index.html` host web page.
|
||||||
|
You can bootstrap multiple apps in the same `index.html`, each app with its own components.
|
||||||
You can bootstrap multiple apps in the same `index.html`, each app with its own top-level root.
|
|
||||||
|
|
||||||
|
Learn more in the [_Bootstrapping_](guide/bootstrapping) guide.
|
||||||
|
|
||||||
{@a C}
|
{@a C}
|
||||||
|
|
||||||
|
{@a case-conventions}
|
||||||
{@a dash-case}
|
{@a dash-case}
|
||||||
|
|
||||||
{@a camelcase}
|
{@a camelcase}
|
||||||
|
{@a kebab-case}
|
||||||
|
|
||||||
## Case conventions
|
## Case conventions
|
||||||
|
|
||||||
Angular uses capitalization conventions to distinguish the names of various types, as described in the [Style Guide "Naming" section](guide/styleguide#02-01).
|
Angular uses capitalization conventions to distinguish the names of various types, as described in the [Style Guide "Naming" section](guide/styleguide#02-01).
|
||||||
|
|
||||||
- camelCase : symbols, properties, methods, pipe names, interfaces, non-component directive selectors, constants
|
- camelCase : symbols, properties, methods, pipe names, non-component directive selectors, constants
|
||||||
- UpperCamelCase (also called PascalCase): Class names
|
- UpperCamelCase (or PascalCase): Class names, including classes that define components, interfaces, NgModules, directives, pipes, and so on.
|
||||||
- dash-case (also called "kebab-case"): descriptive part of file names, component selectors
|
- dash-case (or "kebab-case"): descriptive part of file names, component selectors
|
||||||
- underscore_case (or "snake_case"): not typically used in Angular
|
- underscore_case (or "snake_case"): not typically used in Angular
|
||||||
- UPPER_SNAKE_CASE : traditional for constants (acceptable, but prefer camelCase)
|
- UPPER_UNDERSCORE_CASE (or UPPER_SNAKE_CASE): traditional for constants (acceptable, but prefer camelCase)
|
||||||
|
|
||||||
|
{@a class-decorator}
|
||||||
|
|
||||||
|
## Class decorator
|
||||||
|
|
||||||
|
A [decorator](guide/glossary#decorator) statement immediately before a class definition that declares the class to be of the given type, and provides metadata suitable to the type.
|
||||||
|
|
||||||
|
The following class types can be declared:
|
||||||
|
- `@Component`
|
||||||
|
- `@Directive`
|
||||||
|
- `@Pipe`
|
||||||
|
- `@Injectable`
|
||||||
|
- `@NgModule`
|
||||||
|
|
||||||
|
|
||||||
|
{@a class-field-decorator}
|
||||||
|
|
||||||
|
## Class field decorator
|
||||||
|
|
||||||
|
A [decorator](guide/glossary#decorator) statement immediately before a field in a class definition that declares the type of that field. Some examples are `@Input` and `@Output`.
|
||||||
|
|
||||||
## CLI
|
## CLI
|
||||||
|
|
||||||
The Angular CLI is a `command line interface` tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
The [Angular CLI](https://cli.angular.io/) is a command-line tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
|
||||||
|
|
||||||
Learn more in the [Getting Started](guide/quickstart) guide.
|
Learn more in the [Getting Started](guide/quickstart) guide.
|
||||||
|
|
||||||
@ -149,18 +119,13 @@ Learn more in the [Getting Started](guide/quickstart) guide.
|
|||||||
|
|
||||||
## Component
|
## Component
|
||||||
|
|
||||||
An Angular class responsible for exposing data to a [view](guide/glossary#view) and handling most of the view’s display and user-interaction logic.
|
A class with the `@Component` [decorator](guide/glossary#decorator) that associates it with a companion [template](guide/glossary#template).
|
||||||
|
|
||||||
The *component* is one of the most important building blocks in the Angular system.
|
A component is a special type of [directive](guide/glossary#directive) that represents a [view](guide/glossary#view).The `@Component` decorator extends the `@Directive` decorator with template-oriented features.
|
||||||
It is, in fact, an Angular [directive](guide/glossary#directive) with a companion [template](guide/glossary#template).
|
|
||||||
|
|
||||||
Apply the `@Component` [decorator](guide/glossary#decorator) to
|
An Angular component class is responsible for exposing data and handling most of the view's display and user-interaction logic through [data binding](guide/glossary#data-binding).
|
||||||
the component class, thereby attaching to the class the essential component metadata
|
|
||||||
that Angular needs to create a component instance and render the component with its template
|
|
||||||
as a view.
|
|
||||||
|
|
||||||
Those familiar with "MVC" and "MVVM" patterns will recognize
|
Read more about components, templates, and views in the [Architecture](guide/architecture) guide.
|
||||||
the component in the role of "controller" or "view model".
|
|
||||||
|
|
||||||
{@a custom-element}
|
{@a custom-element}
|
||||||
|
|
||||||
@ -189,10 +154,7 @@ Data binding is an alternative to manually pushing application data values into
|
|||||||
event listeners, pulling changed values from the screen, and
|
event listeners, pulling changed values from the screen, and
|
||||||
updating application data values.
|
updating application data values.
|
||||||
|
|
||||||
Angular has a rich data-binding framework with a variety of data-binding
|
Read about the following forms of binding in the [Template Syntax](guide/template-syntax) page:
|
||||||
operations and supporting declaration syntax.
|
|
||||||
|
|
||||||
Read about the following forms of binding in the [Template Syntax](guide/template-syntax) page:
|
|
||||||
|
|
||||||
* [Interpolation](guide/template-syntax#interpolation).
|
* [Interpolation](guide/template-syntax#interpolation).
|
||||||
* [Property binding](guide/template-syntax#property-binding).
|
* [Property binding](guide/template-syntax#property-binding).
|
||||||
@ -202,99 +164,54 @@ operations and supporting declaration syntax.
|
|||||||
* [Style binding](guide/template-syntax#style-binding).
|
* [Style binding](guide/template-syntax#style-binding).
|
||||||
* [Two-way data binding with ngModel](guide/template-syntax#ngModel).
|
* [Two-way data binding with ngModel](guide/template-syntax#ngModel).
|
||||||
|
|
||||||
|
{@a declarable}
|
||||||
|
|
||||||
|
## Declarable
|
||||||
|
|
||||||
|
A class type that you can add to the `declarations` list of an [NgModule](guide/glossary#ngmodule).
|
||||||
|
|
||||||
|
You can declare [components](guide/glossary#component), [directives](guide/glossary#directive), and [pipes](guide/glossary#pipe).
|
||||||
|
|
||||||
|
Do not declare the following:
|
||||||
|
- A class that's already declared in another NgModule.
|
||||||
|
- An array of directives imported from another package. For example, don't declare `FORMS_DIRECTIVES` from `@angular/forms`.
|
||||||
|
- NgModule classes.
|
||||||
|
- Service classes.
|
||||||
|
- Non-Angular classes and objects, such as strings, numbers, functions, entity models, configurations, business logic, and helper classes
|
||||||
|
|
||||||
|
|
||||||
{@a decorator}
|
{@a decorator}
|
||||||
|
|
||||||
|
|
||||||
{@a decoration}
|
{@a decoration}
|
||||||
|
|
||||||
|
|
||||||
## Decorator | decoration
|
## Decorator | decoration
|
||||||
|
|
||||||
A *function* that adds metadata to a class, its members (properties, methods) and function arguments.
|
|
||||||
|
|
||||||
Decorators (also called annotations) are an experimental (stage 2), JavaScript language [feature](https://github.com/wycats/javascript-decorators). TypeScript adds support for decorators.
|
A function that modifies the immediately following class or property definition.
|
||||||
|
Decorators (also called annotations) are an experimental (stage 2), JavaScript language [feature](https://github.com/wycats/javascript-decorators).
|
||||||
|
TypeScript adds support for decorators.
|
||||||
|
|
||||||
To apply a decorator, position it immediately above or to the left of the item it decorates.
|
Angular defines decorators that attach metadata to classes or properties so that it knows what those classes or properties mean and how they should work.
|
||||||
|
|
||||||
Angular has its own set of decorators to help it interoperate with your application parts.
|
See [Class decorator](guide/glossary#class-decorator), [Class field decorator](guide/glossary#class-field-decorator).
|
||||||
The following example is a `@Component` decorator that identifies a
|
|
||||||
class as an Angular [component](guide/glossary#component) and an `@Input` decorator applied to the `name` property
|
|
||||||
of that component. The elided object argument to the `@Component` decorator would contain the pertinent component metadata.
|
|
||||||
|
|
||||||
```
|
{@a di}
|
||||||
@Component({...})
|
|
||||||
export class AppComponent {
|
|
||||||
constructor(@Inject('SpecialFoo') public foo:Foo) {}
|
|
||||||
@Input() name:string;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The scope of a decorator is limited to the language feature
|
|
||||||
that it decorates. None of the decorations shown here will "leak" to other
|
|
||||||
classes that follow it in the file.
|
|
||||||
|
|
||||||
|
|
||||||
<div class="alert is-important">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Always include parentheses `()` when applying a decorator.
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
## Dependency injection
|
## Dependency injection
|
||||||
|
|
||||||
A design pattern and mechanism
|
A design pattern and mechanism for creating and delivering parts of an application (dependencies) to other parts of an application that require them.
|
||||||
for creating and delivering parts of an application to other
|
|
||||||
parts of an application that request them.
|
|
||||||
|
|
||||||
Angular developers prefer to build applications by defining many simple parts
|
In Angular, dependencies are typically services, but can also be values, such as strings or functions. An [injector](guide/glossary#injector) for an app (created automatically during bootstrap) creates dependencies when needed, using a registered [provider](guide/glossary#provider) of the service or value. Different providers can provide different implementations of the same service.
|
||||||
that each do one thing well and then wiring them together at runtime.
|
|
||||||
|
|
||||||
These parts often rely on other parts. An Angular [component](guide/glossary#component)
|
Learn more in the [Dependency Injection](guide/dependency-injection) guide.
|
||||||
part might rely on a service part to get data or perform a calculation. When
|
|
||||||
part "A" relies on another part "B," you say that "A" depends on "B" and
|
|
||||||
that "B" is a dependency of "A."
|
|
||||||
|
|
||||||
You can ask a "dependency injection system" to create "A"
|
{@a di-token}
|
||||||
for us and handle all the dependencies.
|
|
||||||
If "A" needs "B" and "B" needs "C," the system resolves that chain of dependencies
|
|
||||||
and returns a fully prepared instance of "A."
|
|
||||||
|
|
||||||
|
## DI token
|
||||||
|
|
||||||
Angular provides and relies upon its own sophisticated
|
A lookup token associated with a dependency [provider](guide/glossary#provider), for use with the [dependency injection](guide/glossary#di) system.
|
||||||
dependency-injection system
|
|
||||||
to assemble and run applications by "injecting" application parts
|
|
||||||
into other application parts where and when needed.
|
|
||||||
|
|
||||||
At the core, an [`injector`](guide/glossary#injector) returns dependency values on request.
|
|
||||||
The expression `injector.get(token)` returns the value associated with the given token.
|
|
||||||
|
|
||||||
A token is an Angular type (`InjectionToken`). You rarely need to work with tokens directly; most
|
|
||||||
methods accept a class name (`Foo`) or a string ("foo") and Angular converts it
|
|
||||||
to a token. When you write `injector.get(Foo)`, the injector returns
|
|
||||||
the value associated with the token for the `Foo` class, typically an instance of `Foo` itself.
|
|
||||||
|
|
||||||
During many of its operations, Angular makes similar requests internally, such as when it creates a [`component`](guide/glossary#component) for display.
|
|
||||||
|
|
||||||
The `Injector` maintains an internal map of tokens to dependency values.
|
|
||||||
If the `Injector` can't find a value for a given token, it creates
|
|
||||||
a new value using a `Provider` for that token.
|
|
||||||
|
|
||||||
A [provider](guide/glossary#provider) is a recipe for
|
|
||||||
creating new instances of a dependency value associated with a particular token.
|
|
||||||
|
|
||||||
An injector can only create a value for a given token if it has
|
|
||||||
a `provider` for that token in its internal provider registry.
|
|
||||||
Registering providers is a critical preparatory step.
|
|
||||||
|
|
||||||
Angular registers some of its own providers with every injector.
|
|
||||||
You can register your own providers.
|
|
||||||
|
|
||||||
Read more in the [Dependency Injection](guide/dependency-injection) page.
|
|
||||||
|
|
||||||
|
|
||||||
{@a directive}
|
{@a directive}
|
||||||
@ -305,34 +222,25 @@ Read more in the [Dependency Injection](guide/dependency-injection) page.
|
|||||||
|
|
||||||
## Directive
|
## Directive
|
||||||
|
|
||||||
An Angular class responsible for creating, reshaping, and interacting with HTML elements
|
A class with the `@Directive` [decorator](guide/glossary#decorator) that can modify the structure of the DOM, or modify attributes in the DOM and component data model.
|
||||||
in the browser DOM. The directive is Angular's most fundamental feature.
|
|
||||||
|
|
||||||
A directive is usually associated with an HTML element or attribute.
|
A directive class is usually associated with an HTML element or attribute, and that element or attribute is often referred to as the directive itself.
|
||||||
This element or attribute is often referred to as the directive itself.
|
When Angular finds a directive in an HTML [template](guide/glossary#template), it creates the matching directive class instance and gives the instance control over that portion of the browser DOM.
|
||||||
|
|
||||||
When Angular finds a directive in an HTML template,
|
There are three categories of directive:
|
||||||
it creates the matching directive class instance
|
- [Components](guide/glossary#component) use `@Component` (an extension of `@Directive`) to associate a template with a class.
|
||||||
and gives the instance control over that portion of the browser DOM.
|
- [Attribute directives](guide/glossary#attribute-directive) modify behavior and appearance of page elements.
|
||||||
|
- [Structural directives](guide/glossary#structural-directive) modify the structure of the DOM.
|
||||||
|
|
||||||
You can invent custom HTML markup (for example, `<my-directive>`) to
|
Angular supplies a number of built-in directives that begin with the `ng` prefix. You can also create new directives to implement your own functionality.
|
||||||
associate with your custom directives. You add this custom markup to HTML templates
|
You associate a _selector_ (an HTML tag such as `<my-directive>`) with a custom directive, thereby extending the [template syntax](guide/template-syntax) that you can use in your apps.
|
||||||
as if you were writing native HTML. In this way, directives become extensions of
|
|
||||||
HTML itself.
|
|
||||||
|
|
||||||
Directives fall into one of the following categories:
|
|
||||||
|
|
||||||
* [Components](guide/glossary#component) combine application logic with an HTML template to
|
## Domain-specific language (DSL)
|
||||||
render application [views](guide/glossary#view). Components are usually represented as HTML elements.
|
|
||||||
They are the building blocks of an Angular application.
|
|
||||||
|
|
||||||
* [Attribute directives](guide/glossary#attribute-directive) can listen to and modify the behavior of
|
A special-purpose library or API; see [Domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language).
|
||||||
other HTML elements, attributes, properties, and components. They are usually represented
|
|
||||||
as HTML attributes, hence the name.
|
|
||||||
|
|
||||||
* [Structural directives](guide/glossary#structural-directive) are responsible for
|
Angular extends TypeScript with domain-specific languages for a number of domains relevant to Angular apps, defined in ngModules such as [animations](guide/animations), [forms](guide/forms), and [routing and navigation](guide/router).
|
||||||
shaping or reshaping HTML layout, typically by adding, removing, or manipulating
|
|
||||||
elements and their children.
|
|
||||||
|
|
||||||
{@a dynamic-components}
|
{@a dynamic-components}
|
||||||
|
|
||||||
@ -350,7 +258,9 @@ See also [Custom element](guide/glossary#custom-element), which provides an easi
|
|||||||
|
|
||||||
The [official JavaScript language specification](https://en.wikipedia.org/wiki/ECMAScript).
|
The [official JavaScript language specification](https://en.wikipedia.org/wiki/ECMAScript).
|
||||||
|
|
||||||
Not all browsers support the latest ECMAScript standard, but you can use transpilers (like [TypeScript](guide/glossary#typescript)) to write code using the latest features, which will then be transpiled to code that runs on versions that are supported by browsers.
|
Not all browsers support the latest ECMAScript standard, but you can use a [transpiler](guide/glossary#transpile) (like [TypeScript](guide/glossary#typescript)) to write code using the latest features, which will then be transpiled to code that runs on versions that are supported by browsers.
|
||||||
|
|
||||||
|
To learn more, see the [Browser Support](guide/browser-support) page.
|
||||||
|
|
||||||
|
|
||||||
{@a element}
|
{@a element}
|
||||||
@ -363,6 +273,13 @@ The documentation generally refers to either elements (`ElementRef` instances) o
|
|||||||
|
|
||||||
Compare [Custom element](guide/glossary#custom-element).
|
Compare [Custom element](guide/glossary#custom-element).
|
||||||
|
|
||||||
|
## Entry point
|
||||||
|
|
||||||
|
A JavaScript ID that makes parts of an NPM package available for import by other code.
|
||||||
|
The Angular [scoped packages](guide/glossary#scoped-package) each have an entry point named `index`.
|
||||||
|
|
||||||
|
Within Angular, use [NgModules](guide/glossary#ngmodule) to achieve the same result.
|
||||||
|
|
||||||
|
|
||||||
{@a F}
|
{@a F}
|
||||||
|
|
||||||
@ -374,6 +291,16 @@ Compare [Custom element](guide/glossary#custom-element).
|
|||||||
|
|
||||||
{@a I}
|
{@a I}
|
||||||
|
|
||||||
|
{@a injectable}
|
||||||
|
|
||||||
|
## Injectable
|
||||||
|
|
||||||
|
An Angular class or other definition that provides a dependency using the [dependency injection](guide/glossary#di) mechanism. An injectable class is marked by the `@Injectable` [decorator](guide/glossary#decorator).
|
||||||
|
|
||||||
|
Both a [service](guide/glossary#service) and a [component](guide/glossary#component) that depends on that service must be marked as injectable. Other items, such as constant values, can be injectable.
|
||||||
|
|
||||||
|
{@a injector}
|
||||||
|
|
||||||
## Injector
|
## Injector
|
||||||
|
|
||||||
An object in the Angular [dependency-injection system](guide/glossary#dependency-injection)
|
An object in the Angular [dependency-injection system](guide/glossary#dependency-injection)
|
||||||
@ -383,19 +310,19 @@ with a registered [provider](guide/glossary#provider). Injectors are created for
|
|||||||
|
|
||||||
## Input
|
## Input
|
||||||
|
|
||||||
A directive property that can be the *target* of a
|
When defining a [directive](guide/glossary#directive), the `@Input` decorator on a directive property makes that property available as a *target* of a
|
||||||
[property binding](guide/template-syntax#property-binding) (explained in detail in the [Template Syntax](guide/template-syntax) page).
|
[property binding](guide/template-syntax#property-binding).
|
||||||
Data values flow *into* this property from the data source identified
|
Data values flow into an input property from the data source identified
|
||||||
in the template expression to the right of the equal sign.
|
in the [template expression](guide/glossary#template-expression) to the right of the equal sign.
|
||||||
|
|
||||||
See the [Input and output properties](guide/template-syntax#inputs-outputs) section of the [Template Syntax](guide/template-syntax) page.
|
To learn more, see [input and output properties](guide/template-syntax#inputs-outputs).
|
||||||
|
|
||||||
|
|
||||||
## Interpolation
|
## Interpolation
|
||||||
|
|
||||||
A form of [property data binding](guide/glossary#data-binding) in which a
|
A form of [property data binding](guide/glossary#data-binding) in which a
|
||||||
[template expression](guide/glossary#template-expression) between double-curly braces
|
[template expression](guide/glossary#template-expression) between double-curly braces
|
||||||
renders as text. That text may be concatenated with neighboring text
|
renders as text. That text can be concatenated with neighboring text
|
||||||
before it is assigned to an element property
|
before it is assigned to an element property
|
||||||
or displayed between element tags, as in this example.
|
or displayed between element tags, as in this example.
|
||||||
|
|
||||||
@ -422,9 +349,10 @@ See [ECMAScript](guide/glossary#ecma), [TypeScript](guide/glossary#typescript).
|
|||||||
|
|
||||||
## Just-in-time (JIT) compilation
|
## Just-in-time (JIT) compilation
|
||||||
|
|
||||||
A bootstrapping method of compiling components and modules in the browser
|
The Angular Just-in-Time (JIT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code at run time, as part of bootstrapping.
|
||||||
and launching the application dynamically. Just-in-time mode is a good choice during development.
|
JIT compilation is the default when you run Angular's `ng build` and `ng serve` CLI commands, and is a good choice during development. JIT mode is strongly discouraged for production use because it results in large application payloads that hinder the bootstrap performance.
|
||||||
Consider using the [ahead-of-time](guide/glossary#aot) mode for production apps.
|
|
||||||
|
Compare [ahead-of-time (AOT) compilation](guide/glossary#aot).
|
||||||
|
|
||||||
|
|
||||||
{@a K}
|
{@a K}
|
||||||
@ -432,13 +360,17 @@ Consider using the [ahead-of-time](guide/glossary#aot) mode for production apps.
|
|||||||
|
|
||||||
{@a L}
|
{@a L}
|
||||||
|
|
||||||
## Lifecycle hooks
|
{@a lazy-load}
|
||||||
|
|
||||||
[Directives](guide/glossary#directive) and [components](guide/glossary#component) have a lifecycle
|
## Lazy loading
|
||||||
managed by Angular as it creates, updates, and destroys them.
|
|
||||||
|
|
||||||
You can tap into key moments in that lifecycle by implementing
|
Lazy loading speeds up application load time by splitting the application into multiple bundles and loading them on demand.
|
||||||
one or more of the lifecycle hook interfaces.
|
For example, dependencies can be lazy-loaded as needed&emdash;as opposed to "eager-loaded" modules that are required by the root module, and are thus loaded on launch.
|
||||||
|
Similarly, the [router](guide/glossary#router) can load child views only when the parent view is activated, and you can build custom elements that can be loaded into an Angular app when needed.
|
||||||
|
|
||||||
|
## Lifecycle hook
|
||||||
|
|
||||||
|
An interface that allows you to tap into the lifecycle of [directives](guide/glossary#directive) and [components](guide/glossary#component) as they are created, updated, and destroyed.
|
||||||
|
|
||||||
Each interface has a single hook method whose name is the interface name prefixed with `ng`.
|
Each interface has 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`.
|
||||||
@ -454,118 +386,95 @@ Angular calls these hook methods in the following order:
|
|||||||
* `ngAfterViewChecked`: after every check of a component's views.
|
* `ngAfterViewChecked`: after every check of a component's views.
|
||||||
* `ngOnDestroy`: just before the directive is destroyed.
|
* `ngOnDestroy`: just before the directive is destroyed.
|
||||||
|
|
||||||
Read more in the [Lifecycle Hooks](guide/lifecycle-hooks) page.
|
To learn more, see the [Lifecycle Hooks](guide/lifecycle-hooks) page.
|
||||||
|
|
||||||
|
|
||||||
{@a M}
|
{@a M}
|
||||||
|
|
||||||
## Module
|
## Module
|
||||||
|
|
||||||
<div class="alert is-important">
|
In general, a module collects a block of code dedicated to a single purpose. Angular uses standard JavaScript modules, and also defines an Angular module, `NgModule`.
|
||||||
|
|
||||||
|
In JavaScript (ECMAScript), each file is a module and all objects defined in the file belong to that module. Objects can exported, making them public, and public objects can be imported for use by other modules.
|
||||||
|
|
||||||
Angular has the following types of modules:
|
Angular ships as a collection of JavaScript modules, or libraries. Each Angular library name begins with the `@angular` prefix. Install them with the NPM package manager and import parts of them with JavaScript `import` declarations.
|
||||||
|
|
||||||
* [NgModules](guide/glossary#ngmodule).
|
Compare the Angular [NgModule](guide/glossary#ngmodule).
|
||||||
For details and examples, see the [NgModules](guide/ngmodules) page.
|
|
||||||
* ES2015 modules, as described in this section.
|
|
||||||
|
|
||||||
For a comparison, see [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
A cohesive block of code dedicated to a single purpose.
|
|
||||||
|
|
||||||
Angular apps are modular.
|
|
||||||
|
|
||||||
In general, you assemble an application from many modules, both the ones you write and the ones you acquire from others.
|
|
||||||
|
|
||||||
A module *exports* something of value in that code, typically one thing such as a class;
|
|
||||||
a module that needs that class *imports* it.
|
|
||||||
|
|
||||||
The structure of NgModules and the import/export syntax
|
|
||||||
is based on the [ES2015 module standard](http://www.2ality.com/2014/09/es6-modules-final.html).
|
|
||||||
|
|
||||||
An application that adheres to this standard requires a module loader to
|
|
||||||
load modules on request and resolve inter-module dependencies.
|
|
||||||
Angular doesn't include a module loader and doesn't have a preference
|
|
||||||
for any particular third-party library.
|
|
||||||
You can use any module library that conforms to the standard.
|
|
||||||
|
|
||||||
Modules are typically named after the file in which the exported thing is defined.
|
|
||||||
The Angular [DatePipe](https://github.com/angular/angular/blob/master/packages/common/src/pipes/date_pipe.ts)
|
|
||||||
class belongs to a feature module named `date_pipe` in the file `date_pipe.ts`.
|
|
||||||
|
|
||||||
You rarely access Angular feature modules directly. You usually import them from an Angular [scoped package](guide/glossary#scoped-package) such as `@angular/core`.
|
|
||||||
|
|
||||||
|
|
||||||
{@a N}
|
{@a N}
|
||||||
|
|
||||||
|
{@a ngmodule}
|
||||||
|
|
||||||
## NgModule
|
## NgModule
|
||||||
|
|
||||||
Helps you organize an application into cohesive blocks of functionality.
|
A class definition with an `@NgModule` [decorator](guide/glossary#decorator), that declares and serves as a manifest for a block of code dedicated to an application domain, a workflow, or a closely related set of capabilities.
|
||||||
An NgModule identifies the components, directives, and pipes that the application uses along with the list of external NgModules that the application needs, such as `FormsModule`.
|
|
||||||
|
|
||||||
Every Angular application has an application root-module class. By convention, the class is
|
Like a [JavaScript module](guide/glossary#module), an NgModule can export functionality for use by other NgModules, and import public functionality from other NgModules.
|
||||||
called `AppModule` and resides in a file named `app.module.ts`.
|
|
||||||
|
|
||||||
For details and examples, see [NgModules](guide/ngmodules) and the
|
The metadata for an NgModule class collects components, directives, and pipes that the application uses along with the list of imports and exports. See also [Declarable](guide/glossary#declarable).
|
||||||
related files in that section.
|
|
||||||
|
NgModules are typically named after the file in which the exported thing is defined; for example, the Angular [DatePipe](api/common/DatePipe) class belongs to a feature module named `date_pipe` in the file `date_pipe.ts`. You import them from an Angular [scoped package](guide/glossary#scoped-package) such as `@angular/core`.
|
||||||
|
|
||||||
|
Every Angular application has a root module. By convention, the class is called `AppModule` and resides in a file named `app.module.ts`.
|
||||||
|
|
||||||
|
To learn more, see the [NgModules](guide/ngmodules) guide.
|
||||||
|
|
||||||
|
|
||||||
{@a O}
|
{@a O}
|
||||||
|
|
||||||
|
{@a observable}
|
||||||
|
|
||||||
|
|
||||||
## Observable
|
## Observable
|
||||||
|
|
||||||
An subscribable message publisher, which provides multiple items that arrive asynchronously over time.
|
A producer of multiple values, which it pushes to [subscribers](guide/glossary#subscriber). Used for asynchronous event handling throughout Angular. You execute an observable by subscribing to it with its `subscribe()` method, passing callbacks for notifications of new values, errors, or completion.
|
||||||
Observables help you manage asynchronous data, such as data coming from a backend service.
|
|
||||||
Observables are used within Angular itself, including Angular's event system and its HTTP client service.
|
|
||||||
|
|
||||||
Observables are a proposed feature for ES2016, the next version of JavaScript.
|
Observables can deliver single or multiple values of any type to subscribers, either synchronously (as a function delivers a value to its caller), or on a schedule. A subscriber receives notification of new values as they are produced, and of either error or normal completion.
|
||||||
Currently, Angular depends on a third-party library called Reactive Extensions (RxJS) to provide observables.
|
|
||||||
|
|
||||||
For more information, see the [Observables guide](guide/observables).
|
Angular uses a third-party library called [Reactive Extensions (RxJS)](http://reactivex.io/rxjs/).
|
||||||
|
|
||||||
|
To learn more, see the [Observables](guide/glossary#observable) guide.
|
||||||
|
|
||||||
|
|
||||||
|
{@a observer}
|
||||||
|
|
||||||
|
## Observer
|
||||||
|
|
||||||
|
An object passed to the `subscribe()` method for an [observable](guide/glossary#observable) that defines the callbacks for the [subscriber](guide/glossary#subscriber).
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
|
||||||
A directive property that can be the *target* of event binding
|
When defining a [directive](guide/glossary#directive), the `@Output` decorator on a directive property makes that property available as a *target* of [event binding](guide/template-syntax#event-binding).
|
||||||
(read more in the [event binding](guide/template-syntax#event-binding)
|
|
||||||
section of the [Template Syntax](guide/template-syntax) page).
|
|
||||||
Events stream *out* of this property to the receiver identified
|
|
||||||
in the template expression to the right of the equal sign.
|
|
||||||
|
|
||||||
See the [Input and output properties](guide/template-syntax#inputs-outputs) section of the [Template Syntax](guide/template-syntax) page.
|
Events stream *out* of this property to the receiver identified
|
||||||
|
in the [template expression](guide/glossary#template-expression) to the right of the equal sign.
|
||||||
|
|
||||||
|
To learn more, see [input and output properties](guide/template-syntax#inputs-outputs).
|
||||||
|
|
||||||
|
|
||||||
{@a P}
|
{@a P}
|
||||||
|
|
||||||
## Pipe
|
## Pipe
|
||||||
|
|
||||||
An Angular pipe is a function that transforms input values to output values for
|
A class with the `@Pipe` decorator which defines a function that transforms input values to output values for display in a [view](guide/glossary#view).
|
||||||
display in a [view](guide/glossary#view).
|
|
||||||
Here's an example that uses the built-in `currency` pipe to display
|
|
||||||
a numeric value in the local currency.
|
|
||||||
|
|
||||||
|
Angular defines various pipes, and you can define new pipes.
|
||||||
|
|
||||||
<code-example language="html" escape="html">
|
To learn more, see the [pipes](guide/pipes) page.
|
||||||
<label>Price: </label>{{product.price | currency}}
|
|
||||||
|
|
||||||
</code-example>
|
## Polyfill
|
||||||
|
|
||||||
|
An [NPM package](guide/npm-packages) that plugs gaps in a browser's JavaScript implementation. See the [Browser Support](guide/browser-support) guide for polyfills that support particular functionality for particular platforms.
|
||||||
|
|
||||||
You can also write your own custom pipes.
|
|
||||||
Read more in the page on [pipes](guide/pipes).
|
|
||||||
|
|
||||||
|
|
||||||
## Provider
|
## Provider
|
||||||
|
|
||||||
A _provider_ creates a new instance of a dependency for the
|
A provider of an injectable service—specifically, a code recipe associated with a [DI token](guide/glossary#token), which an [injector](guide/glossary#injector) uses to create a new instance of a dependency for a class that requires it.
|
||||||
[dependency injection](guide/glossary#dependency-injection) system.
|
|
||||||
It relates a lookup token to code—sometimes called a "recipe"—that can create a dependency value.
|
Angular registers its own providers with every injector, for services that Angular defines. You can register your own providers for services that your app needs.
|
||||||
|
|
||||||
|
See also [Service](guide/glossary#service), [Dependency Injection](guide/glossary#di).
|
||||||
|
|
||||||
|
|
||||||
{@a Q}
|
{@a Q}
|
||||||
@ -589,24 +498,13 @@ Reactive forms are powerful, flexible, and a good choice for more complex data-e
|
|||||||
|
|
||||||
## Router
|
## Router
|
||||||
|
|
||||||
Most applications consist of many screens or [views](guide/glossary#view).
|
A tool that configures and implements navigation among states and [views](guide/glossary#view) within an Angular app.
|
||||||
The user navigates among them by clicking links and buttons,
|
|
||||||
and performing other similar actions that cause the application to
|
|
||||||
replace one view with another.
|
|
||||||
|
|
||||||
The Angular component router is a richly featured mechanism for configuring and managing the entire view navigation process, including the creation and destruction
|
The Router module is an [NgModule](guide/glossary#ngmodule) that provides the necessary service providers and directives for navigating through application views. A [routing component](guide/glossary#routing-component) is one that imports the Router module and whose template contains a `RouterOutlet` element where it can display views produced by the router.
|
||||||
of views.
|
|
||||||
|
|
||||||
In most cases, components become attached to a router by means
|
The Router defines navigation among views on a single page, as opposed to navigation among pages. It interprets URL-like links to determine which views to create or destroy, and which components to load or unload. It allows you to take advantage of [lazy-loading](guide/glossary#lazy-load) in your Angular apps.
|
||||||
of a `RouterConfig` that defines routes to views.
|
|
||||||
|
|
||||||
A [routing component's](guide/glossary#routing-component) template has a `RouterOutlet` element
|
To learn more, see the [Routing & Navigation](guide/router) guide.
|
||||||
where it can display views produced by the router.
|
|
||||||
|
|
||||||
Other views in the application likely have anchor tags or buttons with `RouterLink`
|
|
||||||
directives that users can click to navigate.
|
|
||||||
|
|
||||||
For more information, see the [Routing & Navigation](guide/router) page.
|
|
||||||
|
|
||||||
|
|
||||||
## Router module
|
## Router module
|
||||||
@ -615,6 +513,9 @@ A separate [NgModule](guide/glossary#ngmodule) that provides the necessary servi
|
|||||||
|
|
||||||
For more information, see the [Routing & Navigation](guide/router) page.
|
For more information, see the [Routing & Navigation](guide/router) page.
|
||||||
|
|
||||||
|
## Router outlet
|
||||||
|
|
||||||
|
A directive that acts as a placeholder in a routing component's template, which Angular dynamically fills based on the current router state.
|
||||||
|
|
||||||
## Routing component
|
## Routing component
|
||||||
|
|
||||||
@ -627,16 +528,10 @@ For more information, see the [Routing & Navigation](guide/router) page.
|
|||||||
|
|
||||||
## Scoped package
|
## Scoped package
|
||||||
|
|
||||||
A way to group related *npm* packages.
|
A way to group related NPM packages.
|
||||||
Read more at the [npm-scope](https://docs.npmjs.com/misc/scope) page.
|
NgModules are delivered within *scoped packages* whose names begin with the Angular *scope name* `@angular`. For example, `@angular/core`, `@angular/common`, `@angular/http`, and `@angular/router`.
|
||||||
|
|
||||||
NgModules are delivered within *scoped packages* such as `@angular/core`,
|
|
||||||
`@angular/common`, `@angular/platform-browser-dynamic`, `@angular/http`, and `@angular/router`.
|
|
||||||
|
|
||||||
Import a scoped package the same way that you import a normal package.
|
|
||||||
The only difference, from a consumer perspective,
|
|
||||||
is that the scoped package name begins with the Angular *scope name*, `@angular`.
|
|
||||||
|
|
||||||
|
Import a scoped package in the same way that you import a normal package.
|
||||||
|
|
||||||
<code-example path="architecture/src/app/app.component.ts" linenums="false" title="architecture/src/app/app.component.ts (import)" region="import">
|
<code-example path="architecture/src/app/app.component.ts" linenums="false" title="architecture/src/app/app.component.ts (import)" region="import">
|
||||||
|
|
||||||
@ -645,20 +540,12 @@ is that the scoped package name begins with the Angular *scope name*, `@angular`
|
|||||||
|
|
||||||
## Service
|
## Service
|
||||||
|
|
||||||
For data or logic that is not associated
|
In Angular, a service is a class with the [@Injectable](guide/glossary#injectable) decorator that encapsulates non-UI logic and code that can be re-used across an application.
|
||||||
with a specific view or that you want to share across components, build services.
|
Angular distinguishes components from services in order to increase modularity and reusability.
|
||||||
|
|
||||||
Applications often require services such as a hero data service or a logging service.
|
The `@Injectable` metadata allows the service class to be used with the [dependency injection](guide/glossary#di) mechanism. The injectable class is instantiated by a [provider](guide/glossary#provider), and a module maintains a list of providers that can provide a particular type of service as needed by components or other services that require it.
|
||||||
|
|
||||||
A service is a class with a focused purpose.
|
|
||||||
You often create a service to implement features that are
|
|
||||||
independent from any specific view,
|
|
||||||
provide shared data or logic across components, or encapsulate external interactions.
|
|
||||||
|
|
||||||
Applications often require services such as a data service or a logging service.
|
|
||||||
|
|
||||||
For more information, see the [Services](tutorial/toh-pt4) page of the [Tour of Heroes](tutorial) tutorial.
|
|
||||||
|
|
||||||
|
To learn more, see [Introduction to Services](guide/architecture-services).
|
||||||
|
|
||||||
{@a structural-directive}
|
{@a structural-directive}
|
||||||
|
|
||||||
@ -668,21 +555,35 @@ For more information, see the [Services](tutorial/toh-pt4) page of the [Tour of
|
|||||||
|
|
||||||
## Structural directives
|
## Structural directives
|
||||||
|
|
||||||
A category of [directive](guide/glossary#directive) that can
|
A category of [directive](guide/glossary#directive) that is responsible for shaping or reshaping HTML layout by modifying the DOM (adding, removing, or manipulating elements and their children).
|
||||||
shape or reshape HTML layout, typically by adding and removing elements in the DOM.
|
|
||||||
The `ngIf` "conditional element" directive and the `ngFor` "repeater" directive are well-known examples.
|
|
||||||
|
|
||||||
Read more in the [Structural Directives](guide/structural-directives) page.
|
To learn more, see the [Structural Directives](guide/structural-directives) page.
|
||||||
|
|
||||||
|
{@a subscriber}
|
||||||
|
|
||||||
|
## Subscriber
|
||||||
|
|
||||||
|
A function that defines how to obtain or generate values or messages to be published. This function is executed when a consumer calls the `subscribe()` method of an [observable](guide/glossary#observable).
|
||||||
|
|
||||||
|
The act of subscribing to an observable triggers its execution, associates callbacks with it, and creates a `Subscription` object that lets you unsubscribe.
|
||||||
|
|
||||||
|
The `subscribe()` method takes a JavaScript object (called an "observer") with up to three callbacks, one for each type of notification that an observable can deliver:
|
||||||
|
|
||||||
|
- The `next` notification: sends a value such as a Number, a String, an Object, etc.
|
||||||
|
- The `error` notification sends a JavaScript Error or exception.
|
||||||
|
- The `complete` notification does not send a value, but the handler is called when the call completes. Scheduled values can continue to be returned after the call completes.
|
||||||
|
|
||||||
{@a T}
|
{@a T}
|
||||||
|
|
||||||
## Template
|
## Template
|
||||||
|
|
||||||
A chunk of HTML that Angular uses to render a [view](guide/glossary#view) with
|
A template defines how to render a component's [view](guide/glossary#view) in HTML
|
||||||
the support and guidance of an Angular [directive](guide/glossary#directive),
|
|
||||||
most notably a [component](guide/glossary#component).
|
|
||||||
|
|
||||||
|
A template combines straight HTML with Angular [data-binding](guide/glossary#data-binding) syntax, [directives](guide/glossary#directive), and [template expressions](guide/glossary#template-expression) (logical constructs). The Angular elements insert or calculate values that modify the HTML elements before the page is displayed.
|
||||||
|
|
||||||
|
A template is associated with a [component](guide/glossary#component) class through `@Component` [decorator](guide/glossary#decorator). The HTML can be provided inline, as the value of the `template` property, or in a separate HTML file linked through the `templateUrl` property.
|
||||||
|
|
||||||
|
Additional templates, represented by a `TemplateRef` object, can define alternative or _embedded_ views, which can be referenced from multiple components.
|
||||||
|
|
||||||
## Template-driven forms
|
## Template-driven forms
|
||||||
|
|
||||||
@ -701,6 +602,8 @@ Template-driven forms are convenient, quick, and simple. They are a good choice
|
|||||||
Read about how to build template-driven forms
|
Read about how to build template-driven forms
|
||||||
in the [Forms](guide/forms) page.
|
in the [Forms](guide/forms) page.
|
||||||
|
|
||||||
|
{@a template-expression}
|
||||||
|
|
||||||
|
|
||||||
## Template expression
|
## Template expression
|
||||||
|
|
||||||
@ -711,24 +614,27 @@ Read about how to write template expressions
|
|||||||
in the [Template expressions](guide/template-syntax#template-expressions) section
|
in the [Template expressions](guide/template-syntax#template-expressions) section
|
||||||
of the [Template Syntax](guide/template-syntax) page.
|
of the [Template Syntax](guide/template-syntax) page.
|
||||||
|
|
||||||
|
{@a token}
|
||||||
|
|
||||||
|
## Token
|
||||||
|
|
||||||
|
An opaque identifier used for efficient table lookup. In Angular, a [DI token](guide/glossary#di-token) is used to find [providers](guide/glossary#provider) of dependencies in the [dependency injection](guide/glossary#di) system.
|
||||||
|
|
||||||
|
{@a transpile}
|
||||||
|
|
||||||
## Transpile
|
## Transpile
|
||||||
|
|
||||||
The process of transforming code written in one form of JavaScript
|
The translation process that tranforms one version of JavaScript to another version; for example, down-leveling ES2015 to the older ES5 version.
|
||||||
(such as TypeScript) into another form of JavaScript. (See also [ECMAScript](guide/glossary#ecma)).
|
|
||||||
|
|
||||||
{@a typescript}
|
{@a typescript}
|
||||||
|
|
||||||
|
|
||||||
## TypeScript
|
## TypeScript
|
||||||
|
|
||||||
A version of JavaScript that supports most [ECMAScript 2015](guide/glossary#ecma)
|
TypeScript is a programming language notable for its optional typing system, which provides
|
||||||
language features such as [decorators](guide/glossary#decorator).
|
compile-time type checking and strong tooling support (such as
|
||||||
|
code completion, refactoring, inline documentation, and intelligent search). Many code editors
|
||||||
TypeScript is notable for its optional typing system, which provides
|
and IDEs support TypeScript either natively or with plug-ins.
|
||||||
compile-time type checking and strong tooling support (such as "intellisense,"
|
|
||||||
code completion, refactoring, and intelligent search). Many code editors
|
|
||||||
and IDEs support TypeScript either natively or with plugins.
|
|
||||||
|
|
||||||
TypeScript is the preferred language for Angular development. Read more about TypeScript at [typescriptlang.org](http://www.typescriptlang.org/).
|
TypeScript is the preferred language for Angular development. Read more about TypeScript at [typescriptlang.org](http://www.typescriptlang.org/).
|
||||||
|
|
||||||
@ -739,18 +645,26 @@ TypeScript is the preferred language for Angular development. Read more about Ty
|
|||||||
|
|
||||||
## View
|
## View
|
||||||
|
|
||||||
A portion of the screen that displays information and responds
|
A view is the smallest grouping of display elements that can be created and destroyed together.
|
||||||
to user actions such as clicks, mouse moves, and keystrokes.
|
|
||||||
|
|
||||||
Angular renders a view under the control of one or more [directives](guide/glossary#directive),
|
Angular renders a view under the control of one or more [directives](guide/glossary#directive),
|
||||||
especially [component](guide/glossary#component) directives and their companion [templates](guide/glossary#template).
|
especially [component](guide/glossary#component) directives and their companion [templates](guide/glossary#template).
|
||||||
The component plays such a prominent role that it's often
|
|
||||||
convenient to refer to a component as a view.
|
|
||||||
|
|
||||||
Views often contain other views. Any view might be loaded and unloaded
|
A view is specifically represented by a `ViewRef` instance associated with the component.
|
||||||
dynamically as the user navigates through the application, typically
|
A view that belongs to a component is called a _host view_.
|
||||||
under the control of a [router](guide/glossary#router).
|
Views are typically collected into [view hierarchies](guide/glossary#view-tree).
|
||||||
|
|
||||||
|
Properties of elements in a view can change dynamically, in response to user actions; the structure (number and order) of elements in a view cannot. You can change the structure of elements by inserting, moving, or removing nested views within their view containers.
|
||||||
|
|
||||||
|
View hierarchies can be loaded and unloaded dynamically as the user navigates through the application, typically under the control of a [router](guide/glossary#router).
|
||||||
|
|
||||||
|
{@a view-tree}
|
||||||
|
|
||||||
|
## View hierarchy
|
||||||
|
|
||||||
|
A tree of related views that can be acted on as a unit. The root view is a component's _host view_. A host view can be the root of a tree of _embedded views_, collected in a _view container_ (`ViewContainerRef`) attached to an anchor element in the hosting component. The view hierarchy is a key part of Angular change detection.
|
||||||
|
|
||||||
|
The view hierarchy does not imply a component hierarchy. Views that are embedded in the context of a particular hierarchy can be host views of other components. Those components can be in the same NgModule as the hosting component, or belong to other NgModules.
|
||||||
|
|
||||||
{@a W}
|
{@a W}
|
||||||
|
|
||||||
@ -769,21 +683,11 @@ See [Custom element](guide/glossary#custom-element)
|
|||||||
|
|
||||||
## Zone
|
## Zone
|
||||||
|
|
||||||
A mechanism for encapsulating and intercepting
|
An execution context for a set of asynchronous tasks. Useful for debugging, profiling, and testing apps that include asynchronous operations such as event processing, promises, and calls to remote servers.
|
||||||
a JavaScript application's asynchronous activity.
|
|
||||||
|
|
||||||
The browser DOM and JavaScript have a limited number
|
An Angular app runs in a zone where it can respond to asynchronous events by checking for data changes and updating the information it displays by resolving [data bindings](guide/glossary#data-binding).
|
||||||
of asynchronous activities, such as DOM events (for example, clicks),
|
|
||||||
[promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), and
|
|
||||||
[XHR](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest)
|
|
||||||
calls to remote servers.
|
|
||||||
|
|
||||||
Zones intercept all of these activities and give a "zone client" the opportunity
|
A zone client can take action before and after an async operation completes.
|
||||||
to take action before and after the async activity finishes.
|
|
||||||
|
|
||||||
Angular runs your application in a zone where it can respond to
|
|
||||||
asynchronous events by checking for data changes and updating
|
|
||||||
the information it displays via [data bindings](guide/glossary#data-binding).
|
|
||||||
|
|
||||||
Learn more about zones in this
|
Learn more about zones in this
|
||||||
[Brian Ford video](https://www.youtube.com/watch?v=3IqtmUscE_U).
|
[Brian Ford video](https://www.youtube.com/watch?v=3IqtmUscE_U).
|
||||||
|
@ -1030,10 +1030,18 @@ you are responsible for flushing and verifying them.
|
|||||||
|
|
||||||
You should test the app's defenses against HTTP requests that fail.
|
You should test the app's defenses against HTTP requests that fail.
|
||||||
|
|
||||||
Call `request.error()` with an `ErrorEvent` instead of `request.flush()`, as in this example.
|
Call `request.flush()` with an error message, as seen in the following example.
|
||||||
|
|
||||||
<code-example
|
<code-example
|
||||||
path="http/src/testing/http-client.spec.ts"
|
path="http/src/testing/http-client.spec.ts"
|
||||||
region="404"
|
region="404"
|
||||||
linenums="false">
|
linenums="false">
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
Alternatively, you can call `request.error()` with an `ErrorEvent`.
|
||||||
|
|
||||||
|
<code-example
|
||||||
|
path="http/src/testing/http-client.spec.ts"
|
||||||
|
region="network-error"
|
||||||
|
linenums="false">
|
||||||
|
</code-example>
|
@ -561,7 +561,7 @@ the `AfterContentComponent`'s parent. Here's the parent's template:
|
|||||||
|
|
||||||
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="parent-template" title="AfterContentParentComponent (template excerpt)" linenums="false"></code-example>
|
<code-example path="lifecycle-hooks/src/app/after-content.component.ts" region="parent-template" title="AfterContentParentComponent (template excerpt)" linenums="false"></code-example>
|
||||||
|
|
||||||
Notice that the `<my-child>` tag is tucked between the `<after-content>` tags.
|
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*.
|
||||||
|
|
||||||
@ -571,7 +571,7 @@ Now look at the component's template:
|
|||||||
|
|
||||||
The `<ng-content>` tag is a *placeholder* for the external content.
|
The `<ng-content>` tag is a *placeholder* for the external content.
|
||||||
It tells Angular where to insert that content.
|
It tells Angular where to insert that content.
|
||||||
In this case, the projected content is the `<my-child>` from the parent.
|
In this case, the projected content is the `<app-child>` from the parent.
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
<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">
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The [**Angular CLI**](https://cli.angular.io/), Angular applications, and Angular itself depend upon features and functionality provided by libraries that are available as [**npm**](https://docs.npmjs.com/) packages.
|
The [**Angular CLI**](https://cli.angular.io/), Angular applications, and Angular itself depend upon features and functionality provided by libraries that are available as [**npm**](https://docs.npmjs.com/) packages.
|
||||||
|
|
||||||
You can download and install these npm packages with the [**npm client**](https://docs.npmjs.com/cli/install), which runs as a node.js application.
|
You can download and install these npm packages with the [**npm client**](https://docs.npmjs.com/cli/install), which runs as a Node.js® application.
|
||||||
|
|
||||||
The [**yarn client**](https://yarnpkg.com/en/) is a popular alternative for downloading and installing npm packages.
|
The [**yarn client**](https://yarnpkg.com/en/) is a popular alternative for downloading and installing npm packages.
|
||||||
The Angular CLI uses `yarn` by default to install npm packages when you create a new project.
|
The Angular CLI uses `yarn` by default to install npm packages when you create a new project.
|
||||||
@ -14,19 +14,19 @@ Node.js and npm are essential to Angular development.
|
|||||||
[Get them now](https://docs.npmjs.com/getting-started/installing-node "Installing Node.js and updating npm")
|
[Get them now](https://docs.npmjs.com/getting-started/installing-node "Installing Node.js and updating npm")
|
||||||
if they're not already installed on your machine.
|
if they're not already installed on your machine.
|
||||||
|
|
||||||
**Verify that you are running node `v4.x.x` or higher and npm `3.x.x` or higher**
|
**Verify that you are running Node.js `v8.x` or higher and npm `5.x` or higher**
|
||||||
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
||||||
Older versions produce errors.
|
Older versions produce errors.
|
||||||
|
|
||||||
Consider using [nvm](https://github.com/creationix/nvm) for managing multiple
|
Consider using [nvm](https://github.com/creationix/nvm) for managing multiple
|
||||||
versions of node and npm. You may need [nvm](https://github.com/creationix/nvm) if
|
versions of Node.js and npm. You may need [nvm](https://github.com/creationix/nvm) if
|
||||||
you already have projects running on your machine that use other versions of node and npm.
|
you already have projects running on your machine that use other versions of Node.js and npm.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## _package.json_
|
## _package.json_
|
||||||
|
|
||||||
Both `npm` and `yarn` install packages identified in a [**package.json**](https://docs.npmjs.com/files/package.json) file.
|
Both `npm` and `yarn` install packages that are identified in a [**package.json**](https://docs.npmjs.com/files/package.json) file.
|
||||||
|
|
||||||
The CLI `ng new` command creates a default `package.json` file for your project.
|
The CLI `ng new` command creates a default `package.json` file for your project.
|
||||||
This `package.json` specifies _a starter set of packages_ that work well together and
|
This `package.json` specifies _a starter set of packages_ that work well together and
|
||||||
@ -129,7 +129,7 @@ You don't deploy them with the production application although there is no harm
|
|||||||
For example, see the [Angular language service extension for VS Code](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template)
|
For example, see the [Angular language service extension for VS Code](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template)
|
||||||
|
|
||||||
|
|
||||||
**@types/... **: TypeScript definition files for 3rd party libraries such as Jasmine and node.
|
**@types/... **: TypeScript definition files for 3rd party libraries such as Jasmine and Node.js.
|
||||||
|
|
||||||
|
|
||||||
**[codelyzer](https://www.npmjs.com/package/codelyzer)**: A linter for Angular apps whose rules conform to the Angular [style guide](guide/styleguide).
|
**[codelyzer](https://www.npmjs.com/package/codelyzer)**: A linter for Angular apps whose rules conform to the Angular [style guide](guide/styleguide).
|
||||||
@ -145,7 +145,7 @@ For example, see the [Angular language service extension for VS Code](https://ma
|
|||||||
Built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs).
|
Built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs).
|
||||||
|
|
||||||
|
|
||||||
**[ts-node](https://www.npmjs.com/package/ts-node)**: TypeScript execution environment and REPL for node.
|
**[ts-node](https://www.npmjs.com/package/ts-node)**: TypeScript execution environment and REPL for Node.js.
|
||||||
|
|
||||||
|
|
||||||
**[tslint](https://www.npmjs.com/package/tslint)**: a static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
|
**[tslint](https://www.npmjs.com/package/tslint)**: a static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
|
||||||
|
@ -32,7 +32,7 @@ if they are not already on your machine.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Verify that you are running at least node `6.9.x` and npm `3.x.x`**
|
**Verify that you are running at least Node.js version `8.x` or greater and npm version `5.x` or greater**
|
||||||
by running `node -v` and `npm -v` in a terminal/console window.
|
by running `node -v` and `npm -v` in a terminal/console window.
|
||||||
Older versions produce errors, but newer versions are fine.
|
Older versions produce errors, but newer versions are fine.
|
||||||
|
|
||||||
@ -206,14 +206,17 @@ Any files outside of this folder are meant to support building your app.
|
|||||||
<div class="file">environment.prod.ts</div>
|
<div class="file">environment.prod.ts</div>
|
||||||
<div class="file">environment.ts</div>
|
<div class="file">environment.ts</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="file">browserslist</div>
|
||||||
<div class="file">favicon.ico</div>
|
<div class="file">favicon.ico</div>
|
||||||
<div class="file">index.html</div>
|
<div class="file">index.html</div>
|
||||||
|
<div class="file">karma.conf.js</div>
|
||||||
<div class="file">main.ts</div>
|
<div class="file">main.ts</div>
|
||||||
<div class="file">polyfills.ts</div>
|
<div class="file">polyfills.ts</div>
|
||||||
<div class="file">styles.css</div>
|
<div class="file">styles.css</div>
|
||||||
<div class="file">test.ts</div>
|
<div class="file">test.ts</div>
|
||||||
<div class="file">tsconfig.app.json</div>
|
<div class="file">tsconfig.app.json</div>
|
||||||
<div class="file">tsconfig.spec.json</div>
|
<div class="file">tsconfig.spec.json</div>
|
||||||
|
<div class="file">tslint.json</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -297,6 +300,18 @@ Any files outside of this folder are meant to support building your app.
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
`browserslist`
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
A configuration file to share [target browsers](https://github.com/browserslist/browserslist) between different front-end tools.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
@ -325,6 +340,19 @@ Any files outside of this folder are meant to support building your app.
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
`karma.conf.js`
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Unit test configuration for the [Karma test runner](https://karma-runner.github.io),
|
||||||
|
used when running `ng test`.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
@ -395,6 +423,20 @@ Any files outside of this folder are meant to support building your app.
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
`tslint.json`
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
Additional Linting configuration for [TSLint](https://palantir.github.io/tslint/) together with
|
||||||
|
[Codelyzer](http://codelyzer.com/), used when running `ng lint`.
|
||||||
|
Linting helps keep your code style consistent.
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
### The root folder
|
### The root folder
|
||||||
@ -409,18 +451,23 @@ These files go in the root folder next to `src/`.
|
|||||||
<div class='children'>
|
<div class='children'>
|
||||||
<div class="file">e2e</div>
|
<div class="file">e2e</div>
|
||||||
<div class='children'>
|
<div class='children'>
|
||||||
<div class="file">app.e2e-spec.ts</div>
|
<div class="file">src</div>
|
||||||
<div class="file">app.po.ts</div>
|
<div class='children'>
|
||||||
|
<div class="file">app.e2e-spec.ts</div>
|
||||||
|
<div class="file">app.po.ts</div>
|
||||||
|
</div>
|
||||||
<div class="file">tsconfig.e2e.json</div>
|
<div class="file">tsconfig.e2e.json</div>
|
||||||
|
<div class="file">protractor.conf.js</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="file">node_modules/...</div>
|
<div class="file">node_modules/...</div>
|
||||||
<div class="file">src/...</div>
|
<div class="file">src/...</div>
|
||||||
<div class="file">.angular-cli.json</div>
|
<div class='children'>
|
||||||
|
<div class="file">karma.conf.js</div>
|
||||||
|
</div>
|
||||||
<div class="file">.editorconfig</div>
|
<div class="file">.editorconfig</div>
|
||||||
<div class="file">.gitignore</div>
|
<div class="file">.gitignore</div>
|
||||||
<div class="file">karma.conf.js</div>
|
<div class="file">angular.json</div>
|
||||||
<div class="file">package.json</div>
|
<div class="file">package.json</div>
|
||||||
<div class="file">protractor.conf.js</div>
|
|
||||||
<div class="file">README.md</div>
|
<div class="file">README.md</div>
|
||||||
<div class="file">tsconfig.json</div>
|
<div class="file">tsconfig.json</div>
|
||||||
<div class="file">tslint.json</div>
|
<div class="file">tslint.json</div>
|
||||||
@ -473,21 +520,6 @@ These files go in the root folder next to `src/`.
|
|||||||
`package.json` inside of it.
|
`package.json` inside of it.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
`.angular-cli.json`
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
Configuration for Angular CLI.
|
|
||||||
In this file you can set several defaults and also configure what files are included
|
|
||||||
when your project is built.
|
|
||||||
Check out the official documentation if you want to know more.
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
@ -518,13 +550,15 @@ These files go in the root folder next to `src/`.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
`karma.conf.js`
|
`angular.json`
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
Unit test configuration for the [Karma test runner](https://karma-runner.github.io),
|
Configuration for Angular CLI.
|
||||||
used when running `ng test`.
|
In this file you can set several defaults and also configure what files are included
|
||||||
|
when your project is built.
|
||||||
|
Check out the official documentation if you want to know more.
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -1068,7 +1068,7 @@ Replace the address `FormGroup` definition with a `secretLairs` `FormArray` def
|
|||||||
|
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
In `hero-detail.component.html` change `formArrayName="address"` to `formArrayName="secretLairs"`.
|
In `hero-detail.component.html` change `formGroupName="address"` to `formArrayName="secretLairs"`.
|
||||||
|
|
||||||
<code-example path="reactive-forms/src/app/hero-detail/hero-detail-8.component.html" region="form-array-name" title="src/app/hero-detail/hero-detail.component.ts" linenums="false">
|
<code-example path="reactive-forms/src/app/hero-detail/hero-detail-8.component.html" region="form-array-name" title="src/app/hero-detail/hero-detail.component.ts" linenums="false">
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
{@a glob}
|
|
||||||
|
|
||||||
# Service worker configuration
|
# Service worker configuration
|
||||||
|
|
||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
@ -20,10 +18,11 @@ ngsw-config dist src/ngsw-config.json /base/href
|
|||||||
|
|
||||||
The configuration file uses the JSON format. All file paths must begin with `/`, which is the deployment directory—usually `dist` in CLI projects.
|
The configuration file uses the JSON format. All file paths must begin with `/`, which is the deployment directory—usually `dist` in CLI projects.
|
||||||
|
|
||||||
Patterns use a limited glob format:
|
{@a glob-patterns}
|
||||||
|
Unless otherwise noted, patterns use a limited glob format:
|
||||||
|
|
||||||
* `**` matches 0 or more path segments.
|
* `**` matches 0 or more path segments.
|
||||||
* `*` matches exactly one path segment or filename segment.
|
* `*` matches 0 or more characters excluding `/`.
|
||||||
* The `!` prefix marks the pattern as being negative, meaning that only files that don't match the pattern will be included.
|
* The `!` prefix marks the pattern as being negative, meaning that only files that don't match the pattern will be included.
|
||||||
|
|
||||||
Example patterns:
|
Example patterns:
|
||||||
@ -39,6 +38,7 @@ Each section of the configuration file is described below.
|
|||||||
This section enables you to pass any data you want that describes this particular version of the app.
|
This section enables you to pass any data you want that describes this particular version of the app.
|
||||||
The `SwUpdate` service includes that data in the update notifications. Many apps use this section to provide additional information for the display of UI popups, notifying users of the available update.
|
The `SwUpdate` service includes that data in the update notifications. Many apps use this section to provide additional information for the display of UI popups, notifying users of the available update.
|
||||||
|
|
||||||
|
{@a index-file}
|
||||||
## `index`
|
## `index`
|
||||||
|
|
||||||
Specifies the file that serves as the index page to satisfy navigation requests. Usually this is `/index.html`.
|
Specifies the file that serves as the index page to satisfy navigation requests. Usually this is `/index.html`.
|
||||||
@ -104,7 +104,8 @@ This section describes the resources to cache, broken up into three groups.
|
|||||||
|
|
||||||
* `versionedFiles` is like `files` but should be used for build artifacts that already include a hash in the filename, which is used for cache busting. The Angular service worker can optimize some aspects of its operation if it can assume file contents are immutable.
|
* `versionedFiles` is like `files` but should be used for build artifacts that already include a hash in the filename, which is used for cache busting. The Angular service worker can optimize some aspects of its operation if it can assume file contents are immutable.
|
||||||
|
|
||||||
* `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.
|
* `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.)_
|
||||||
|
|
||||||
## `dataGroups`
|
## `dataGroups`
|
||||||
|
|
||||||
@ -130,7 +131,8 @@ export interface DataGroup {
|
|||||||
Similar to `assetGroups`, every data group has a `name` which uniquely identifies it.
|
Similar to `assetGroups`, every data group has a `name` which uniquely identifies it.
|
||||||
|
|
||||||
### `urls`
|
### `urls`
|
||||||
A list of URL patterns. URLs that match these patterns will be cached according to this data group's policy.
|
A list of URL patterns. URLs that match these patterns will be cached according to this data group's policy.<br>
|
||||||
|
_(Negative glob patterns are not supported.)_
|
||||||
|
|
||||||
### `version`
|
### `version`
|
||||||
Occasionally APIs change formats in a way that is not backward-compatible. A new version of the app may not be compatible with the old API format and thus may not be compatible with existing cached resources from that API.
|
Occasionally APIs change formats in a way that is not backward-compatible. A new version of the app may not be compatible with the old API format and thus may not be compatible with existing cached resources from that API.
|
||||||
@ -167,3 +169,38 @@ 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.
|
||||||
|
|
||||||
|
## `navigationUrls`
|
||||||
|
|
||||||
|
This optional section enables you to specify a custom list of URLs that will be redirected to the index file.
|
||||||
|
|
||||||
|
### Handling navigation requests
|
||||||
|
|
||||||
|
The ServiceWorker will redirect navigation requests that don't match any `asset` or `data` group to the specified [index file](#index-file). A request is considered to be a navigation request if:
|
||||||
|
|
||||||
|
1. Its [mode](https://developer.mozilla.org/en-US/docs/Web/API/Request/mode) is `navigation`.
|
||||||
|
2. It accepts a `text/html` response (as determined by the value of the `Accept` header).
|
||||||
|
3. Its URL matches certain criteria (see below).
|
||||||
|
|
||||||
|
By default, these criteria are:
|
||||||
|
|
||||||
|
1. The URL must not contain a file extension (i.e. a `.`) in the last path segment.
|
||||||
|
2. The URL must not contain `__`.
|
||||||
|
|
||||||
|
### Matching navigation request URLs
|
||||||
|
|
||||||
|
While these default criteria are fine in most cases, it is sometimes desirable to configure different rules. For example, you may want to ignore specific routes (that are not part of the Angular app) and pass them through to the server.
|
||||||
|
|
||||||
|
This field contains an array of URLs and [glob-like](#glob-patterns) URL patterns that will be matched at runtime. It can contain both negative patterns (i.e. patterns starting with `!`) and non-negative patterns and URLs.
|
||||||
|
|
||||||
|
Only requests whose URLs match _any_ of the non-negative URLs/patterns and _none_ of the negative ones will be considered navigation requests. The URL query will be ignored when matching.
|
||||||
|
|
||||||
|
If the field is omitted, it defaults to:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
[
|
||||||
|
'/**', // Include all URLs.
|
||||||
|
'!/**/*.*', // Exclude URLs to files.
|
||||||
|
'!/**/*__*', // Exclude URLs containing `__` in the last segment.
|
||||||
|
'!/**/*__*/**', // Exclude URLs containing `__` in any other segment.
|
||||||
|
]
|
||||||
|
```
|
||||||
|
@ -51,7 +51,7 @@ caching an invalid resource. In a normal HTTP cache, a hard refresh
|
|||||||
or cache expiration limits the negative effects of caching an invalid
|
or cache expiration limits the negative effects of caching an invalid
|
||||||
file. A service worker ignores such constraints and effectively long
|
file. A service worker ignores such constraints and effectively long
|
||||||
caches the entire app. Consequently, it is essential that the service worker
|
caches the entire app. Consequently, it is essential that the service worker
|
||||||
get the correct content.
|
gets the correct content.
|
||||||
|
|
||||||
To ensure resource integrity, the Angular service worker validates
|
To ensure resource integrity, the Angular service worker validates
|
||||||
the hashes of all resources for which it has a hash. Typically for
|
the hashes of all resources for which it has a hash. Typically for
|
||||||
@ -298,7 +298,7 @@ design attempts to minimize the impact of such problems, the
|
|||||||
Angular service worker contains several failsafe mechanisms in case
|
Angular service worker contains several failsafe mechanisms in case
|
||||||
an administrator ever needs to deactivate the service worker quickly.
|
an administrator ever needs to deactivate the service worker quickly.
|
||||||
|
|
||||||
## Fail-safe
|
### Fail-safe
|
||||||
|
|
||||||
To deactivate the service worker, remove or rename the
|
To deactivate the service worker, remove or rename the
|
||||||
`ngsw-config.json` file. When the service worker's request
|
`ngsw-config.json` file. When the service worker's request
|
||||||
|
@ -1,87 +1,35 @@
|
|||||||
# Getting started with service workers
|
# Getting started with service workers
|
||||||
|
|
||||||
|
|
||||||
|
This document explains how to enable Angular service worker support in your CLI projects. It then uses a simple example to show you a service worker in action, demonstrating loading and basic caching.
|
||||||
|
|
||||||
#### Prerequisites
|
#### Prerequisites
|
||||||
|
|
||||||
A basic understanding of the following:
|
A basic understanding of the following:
|
||||||
* [Introduction to Angular service workers](guide/service-worker-intro).
|
* [Introduction to Angular service workers](guide/service-worker-intro).
|
||||||
|
* Angular v6, including Angular CLI v6.
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
|
||||||
Beginning in Angular 5.0.0, you can easily enable Angular service worker support in any CLI project. This document explains how to enable Angular service worker support in new and existing projects. It then uses a simple example to show you a service worker in action, demonstrating loading and basic caching.
|
## Adding a service worker to your project
|
||||||
|
|
||||||
## Adding a service worker to a new application
|
To set up the Angular service worker in your project, use the CLI command `ng add @angular/pwa`. It takes care of configuring your app to use service workers by adding the `service-worker` package along
|
||||||
|
with setting up the necessary support files.
|
||||||
If you're generating a new CLI project, you can use the CLI to set up the Angular service worker as part of creating the project. To do so, add the `--service-worker` flag to the `ng new` command:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ng new my-project --service-worker
|
ng add @angular/pwa --project *project-name*
|
||||||
```
|
```
|
||||||
|
|
||||||
The `--service-worker` flag takes care of configuring your app to
|
The above command completes the following actions:
|
||||||
use service workers by adding the `service-worker` package along
|
|
||||||
with setting up the necessary files to support service workers.
|
1. Adds the `@angular/service-worker` package.
|
||||||
For information on the details, see the following section
|
2. Enables service worker build support in the CLI.
|
||||||
which covers the process in detail as it shows you how to add a
|
3. Imports and registers the service worker in the app module.
|
||||||
service worker manually to an existing app.
|
4. Creates the service worker configuration file called `ngsw-config.json` which specifies the caching behaviors and other settings.
|
||||||
|
|
||||||
|
|
||||||
|
Now, build the project:
|
||||||
## Adding a service worker to an existing app
|
|
||||||
|
|
||||||
To add a service worker to an existing app:
|
|
||||||
|
|
||||||
1. Add the service worker package.
|
|
||||||
2. Enable service worker build support in the CLI.
|
|
||||||
3. Import and register the service worker.
|
|
||||||
4. Create the service worker configuration file, which specifies the caching behaviors and other settings.
|
|
||||||
5. Build the project.
|
|
||||||
|
|
||||||
### Step 1: Add the service worker package
|
|
||||||
|
|
||||||
Add the package `@angular/service-worker`, using the yarn utility as shown here:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn add @angular/service-worker
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 2: Enable service worker build support in the CLI
|
|
||||||
|
|
||||||
To enable the Angular service worker, the CLI must generate an Angular service worker manifest at build time. To cause the CLI to generate the manifest for an existing project, set the `serviceWorker` flag to `true` in the project's `.angular-cli.json` file as shown here:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ng set apps.0.serviceWorker=true
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 3: Import and register the service worker
|
|
||||||
|
|
||||||
To import and register the Angular service worker:
|
|
||||||
|
|
||||||
At the top of the root module, `src/app/app.module.ts`, import `ServiceWorkerModule` and `environment`.
|
|
||||||
|
|
||||||
<code-example path="service-worker-getting-started/src/app/app.module.ts" linenums="false" title="src/app/app.module.ts" region="sw-import"> </code-example>
|
|
||||||
|
|
||||||
|
|
||||||
Add `ServiceWorkerModule` to the `@NgModule` `imports` array. Use the `register()` helper to take care of registering the service worker, taking care to disable the service worker when not running in production mode.
|
|
||||||
|
|
||||||
<code-example path="service-worker-getting-started/src/app/app.module.ts" linenums="false" title="src/app/app.module.ts" region="sw-module"> </code-example>
|
|
||||||
|
|
||||||
The file `ngsw-worker.js` is the name of the prebuilt service worker script, which the CLI copies into `dist/` to deploy along with your server.
|
|
||||||
|
|
||||||
### Step 4: Create the configuration file, `ngsw-config.json`
|
|
||||||
|
|
||||||
The Angular CLI needs a service worker configuration file, called `ngsw-config.json`. The configuration file controls how the service worker caches files and data
|
|
||||||
resources.
|
|
||||||
|
|
||||||
You can begin with the boilerplate version from the CLI, which configures sensible defaults for most applications.
|
|
||||||
|
|
||||||
Alternately, save the following as `src/ngsw-config.json`:
|
|
||||||
|
|
||||||
<code-example path="service-worker-getting-started/src/ngsw-config.json" linenums="false" title="src/ngsw-config.json"> </code-example>
|
|
||||||
|
|
||||||
### Step 5: Build the project
|
|
||||||
|
|
||||||
Finally, build the project:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ng build --prod
|
ng build --prod
|
||||||
|
@ -25,17 +25,12 @@ The Angular service worker's behavior follows that design goal:
|
|||||||
* Updates happen in the background, relatively quickly after changes are published. The previous version of the application is served until an update is installed and ready.
|
* Updates happen in the background, relatively quickly after changes are published. The previous version of the application is served until an update is installed and ready.
|
||||||
* The service worker conserves bandwidth when possible. Resources are only downloaded if they've changed.
|
* The service worker conserves bandwidth when possible. Resources are only downloaded if they've changed.
|
||||||
|
|
||||||
To support these behaviors, the Angular service worker loads a *manifest* file from the server. The manifest describes the resources to cache and includes hashes of every file's contents. When an update to the application is deployed, the contents of the manifest change, informing the service worker that a new version of the application should be downloaded and cached. This manifest is generated from a user-provided configuration file called `ngsw-config.json`, by using a build tool such as the Angular CLI.
|
To support these behaviors, the Angular service worker loads a *manifest* file from the server. The manifest describes the resources to cache and includes hashes of every file's contents. When an update to the application is deployed, the contents of the manifest change, informing the service worker that a new version of the application should be downloaded and cached. This manifest is generated from a CLI-generated configuration file called `ngsw-config.json`.
|
||||||
|
|
||||||
Installing the Angular service worker is as simple as including an `NgModule`. In addition to registering the Angular service worker with the browser, this also makes a few services available for injection which interact with the service worker and can be used to control it. For example, an application can ask to be notified when a new update becomes available, or an application can ask the service worker to check the server for available updates.
|
Installing the Angular service worker is as simple as including an `NgModule`. In addition to registering the Angular service worker with the browser, this also makes a few services available for injection which interact with the service worker and can be used to control it. For example, an application can ask to be notified when a new update becomes available, or an application can ask the service worker to check the server for available updates.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
To use Angular service workers, you must have the following Angular and CLI versions:
|
|
||||||
|
|
||||||
* Angular 5.0.0 or later.
|
|
||||||
* Angular CLI 1.6.0 or later.
|
|
||||||
|
|
||||||
Your application must run in a web browser that supports service workers. Currently, the latest versions of Chrome and Firefox are supported. To learn about other browsers that are service worker ready, see the [Can I Use](http://caniuse.com/#feat=serviceworkers) page.
|
Your application must run in a web browser that supports service workers. Currently, the latest versions of Chrome and Firefox are supported. To learn about other browsers that are service worker ready, see the [Can I Use](http://caniuse.com/#feat=serviceworkers) page.
|
||||||
|
|
||||||
## Related resources
|
## Related resources
|
||||||
|
@ -10,7 +10,7 @@ Setting up a new project on your machine is quick and easy with the **QuickStart
|
|||||||
maintained [on github](https://github.com/angular/quickstart "Install the github QuickStart repo").
|
maintained [on github](https://github.com/angular/quickstart "Install the github QuickStart repo").
|
||||||
|
|
||||||
|
|
||||||
Make sure you have [node and npm installed](guide/setup#install-prerequisites "What if you don't have node and npm?").
|
Make sure you have [Node.js® and npm installed](guide/setup#install-prerequisites "What if you don't have Node.js and npm?").
|
||||||
|
|
||||||
{@a clone}
|
{@a clone}
|
||||||
|
|
||||||
@ -301,23 +301,22 @@ If you're new to Angular, we recommend you follow the [tutorial](tutorial "Tour
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Appendix: node and npm
|
## Appendix: Node.js and npm
|
||||||
|
|
||||||
|
|
||||||
Node.js and npm are essential to modern web development with Angular and other platforms.
|
[Node.js](https://nodejs.org/en/) and the [npm](https://www.npmjs.com/) package manager are essential to modern web development with Angular and other platforms.
|
||||||
Node powers client development and build tools.
|
Node.js powers client development and build tools.
|
||||||
The _npm_ package manager, itself a _node_ application, installs JavaScript libraries.
|
The _npm_ package manager, which is itself a _Node.js_ application, installs JavaScript libraries.
|
||||||
|
|
||||||
<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">
|
<a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" title="Installing Node.js and updating npm">
|
||||||
Get them now</a> if they're not already installed on your machine.
|
Get them now</a> if they're not already installed on your machine.
|
||||||
|
|
||||||
**Verify that you are running node `v4.x.x` or higher and npm `3.x.x` or higher**
|
**Verify that you are running Node.js `v8.x` or higher and npm `5.x` or higher**
|
||||||
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
||||||
Older versions produce errors.
|
Older versions produce errors.
|
||||||
|
|
||||||
We recommend [nvm](https://github.com/creationix/nvm) for managing multiple versions of node and npm.
|
We recommend [nvm](https://github.com/creationix/nvm) for managing multiple versions of Node.js and npm.
|
||||||
You may need [nvm](https://github.com/creationix/nvm) if you already have projects running on your machine that
|
You may need [nvm](https://github.com/creationix/nvm) if you already have projects running on your machine that use other versions of Node.js and npm.
|
||||||
use other versions of node and npm.
|
|
||||||
|
|
||||||
|
|
||||||
{@a why-locally}
|
{@a why-locally}
|
||||||
|
@ -57,11 +57,11 @@ The tests run again, the browser refreshes, and the new test results appear.
|
|||||||
|
|
||||||
The CLI takes care of Jasmine and karma configuration for you.
|
The CLI takes care of Jasmine and karma configuration for you.
|
||||||
|
|
||||||
You can fine-tune many options by editing the `karma.conf.js` file in the project root folder and
|
You can fine-tune many options by editing the `karma.conf.js` and
|
||||||
the `test.ts` file in the `src/` folder.
|
the `test.ts` files in the `src/` folder.
|
||||||
|
|
||||||
The `karma.conf.js` file is a partial karma configuration file.
|
The `karma.conf.js` file is a partial karma configuration file.
|
||||||
The CLI constructs the full runtime configuration in memory,based on application structure specified in the `.angular-cli.json` file, supplemented by `karma.conf.js`.
|
The CLI constructs the full runtime configuration in memory,based on application structure specified in the `angular.json` file, supplemented by `karma.conf.js`.
|
||||||
|
|
||||||
Search the web for more details about Jasmine and karma configuration.
|
Search the web for more details about Jasmine and karma configuration.
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ QuickStart identifies two *typings*, or `d.ts`, files:
|
|||||||
|
|
||||||
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework.
|
* [jasmine](http://jasmine.github.io/) typings for the Jasmine test framework.
|
||||||
|
|
||||||
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *nodejs* environment;
|
* [node](https://www.npmjs.com/package/@types/node) for code that references objects in the *Node.js®* environment;
|
||||||
you can view an example in the [webpack](guide/webpack) page.
|
you can view an example in the [webpack](guide/webpack) page.
|
||||||
|
|
||||||
QuickStart doesn't require these typings but many of the samples do.
|
QuickStart doesn't require these typings but many of the samples do.
|
||||||
|
@ -16,7 +16,7 @@ Meanwhile, the browser downloads the full client version and switches to it auto
|
|||||||
<div class="l-sub-section">
|
<div class="l-sub-section">
|
||||||
|
|
||||||
[Download the finished sample code](generated/zips/universal/universal.zip),
|
[Download the finished sample code](generated/zips/universal/universal.zip),
|
||||||
which runs in a [node express](https://expressjs.com/) server.
|
which runs in a [Node.js® Express](https://expressjs.com/) server.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ You'll add more files to support building and serving with Universal.
|
|||||||
|
|
||||||
In this example, the Angular CLI compiles and bundles the Universal version of the app with the
|
In this example, the Angular CLI compiles and bundles the Universal version of the app with the
|
||||||
[AOT (Ahead-of-Time) compiler](guide/aot-compiler).
|
[AOT (Ahead-of-Time) compiler](guide/aot-compiler).
|
||||||
A node/express web server turns client requests into the HTML pages rendered by Universal.
|
A Node.js® Express web server turns client requests into the HTML pages rendered by Universal.
|
||||||
|
|
||||||
You will create:
|
You will create:
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ if they are not already on your machine.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Verify that you are running node version `4.6.x` or greater, and npm `3.x.x` or greater**
|
**Verify that you are running Node.js version `8.x` or greater, and npm `5.x` or greater**
|
||||||
by running `node -v` and `npm -v` in a terminal window.
|
by running `node -v` and `npm -v` in a terminal window.
|
||||||
Older versions produce errors.
|
Older versions produce errors.
|
||||||
|
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"startDate": "2018-02-14",
|
"startDate": "2018-02-14",
|
||||||
"endDate": "2018-04-22",
|
"endDate": "2018-04-18",
|
||||||
"message": "Join us for ng-conf<br/>Apr 18th-20th, 2018",
|
"message": "Join us for ng-conf<br/>Apr 18th-20th, 2018",
|
||||||
"imageUrl": "generated/images/marketing/home/ng-conf.png",
|
"imageUrl": "generated/images/marketing/home/ng-conf.png",
|
||||||
"linkUrl": "http://ng-conf.org/"
|
"linkUrl": "http://ng-conf.org/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"startDate": "2018-04-18",
|
||||||
|
"endDate": "2018-04-22",
|
||||||
|
"message": "Watch ng-conf live stream <br/>Apr 18th-20th, 2018",
|
||||||
|
"imageUrl": "generated/images/marketing/home/ng-conf.png",
|
||||||
|
"linkUrl": "https://www.ng-conf.org/livestream/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -226,7 +226,7 @@
|
|||||||
"picture": "wardbell.jpg",
|
"picture": "wardbell.jpg",
|
||||||
"website": "https://github.com/wardbell",
|
"website": "https://github.com/wardbell",
|
||||||
"twitter": "wardbell",
|
"twitter": "wardbell",
|
||||||
"bio": "Ward is an all-around developer with JavaScript, node, and .net chops. He's a frequent conference speaker and podcaster, trainer, Google Developer Expert for Angular, Microsoft MVP, and PluralSight author. He is also president of IdeaBlade, an enterprise software consulting firm and the makers of breeze.js. He would like to get more sleep and spend more time in the mountains.",
|
"bio": "Ward is an all-around developer with JavaScript, Node.js®, and .net chops. He's a frequent conference speaker and podcaster, trainer, Google Developer Expert for Angular, Microsoft MVP, and PluralSight author. He is also president of IdeaBlade, an enterprise software consulting firm and the makers of breeze.js. He would like to get more sleep and spend more time in the mountains.",
|
||||||
"group": "Angular"
|
"group": "Angular"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div class="feature">
|
<div class="feature">
|
||||||
<div class="feature-title">Universal</div>
|
<div class="feature-title">Universal</div>
|
||||||
<p class="text-body">Serve the first view of your application on node.js, .NET, PHP, and other servers for near-instant rendering in just HTML and CSS. Also paves the way for sites that optimize for SEO.</p>
|
<p class="text-body">Serve the first view of your application on Node.js®, .NET, PHP, and other servers for near-instant rendering in just HTML and CSS. Also paves the way for sites that optimize for SEO.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="feature">
|
<div class="feature">
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
"url": "https://github.com/angular/universal"
|
"url": "https://github.com/angular/universal"
|
||||||
},
|
},
|
||||||
"c1": {
|
"c1": {
|
||||||
"desc": "Lightweight development only node server",
|
"desc": "Lightweight development only Node.js® server",
|
||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
"rev": true,
|
||||||
"title": "Lite-server",
|
"title": "Lite-server",
|
||||||
@ -541,7 +541,7 @@
|
|||||||
"logo": "",
|
"logo": "",
|
||||||
"rev": true,
|
"rev": true,
|
||||||
"title": "Egghead.io",
|
"title": "Egghead.io",
|
||||||
"url": "https://egghead.io/technologies/angular2"
|
"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",
|
||||||
@ -574,6 +574,12 @@
|
|||||||
"title": "Learn Angular (francais)",
|
"title": "Learn Angular (francais)",
|
||||||
"url": "http://www.learn-angular.fr/"
|
"url": "http://www.learn-angular.fr/"
|
||||||
},
|
},
|
||||||
|
"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.",
|
||||||
|
"rev": true,
|
||||||
|
"title": "Upgrading AngularJS",
|
||||||
|
"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,
|
"rev": true,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user