Define empty callback that can be implemented by client typescript
Answers
Answered by
0
Before learning Angular 2, I had never looked at TypeScript. And now, with Angular 2, I've still not sat down to read the manual - I've just been sort of learning TypeScript as I go, looking up TypeScript features as needed. One TypeScript feature that tripped me up recently was defining an interface for a Function or a Callback. Typically, when I'm writing Angular 2, I'm defining interfaces for complex data types; but, I ran into a situation where one method accepted another method and I didn't know how to "type" that callback argument properly. So, I figured I would share what I learned about defining Function / Callback interfaces in TypeScript.
Similar questions