node.js - How to Structure a TypeScript Project like in Java with Modules and Dependencies? -


i have problem typescript , how separate modules , import them.

in java maven or gradle, can have 3 modules or projects where:

project-dao: data access object classes project-dto: data transfer object classes project-services: services classes

project-dto transversal dao , services, can include module project dependency in both.

in typescript don't know how make same. see examples imports of compiled code in javascript relative paths or using npm publish later install in project.

someone can me approach issue.

thanks.

@paolo : hope question creating different modules , importing them root module. if that's case, can create new module @ngmodule annotation. if want load module root module, import in app.module.ts as

import {custommodule} './custom.module';  

if want load lazily, include routing, loadchildren property. but, if class that's declared in module, whether app module, @ngmodule, or third-party module, not add declaration.

from dto's perspective, guess, need create incline object

var userobject = {   email : req.body.email,   password: req.body.password }. 

userobject can passed next layer.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -