Next-generation platformDeprecated

Importing components and directives from Core and Shared modules

You can import classes from Core and Shared modules by using relative paths as follows:

import { MashupService } from ‘./../../../../core/services/mashup.serviceʼ;
import { SortComponent } from ‘./../../../../shared/components/sort/sort.componentʼ;
However, such relative paths are not easy to read and would be invalid when the files are moved to a different location. To overcome this drawback, aliases to the Core and Shared modules are introduced, which allow you to define the path from base location, which is src. With this enhancement, the new import statement will appear as follows:

import { MashupService } from ‘@sim-core/services/mashup.serviceʼ;
import { SortComponent } from ‘@sim-shared/components/sort/sort.componentʼ;

Use @sim-core and @sim-shared to import services, components or directives from the Core and Shared modules respectively.