-
-
Save lx4r/2d2ed765c7fe937796917222afc9826a 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 {Page,NavController, NavParams} from 'ionic-angular'; | |
import {OnInit} from 'angular2/core'; | |
import {GameService} from "../../../services/game-service"; | |
import {SettingsService} from "../../../services/settings-service"; | |
import {Game} from "../../../interfaces/game"; | |
import {GameDetails} from "../../../interfaces/game-details"; | |
import {Http, Headers, Response} from 'angular2/http'; | |
@Page({ | |
templateUrl: 'build/pages/details/details.html', | |
providers: [GameService, SettingsService] | |
}) | |
export class DetailsPage implements OnInit{ | |
game: Game; | |
gameDetails: GameDetails; | |
constructor (private _gameservice: GameService, private _settingsservice: SettingsService, private _nav: NavController, private _navParams: NavParams){ | |
this.game = _navParams.get('game'); | |
this.gameDetails = { | |
sellerCountry: "Loading", | |
} | |
} | |
ngOnInit(){ | |
this._gameservice.getDetails(this.game).then( | |
data => { | |
console.log("ngOnInit started"); | |
let a: Response = <Response>data; | |
this.gameDetails = a.json(); | |
console.log(this.gameDetails); | |
} | |
); | |
} | |
test(){ | |
this.gameDetails = { | |
sellerCountry: "Loading2" | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment