how to use namespace in typescript

196 Views Asked by At

File1.ts

namespace ServiceUrls {
     export class ServiceUrls {
     static baseUrl: string = 'http://localhost:52949/V1/';
          static baseImageUrl: string = 'http://localhost:52949/';
          static baseClientUrl: string = 'http://localhost:58082/'
          static resetPasswordlinkUrl: string = 'http://localhost:52949/#/Resetpassword';

     }
}

File2.ts

 namespace ServiceUrls {
    export class ServiceUrls {
        static baseUrl: string = 'http://98.142.86.22/EMSDEMOAPI/V1/';
        static resetPasswordlinkUrl: string = 'http://98.142.86.22/EMS/#/Resetpassword';
        static baseClientUrl: string = 'http://98.142.86.22/EMS/';
        static baseImageUrl = 'http://98.142.86.22/EMSDEMOAPI/';    
    }
}

How to maintain two classes under same namespace like partial class in c#. Its giving error if we have same class name in typescript as duplicate identifier.

Can anyone know how to resolve this issue ?

0

There are 0 best solutions below