0

this is my project structure:

app ->
    Core ->
        Client.ts
        ClientCollection.ts

Client.ts:

namespace Core {
    export class Client { }
}

ClientCollection.ts:

namespace Core {
    export class ClientCollection {

        public client: Client; 
    }
}

I want to define a variable in ClientCollection from the kind of Client.

I use the /// <reference path = "Client.ts" /> but get me this error: Cannot find name 'Client'

How can I do it?

Nothehi
  • 695
  • 6
  • 19
  • 1
    Read this before using namespaces https://stackoverflow.com/questions/30357634/how-do-i-use-namespaces-with-typescript-external-modules/30357635#30357635 – Aleksey L. Oct 18 '20 at 12:06
  • Are these supposed to be global scripts? Why not use modules? – Bergi Oct 18 '20 at 12:47
  • You are defining global namespaces. Ideally you should not receive that error! – MBB Oct 18 '20 at 20:05
  • Side topic - the statement "public client: Client;" will give error -Property 'client' has no initializer and is not definitely assigned in the constructor.ts(2564) – MBB Oct 18 '20 at 20:08

0 Answers0