Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Added icon and improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeissner-scottlogic committed Apr 7, 2016
1 parent 9b82588 commit fd9a091
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Binary file added assets/frameworks/nativescript.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions nativescript/app/components/property-listing.component.ts
Expand Up @@ -25,8 +25,11 @@ export class PropertyListingComponent {
this.listing = _searchResultsModel.getListingByGuid(guid);
}
let bedroomSuffix = (this.listing.bedroom_number > 1) ? "s" : "";
let bathroomSuffix = (this.listing.bathroom_number > 1) ? "s" : ""
this.rooms = this.listing.bedroom_number + " bedroom" + bedroomSuffix + ", " + this.listing.bathroom_number + " bathroom" + bathroomSuffix;
let bathroomSuffix = (this.listing.bathroom_number > 1) ? "s" : "";
this.rooms = this.listing.bedroom_number + " bedroom" + bedroomSuffix
if(this.listing.bathroom_number) {
this.rooms += ", " + this.listing.bathroom_number + " bathroom" + bathroomSuffix;
}
}

addToFavourites() {
Expand Down
2 changes: 1 addition & 1 deletion nativescript/app/components/property-search.component.ts
Expand Up @@ -80,7 +80,7 @@ export class PropertySearchComponent {

private processSearchResponse(response: Observable<any>) {
response.subscribe(res => {
if(res.application_response_code === "100" || res.application_response_code === "101" || res.application_response_code === "110") {
if(res.application_response_code.substr(0,1) === "1") {
if (res.listings.length > 0) {
let location: SimpleLocation = { key: res.locations[0].place_name, name: res.locations[0].long_title }
this.addRecentLocation({ location: location, results: res.total_results });
Expand Down

0 comments on commit fd9a091

Please sign in to comment.