no message
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user