3

I tried installing paperjs by using the command

sudo npm install paper

in my angular app folder. Paper seems to appear in node_modules folder, however when I try to import it using

import { Paper } from '@paper'

it doesn't find paper module. How do I include the paper module in angular2?

Mark
  • 8,408
  • 15
  • 57
  • 81

2 Answers2

4

I did the following to get it working:

npm install paper --save
npm install @types/paper --save

In systemjs.comfig.js add a map for paper

map:
    ...

    'paper': 'npm:paper/dist/paper-core.js'
},

In the component

import { PaperScope, Path, Point } from 'paper';
moonpatrol
  • 1,202
  • 11
  • 15
0

Following this thread there is no official typescript support yet. However, there is an unofficial typescript definition for paperJS here

andreaspfr
  • 2,298
  • 5
  • 42
  • 51