Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract method called with callback #5591

Closed
HarelM opened this issue Nov 10, 2015 · 2 comments
Closed

Abstract method called with callback #5591

HarelM opened this issue Nov 10, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@HarelM
Copy link

HarelM commented Nov 10, 2015

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?

@mhegazy
Copy link
Contributor

mhegazy commented Nov 11, 2015

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.

@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels Nov 11, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Jan 5, 2016

closing as duplicate in favor of #4669.

@mhegazy mhegazy closed this as completed Jan 5, 2016
@mhegazy mhegazy added Duplicate An existing issue was already created and removed In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Jan 5, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants