6

files.ts

export class ServiceUrls {
 static baseUrl: string = 'http://localhost:52949/V1/';
    static baseImageUrl: string = 'http://localhost:52949/';
}

filess1.ts

extends interface  ServiceUrls{
 static baseUrl: string = 'http://localhost:52949/V1/';
    static baseImageUrl: string = 'http://localhost:52949/';
}

How to implement partial class in typescript.How should i give reference of same class to make it work like partial class.If i give same class name in files1.ts its giving error declaration or statement expected.

  • https://github.com/Microsoft/TypeScript/issues/563 – user581157 May 29 '17 at 12:06
  • 2
    Possible duplicate of [How do I split a TypeScript class into multiple files?](https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files) – 8eecf0d2 Jan 23 '18 at 23:07

1 Answers1

2

I created and I'm using @partial decorator acts as a simplified syntax that may help divide functionality of a single class into multiple class files ... https://github.com/mustafah/partials

Mustafah
  • 4,447
  • 2
  • 24
  • 24