Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Declaring one variable and use this common variable in all pages

$
0
0

In ionic v1 I was declaring my global variables in app.js but I am not getting any picture where to declare my global variable in ionic v2.

Particular I want to declare a puchdb variable and use it in all js.

var localDB = new PouchDB("dbname");
var remoteDB = new PouchDB("http://username:password@192.168.1.79:5984/dbname");

I was declaring it bellow the following line and using in external controllers and services js file. But here I am confused. There must be some way.

var app = angular.module('starter', ['ionic']);


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>