How to import Parse Js sdk into ionic 2 app

down vote
am trying to import JS sdk into ionic 2 app, but i keep getting parse is undefined

In ionic 1.x ,parse js sdk is loaded via

<script ..parse.js </script>

and exposed as a global var, how do import in ionic 2 ,am using the npm module ,and tried

import * as parse from 'parse'

No need to import. Just do the same as in ionic 1.

really , i assumed using the npm module ,that required tanks would try

Just add the script before appbundle.

Inside IONIC 2 Project - Working with 1.9.2 Parse JDK

Install Parse through NPM

npm install parse --save

Then Navigate to

cd node-modules/parse/

Install dependencies

npm install --save utf-8-validate
npm install --save bufferutil

And Import in your First Page

var Parse = require('parse/node');

Initialize in the Export Class

Parse.serverURL = 'http://<your_ip>:1337/parse'

Do npm install parse --save in your project directory

Then import parse using

import { Parse } from 'parse';

It is better to create a parse provider.

You can use this starter template as a guide. It is a simple GameScores application in ionic to get you started.

It shows how to create and read data from parse server. I also includes paging with ion-infinite-scroll scrolling.