How to refer utility javascript files in Ionic 2 project?


#1

I have created ionic 2 project, in that I have added login module which uses hellojs for facebook oauth. HelloJs is jquery file.

How I can add its reference in my module ?


#2

try this,

import {Hellojs} from './pages/services/hellojs';

@App({
  template: '<ion-nav swipe-back-enabled="true" [root]="mainPage"></ion-nav>',
  providers: [Hellojs],
  config: {} 
})

and in the files u need to use this module,

import {Hellojs} from '../services/hellojs';


@Page({
  templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
    constructor( hellojs: Hellojs) {
        this.hellojs = hellojs;
    }