Skip to content

Abstract method called with callback #5591

Closed

Description

@HarelM

Hi,
I like typesctipt a lot and recently I updated my compiler to version 1.6.
I have some classes that were "abstract" and now I want to use the new keywork abstract
My question is as follow:
In order to scope the ``this` variable I used the following type of methods when calling them from JQuary/Angular promise:

export class SomeClass {
    public handleCallback = () => { 
        this.whatEver();
        //... 
    }
}

This will make sure that if I use this callback for an async operation the this variable will be correct.
How do I the same with abstract classes since I can't specify an abstract property?

Activity

  1. mhegazy commented on Nov 11, 2015

    @mhegazy
    Contributor

    looks like the same as #4669.

    The compiler does not check for property implementation in classes. you could mark the whole class as abstract, not sure if this helps.

    this is a new use case for abstract properties, and I would say we should reconsider the support for abstract properties.

  2. mhegazy commented on Jan 5, 2016

    @mhegazy
    Contributor

    closing as duplicate in favor of #4669.

  3. added
    DuplicateAn existing issue was already created
    and removed
    SuggestionAn idea for TypeScript
    on Jan 5, 2016
  4. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions