Eduard Arevshatyan
Eduard Arevshatyan

Reputation: 678

Import of any files in angular 2

I install some utilite with command npm install utilite in my angular 2 application. And when i import this utilite in my app.module.ts, like this:

import { Utilite } from "utilite/utilite";

i've got error of not found module. Tell me please, how to write a right import of any modules from node_modules.

Upvotes: 0

Views: 114

Answers (1)

Piotr Stulinski
Piotr Stulinski

Reputation: 9471

Try the following:

import utilite from 'utilite';

The syntax

import { Utilite } from "utilite/utilite";

Will only work if that module explicitly export "Utilite"

Examples of this with moment library:

import moment from 'moment';

Upvotes: 1

Related Questions