I've got a Typescript interface IBreadcrumbNavigation I'm exporting. I can use it in an Angular component with import { IBreadcrumbNavigation } from 'app/shared/interfaces/breadcrumbNavigation';
However, the component's module already imports a SharedModule. I'd like to put the IBreadcrumbNavigation interface in the SharedModule so that I don't need to explicitly import it into each component that wants to use it.
In my SharedModule I've got
import { IBreadcrumbNavigation } from './interfaces/breadcrumbNavigation';
@NgModule({
declarations: [
IBreadcrumbNavigation
],
exports: [
IBreadcrumbNavigation
]
})
export class SharedModule { };
TypeScript gives the error "'IBreadcrumbNavigation' only refers to a type, but is being used as a value here."
If I change IBreadcrumbNavigation from an interface to a class, the error goes away.
Is there a good fix to this, or do I just need to explicitly import the interface directly into each component?