docs(glossary): export in barrels
closes #1326 The example is about exports, so no imports here
This commit is contained in:
parent
cc450ad6e8
commit
aaa927bc43
@ -72,8 +72,8 @@ include _util-fns
|
|||||||
:marked
|
:marked
|
||||||
We can add a barrel to the `heroes` folder (called `index` by convention) that exports all of these items:
|
We can add a barrel to the `heroes` folder (called `index` by convention) that exports all of these items:
|
||||||
code-example(format='').
|
code-example(format='').
|
||||||
import * from './hero.model.ts'; // re-export all of its exports
|
export * from './hero.model.ts'; // re-export all of its exports
|
||||||
import * from './hero.service.ts'; // re-export all of its exports
|
export * from './hero.service.ts'; // re-export all of its exports
|
||||||
export { HeroComponent } from './hero.component.ts'; // re-export the named thing
|
export { HeroComponent } from './hero.component.ts'; // re-export the named thing
|
||||||
:marked
|
:marked
|
||||||
Now a consumer can import what it needs from the barrel.
|
Now a consumer can import what it needs from the barrel.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user