I am a fresher in IBM MobileFirst 8.0. How to use IBM MFP functions(WL, WLResourceRequest) in ionic 2 projects?
I have created an Ionic Project and added MFP plugin and I added the below lines into Home Component TS file.
WL.Client.setSharedToken({key: "name", value: "Karhik"});
let str: String = WL.Client.getSharedToken({key: "name"});
console.log(str);
But I am getting the below error. How to solve the issue. Or given any reference documents for Ionic 2 + IBM MFP 8.0
And I tried to like this below. But same error is returned,
Home.ts
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Device } from '@ionic-native/device';
declare var wlCommonInit: () => {
};
declare var WL;
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [ Device ]
})
export class HomePage {
constructor(public navCtrl: NavController, private device: Device) {
console.log("device platform " + device.platform);
WL.Client.setSharedToken({key: "name", value: "Karhik"});
let str: String = WL.Client.getSharedToken({key: "name"});
console.log(str);
}
wlCommonInit() {
console.log("wlCommonInit TRIGGERED");
}
}
But it not working. I need to know how to use IBM MFP 8.0 in IONIC 2
After adding the code into Main.ts Below error is returned in console.