How to install and import paperjs for Angular 2?

你说的曾经没有我的故事 提交于 2019-12-05 21:03:16

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';

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!