[英]Use npm JavaScript package in Ionic2 TypeScript project
I started my first project with Ionic2 (TypeScript) and need to use the npm JavaScript package. 我从Ionic2(TypeScript)开始了我的第一个项目,并且需要使用npm JavaScript包。 In my project I use https://github.com/huttarichard/instagram-private-api
在我的项目中,我使用https://github.com/huttarichard/instagram-private-api
I don't understand how can I properly import
a class instead the require
and how I should use values in constructor class. 我不明白如何正确地
import
类而不是require
以及如何在构造函数类中使用值。
var Client = require('instagram-private-api').V1;
var device = new Client.Device('someuser');
Greetings 问候
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.