Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

'this' points to Window instead of directive object in 'link' function #12891

@zgmnkv

Description

@zgmnkv

Hi guys,
I'm trying to use TypeScript with AngularJS and I faced to some issues when I tried to use class for directive definition.
Inside 'link' function of directive, 'this' does not point to the current directive definition object. Instead, 'this' points to global 'Window'. So I can't fully use TypeScript classes with inheritance for directives, which may be very useful for code reuse.
What's the reason of such behavior?
Could this issue be fixed?
This plunker demonstrates the issue: http://plnkr.co/edit/lCH5zOUSHkLi0WQ7G4GX?p=preview .
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions