Skip to content

Use an injected DOCUMENT instead of the global 'document' object #22093

Closed

Description

@sis0k0

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

The following code in @angular/animations package is assuming that a global 'document' object exists:

export function getBodyNode(): any|null {
if (typeof document != 'undefined') {
return document.body;
}
return null;
}

Expected behavior

Using an injected DOCUMENT object instead.

What is the motivation / use case for changing the behavior?

There is no global 'document' object in NativeScript. Defining a polyfill causes troubles with other node packages that will try to use specific methods from it.

Environment

Angular version: 5.2.4

Related to NativeScript/nativescript-angular#1144

Activity

  1. added
    area: animationslegacy animations package only. Otherwise use area: core.
    on Feb 13, 2018
  2. added this to the needsTriage milestone on Feb 26, 2018
  3. matsko commented on May 1, 2018

    @matsko
    Contributor

    This guy fixes it: #23300

  4. modified the milestones: needsTriage, Backlog on May 1, 2018
  5. sis0k0 commented on Jul 2, 2018

    @sis0k0
    ContributorAuthor

    Fixed with #23300 in @angular/animations v6.1.0-beta.3. 10x!

  6. angular-automatic-lock-bot commented on Sep 13, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions