Skip to content

Feature request : use of namespaces and module togeher #5312

Closed
@xmehaut

Description

@xmehaut

I would suggest to be able to use namespaces with modules.

dummy1.ts file :

namespace MyLib {
   export class Dummy1{
       constructor(public name:string, public surname:string) {};
   }
}

dummy2.ts file :

namespace MyLib {
   export class Dummy2{
       constructor(public name:string, public surname:string) {};
   }
}

main.ts file :

import {Dummy1, Dummy2} from 'mylib'
function main() {
   let dum1= new Dummy1("sds", "sdsq");
   let dum2= new Dummy2("sf", "sdsfd");
}

By doing this, we could directly call exported data from common namespace by just calling the namespace in the import statement.

Furthermore, the code generator could generate only one mylib.js file containing the Dummy1 and Dummy2 classes with system.js convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions