Question: Suppose I have an Angular2 typescript solution that is growing in size. I have many small classes/objects and following the best practice I place each class in its own file.

If i need to manipulate these objects i often end up with long lists of imports like this:

```
import {Object1} from '../core-data/object1';
import {Object2} from '../core-data/object2';
import {Object3} from '../core-data/object3';
import {Object4} from '../core-data/object4';
import {Object5} from '../core-data/object5';

```

And i wish i could do something like:

```
import {Object1, Object2, Object3, Object4, Object5} from '../core-data/CORE_OBJECTS';

```

I tried using the pattern the Angular team is using for `CORE_DIRECTIVES` but it seems it only works because those are added through the `directives` property on the `Component` annontation.

I don't really want to bundle it/make a new project for it since it will make the whole process harder - it's just some core objects i want to be able to adjust without too much hassle.

What is the best way to handle this?

Answer: 
You could leverage the `export from` feature of Angular2.

For example in a `core.objects.ts` file:

```
export {Object1} from '../core-data/object1';
export {Object2} from '../core-data/object2';
export {Object3} from '../core-data/object3';
export {Object4} from '../core-data/object4';
export {Object5} from '../core-data/object5';

```

Then you can leverage the `core.objects` module this way;

```
import {
  Object1, Object2, Object3, Object4, Object5
} from '../core-data/core.objects';

```
Not trying to hijack your answer, just providing some extra information i found:

If you create an `index.ts` in the `/core-data` folder and make its content this:

```
export * from './core-terms';

```

Then you can get a slightly simpler import statement like this:

```
import { Object1, Object2, Object3, Object4, Object5 } from '../core-data/';

```

No need to specify both the folder and the file containing the joined exports :)

EDIT: This still requires the core-terms.ts file to contain the exports. You could substitute the export with the one from the core-terms.ts file so you don't need the extra file. You could also leave it and then perhaps as the core-data folder grows, create more sub division files and concat all the sub files in the index.ts. That way index.ts holds ALL classes, where you could sub divide the classes in a core-terms.ts core-components.ts core-whatever.ts...