Created
February 1, 2016 16:07
-
-
Save ccoenraets/dfe759c63827647f93c2 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 {OnInit} from 'angular2/core'; | |
import {Page, NavController, NavParams} from 'ionic/ionic'; | |
import {PropertyDetailsPage} from '../property-details/property-details'; | |
import {PropertyService} from '../../services/property-service'; | |
@Page({ | |
templateUrl: 'build/pages/property-list/property-list.html' | |
}) | |
export class PropertyListPage { | |
constructor(nav:NavController, navParams:NavParams, propertyService:PropertyService) { | |
this.nav = nav; | |
this.propertyService = propertyService; | |
this.selectedItem = navParams.get('item'); | |
} | |
ngOnInit() { | |
this.propertyService.findAll().then(data => this.properties = data); | |
} | |
itemTapped(event, property) { | |
this.nav.push(PropertyDetailsPage, { | |
property: property | |
}); | |
} | |
} |
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 'angular2/core'; | |
import {PROPERTIES} from './mock-properties'; | |
@Injectable() | |
export class PropertyService { | |
findAll() { | |
return new Promise((resolve, reject) => { | |
resolve(PROPERTIES); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment