Created
May 10, 2017 02:37
-
-
Save pavei/224207495f288a29b32a3b9bc2b5cf7a 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 { Component } from '@angular/core'; | |
import { NavController } from 'ionic-angular'; | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
images = []; | |
grid = true; | |
constructor(public navCtrl: NavController) { | |
//adicionando 10 imagens randomicas no array images | |
for (var i = 0; i < 10; i++) { | |
this.images.push({url:'https://source.unsplash.com/random/800x600?i='+i}) | |
} | |
} | |
//para mudar de uma foto por linha | |
changeGrid(){ | |
this.grid = !this.grid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment