It all comes down to what you are bringing into your project...
If you're importing a CLASS
... the answer is YES .. here's an example:
export class User{
public name:string;
public surname:string;
}
then in another ts file:
import { User } from '../../User';
let user= new User();
user.name= 'Fred';
user.surname = 'Scamuzzi';
IF you're importing an INTERFACE
.. then it's a NO:
for instance
import { OnInit } from '@angular/core';
import { User } from '../../User';
export class AppComponent implements OnInit { // --> it requires you to implement the method declared in OnInit interface
ngOnInit(): void { // implemented
let currentUser = new User();
}
}
Similarly, when importing a Component in NgModule for declaration, you can simply do:
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { AppComponent } from './app.component';
import {AuthService} from './shared/services/AuthService.service';
@NgModule({
imports: [
BrowserModule,
HttpClientModule
],
declarations: [
AppComponent
],
providers: [
AuthService
],
bootstrap: [AppComponent]
})
export class AppModule {
}
I trust this clarifies things for you ....