I want to use some function of my sample.js
file which is located in my src
folder:
var jsdata = new Object();
jsdata.getItem = function (pType, pIndex) {
...
};
Now in my controller typescript file I want to access this:
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-test',
templateUrl: 'test.html',
})
export class TestPage {
item: any[];
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.item = jsdata.getItem('A', 1);
}
ionViewDidLoad() {
console.log('ionViewDidLoad TestPage');
}
}
But jsdata is unkonwn. How to fix this?