Currently, I am encountering a puzzling issue in my angular2 project using typescript. In my main.ts file, which contains a component along with some imports at the start of the file, there is a custom type class (let's call it TypeFoo) located in models/typeFoo.ts. Surprisingly, despite TypeFoo having no imports within typeFoo.ts, it can still be utilized in main.ts without requiring an import statement for typeFoo.ts. This behavior seems strange to me. However, as soon as I introduce an import statement in typeFoo.ts pointing to another file, main.ts starts throwing errors indicating that TypeFoo is no longer accessible. Can someone shed light on why this is happening?
main.ts
--models/typeFoo.ts
class TypeFoo {
name: string;
}