no message

This commit is contained in:
2018-03-06 03:12:07 -05:00
parent 263aae54b4
commit e3a9e4badc
3 changed files with 12 additions and 7 deletions

View File

@@ -1,9 +1,7 @@
<ion-content no-padding> <ion-content no-padding>
<ion-grid no-padding> <ion-grid>
<ion-row align-items-stretch> <ion-row align-items-stretch>
<ion-col col-4 *ngFor="let current of profiles" (tap)="profileTapped($event, current)"> <ion-col col-4 *ngFor="let current of profiles" (tap)="profileTapped($event, current)" [style.backgroundImage]="getBackgroundThumbnail(current.details.pic)"></ion-col>
<img [src]="current.details.pic.thumb">
</ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-content> </ion-content>

View File

@@ -1,7 +1,9 @@
page-grid { page-grid {
ion-col { .col {
box-sizing: border-box; background-size: cover;
border: 1px solid #000000; border: 1px solid #000000;
box-sizing: border-box;
padding: 0 0 33%;
} }
} }

View File

@@ -1,4 +1,5 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { NavController } from 'ionic-angular'; import { NavController } from 'ionic-angular';
import { ProfileService } from '../../services/profiles'; import { ProfileService } from '../../services/profiles';
@@ -13,12 +14,16 @@ export class GridPage {
profiles: any; profiles: any;
constructor(public navCtrl: NavController, public profileService: ProfileService) { constructor(public navCtrl: NavController, public profileService: ProfileService, private _sanitizer: DomSanitizer) {
profileService.load().then((data) => { profileService.load().then((data) => {
this.profiles = data; this.profiles = data;
}); });
} }
getBackgroundThumbnail(pics) {
return this._sanitizer.bypassSecurityTrustStyle('url(' + pics.thumb + ')');
}
profileTapped(event, profile) { profileTapped(event, profile) {
this.navCtrl.push(ProfilePage, { this.navCtrl.push(ProfilePage, {
profile: profile profile: profile