Hi, I’m totally new to angular 2 and typescript, i came from python and basic knowledge of ionic 1.
I’m trying to use wampy.js with no success, i cant build my app with wampy. And im using OSX El Capitan
I start de app with:
$ ionic start FOO sidemenu --v2 --ts && cd FOO && mkdir -p www/extlibs && wget https://raw.githubusercontent.com/KSDaemon/wampy.js/dev/build/wampy.js -O www/extlibs/wampy.js
Then, if I use: npm install --save @types/wampy
$ npm install --save @types/wampy
foo@ /Users/grizmio/Proyectos/ionic_beta/FOO
└── @types/wampy@2.0.18
npm WARN foo@ No repository field.
npm WARN foo@ No license field.
$ !find
find . -iname ‘wampy’
./node_modules/@types/wampy
./www/extlibs/wampy.js
then in page1.ts:
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import * as X from ‘wampy’;
@Component({
…
$ ionic run ios throws and error:
TypeScript error: FOO/app/pages/page1/page1.ts(3,20): Error TS2307: Cannot find module ‘wampy’.
If instead of npm install --save @typeswampy i use: $ typings install dt~wampy --global --save
and in page1.ts:
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import * as f from ‘wampy’;
@Component({
…
$ ionic run ios works
but, how can i use it?
export class Page1 {
w: wampy.wampy; // Error TS2305: Module ‘“wampy”’ has no exported member ‘wampy’.
w: wampy; // Error TS2305: Module ‘“wampy”’ has no exported member ‘wampy’.
Error TS2305: Module ‘“wampy”’ has no exported member ‘Wampy’.
constructor(private navController: NavController) {
if instead i use:
import {Wampy} from ‘wampy’;
…
w: Wampy; // Error TS2305: Module ‘“wampy”’ has no exported member ‘Wampy’.
i tried with: $ npm install wampy --save
but same errors.
if i import twampy with:
import wampy from ‘wampy’;
and use it with: “ws: wampy;” throws: Error TS2304: Cannot find name ‘wampy’.
all errors happen too with:
import * as wampy from ‘wampy’;
maybe knowing index.d.ts content structure could help you to “guess”/deduce my errors:
declare module “wampy” {
alotof interfaces
var wampy: WampyInstance;
export default wampy;
… }
ionic info:
Cordova CLI: 6.2.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.3.0
Xcode version: Xcode 7.3.1 Build version 7D1014
thanks