Ionic 2 RC0/RC1 and own TypeScript definition


#1

Hi,

I’m using a large inhouse coded JavaScript lib in my project. In Ionic 2 Beta 12 I’ve installed Typings and add my own d.ts file. As Typings is not used anymore in RC0/RC1 this way does not work anymore. So what’s the correct way of adding own TypeScript definitions? I can’t use the @types repository and add my own definition…company rules for that lib :-/.

Thanks for helping!


#2

When it goes to migrating my own typings from Beta to RC, first I try to have a look at ionic-native to see if now the definition I had written is still necessary. If yes, I just put the definition file (.d.ts) into the provider folder (actually a created a subfolder types under src/provider). Doing so, my own definition files are resolved. Don’t know if it’s the best practice, but that works for me.


#3

In fact im trying to do that. I have my definition file under src/definitions but when the app is running I get an function is not defined error.


#4

Ahhh…forget. I’m just some kind of dump. I’ve forgotten to add the lib in the index.html file.

Thanks for helping !


#5

No worries. Just for the record, I didn’t had to modify index.html when I added my .d.ts to providers, in case that would be more convenient


#6

I meant the JavaScript File. It’s frontend code…don’t tell…I don’t like it anyway.