Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request : use of namespaces and module togeher #5312

Closed
xmehaut opened this issue Oct 18, 2015 · 2 comments
Closed

Feature request : use of namespaces and module togeher #5312

xmehaut opened this issue Oct 18, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@xmehaut
Copy link

xmehaut commented Oct 18, 2015

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.

@DanielRosenwasser
Copy link
Member

I believe this is a duplicate of #2956.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Oct 18, 2015
@xmehaut
Copy link
Author

xmehaut commented Oct 19, 2015

Thx for the answer
If currying or partial définition is not planned, maybe the following syntactic ability could be easily implemented, ie if the last argument of a function is a closure , be able to extra ct it from the arguments to be able to write such a thing
´´´
aList.map (a)=>{ somethingtodo}
´´´
Or even
´´´
div(className=´toto') {
Somethingtodo
}
´´´

Envoyé de mon iPhone

Le 19 oct. 2015 à 01:19, Daniel Rosenwasser [email protected] a écrit :

Closed #5312.


Reply to this email directly or view it on GitHub.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants