angular-docs-cn/packages
Pete Bacon Darwin e511bfcab5 fix(ivy): ensure that the correct `document` is available (#33712)
Most of the use of `document` in the framework is within
the DI so they just inject the `DOCUMENT` token and are done.

Ivy is special because it does not rely upon the DI and must
get hold of the document some other way. There are a limited
number of places relevant to ivy that currently consume a global
document object.

The solution is modelled on the `LOCALE_ID` approach, which has
`getLocaleId()` and `setLocaleId()` top-level functions for ivy (see
`core/src/render3/i18n.ts`).  In the rest of Angular (i.e. using DI) the
`LOCALE_ID` token has a provider that also calls setLocaleId() to
ensure that ivy has the same value.

This commit defines `getDocument()` and `setDocument() `top-level
functions for ivy. Wherever ivy needs the global `document`, it calls
`getDocument()` instead.  Each of the platforms (e.g. Browser, Server,
WebWorker) have providers for `DOCUMENT`. In each of those providers
they also call `setDocument()` accordingly.

Fixes #33651

PR Close #33712
2019-11-11 14:01:04 -08:00
..
animations feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
bazel build: fix ng_package & ng_rollup_bundle windows issues (#33607) 2019-11-06 19:56:57 +00:00
benchpress feat: update rxjs peerDependencies minimum requirment to 6.5.3 (#32812) 2019-10-01 14:56:45 -07:00
common fix(common): rerun cldr to remove � characters (#33699) 2019-11-11 09:38:58 -08:00
compiler fix(ivy): match directives on namespaced elements (#33555) 2019-11-07 15:40:50 +00:00
compiler-cli fix(ngcc): ensure that adjacent statements go after helper calls (#33689) 2019-11-11 13:01:15 -08:00
core fix(ivy): ensure that the correct `document` is available (#33712) 2019-11-11 14:01:04 -08:00
docs refactor(core): remove deprecated Renderer (#33019) 2019-10-08 09:23:00 -07:00
elements build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
examples build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
forms docs(forms): Add a missing space (#33352) 2019-10-31 23:46:54 +00:00
http feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
language-service build: remove deps on legacy nodejs rules rollup_bundle internals (#33201) (#33607) 2019-11-06 19:56:57 +00:00
localize fix(compiler): i18n - ignore `alt-trans` tags in XLIFF 1.2 (#33450) 2019-10-29 11:49:32 -07:00
platform-browser fix(ivy): ensure that the correct `document` is available (#33712) 2019-11-11 14:01:04 -08:00
platform-browser-dynamic feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
platform-server fix(ivy): ensure that the correct `document` is available (#33712) 2019-11-11 14:01:04 -08:00
platform-webworker fix(ivy): ensure that the correct `document` is available (#33712) 2019-11-11 14:01:04 -08:00
platform-webworker-dynamic feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
private/testing test: cleanup `document` "after" each test (#33712) 2019-11-11 14:01:04 -08:00
router build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
service-worker fix(service-worker): ensure initialization before handling messages (#32525) 2019-10-31 22:55:35 +00:00
upgrade build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
zone.js build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt build: bump year (#27880) 2019-01-11 11:15:59 -08:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
types.d.ts build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT