Skip to content

Property Math is missing on Window interface #9325

Closed
@zuzusik

Description

@zuzusik

TypeScript Version:

1.8.10

Code

window.Math.round(1.35);

Expected behavior:
compiled

Actual behavior:
error TS2339: Property 'Math' does not exist on type 'Window'

PS: Math.round(1.35) works as expected, but I want to access it from window in order to be able to mock this method in Angular unit tests by mocking $window service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptWorking as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions