Created
July 24, 2016 10:45
-
-
Save saurabhvyas/3d7308dbd99c8623a1e663728879dec0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import{Http,Response,Jsonp} from'@angular/http'; | |
import {NavController, Alert} from 'ionic-angular'; | |
import {HomePage} from '../../pages/home/home'; | |
import {LoginPage} from '../../pages/login/login'; | |
import * as firebase from 'firebase'; | |
@Injectable() | |
export class DataService { | |
private db:any; | |
private api_url="https://jobs.github.com/positions.json?description=python&location=new+york"; | |
constructor(){ | |
this.db=firebase.database(); | |
} | |
getdetails(){ | |
firebase.database().ref('/userProfile').child(firebase.auth().currentUser.uid).on('value',(data)=>{console.log(data);} | |
,(err)=>{console.log(`err is ${err}`); | |
} | |
) | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from '@angular/core'; | |
import {NavController} from 'ionic-angular'; | |
import {AuthData} from '../../providers/authdata/authdata'; | |
import {DataService} from '../../providers/data/data'; | |
import {LoginPage} from '../login/login'; | |
@Component({ | |
templateUrl: 'build/pages/home/home.html', | |
providers:[DataService], | |
}) | |
export class HomePage { | |
private loginpage:any; | |
public data:any; | |
private errormessage:any; | |
handler=()=>{ | |
this.dataService.getdetails(); | |
} | |
constructor(private nav: NavController,private dataService:DataService) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment