Advertisement
Guest User

Untitled

a guest
May 30th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. class Typed<T> {
  2. type: T
  3.  
  4. constructor(obj: T) {
  5. this.type = obj;
  6. }
  7. }
  8.  
  9. interface MyType {
  10. prop: string;
  11. }
  12.  
  13. var instance = new Typed<MyType>({ prop: 'foo' });
  14.  
  15. console.log(instance.type.prop); // foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement