Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
How to import one namespace inside another in Typescript ( files used inside - ASP.NET Razor project )

I have two namespaces

namespace1:

file1.ts

///<reference path="./file2" />
import * as NameSpace2 from './file2';
    export namespace namespace1 {

        export class Class1 {
            constructor(){}         
            public sayHello(){
            console.log("Hello");
            }
      
        }

    }

file2.ts

namespace 2:

export namespace namespace2 {

export class Class2 {
    constructor(){}         
    public sayHi(){
    console.log("Hi");
    }

}

}

I want to use the namespace 2 within 1.

After doing the above I got the error:

Import declarations in a namespace cannot reference a module.

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use references in the file to let node know what to compile together

Add the includes in the .csproj

In the .ini file, add the bundle using registry. this will let you add the dependencies in other files.

almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!