Skip to content

Instantly share code, notes, and snippets.

@simoales
Created September 22, 2016 13:41
Show Gist options
  • Save simoales/453eb261b1aceb1d4c0ee04191ebeee4 to your computer and use it in GitHub Desktop.
Save simoales/453eb261b1aceb1d4c0ee04191ebeee4 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { FiltroPaperiPipe } from "./paperi/paperi-filtro.pipe"
//@component is a decorator that contains metadata and template. In this case an URL
//all'interno un oggetto con le sue proprietà {}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title : string = 'Lista dei Paperi';
mostraFoto: boolean = false;
testoPulsante: string = "Mostra Foto";
filtro: string = "";
paperi: any[] =[
{
"paperoId": 1,
"nome": "Paperino",
"citta": "Paperopoli",
"voto":9,
"imageUrl": "./app/paperi/paperino.png"
},
{
"paperoId": 2,
"nome": "Gastone",
"citta": "Paperopoli",
"voto":6,
"imageUrl": "./app/paperi/gastone.png"
},
{
"paperoId": 3,
"nome": "Nonna Papera",
"citta": "Paperopoli",
"voto":8,
"imageUrl": "./app/paperi/nonnapapera.png"
},
{
"paperoId": 4,
"nome": "Paperoga",
"citta": "Paperopoli",
"voto":5,
"imageUrl": "./app/paperi/paperoga.png"
}
]
azionaImmagine() : void {
this.mostraFoto = !this.mostraFoto;
this.mostraFoto ? this.testoPulsante = "Nascondi Foto": this.testoPulsante = "Mostra Foto";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment