mjanisz1
mjanisz1

Reputation: 1516

Swiper typings to angular2

Im trying to import typings for swiper to angular2.

I've installed swiper and its typings via npm, but in my component when I include swiper

import { Swiper } from 'swiper';

atom shows error:

path/../@types/swiper/index.d.ts is not a module

Is it possible that the typings are badly declared or is it my fault?

Upvotes: 3

Views: 849

Answers (1)

Roberts Slisans
Roberts Slisans

Reputation: 194

When it comes to module errors the 1.2.3 is:

  1. save the file (continue if persists)
  2. close the file tab, reopen the file tab
  3. restart the IDE
  4. run tsc to see if it also has a problem
  5. check the index.d.ts for validness (case by case)
  6. if all else fails, delete the typings and stub your own 'empty module' in, say, index.d.ts in your src/ folder

Upvotes: 0

Related Questions