-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90a4009
commit 019fd73
Showing
8 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface ProdutoDTO { | ||
id: string; | ||
nome: string; | ||
preco: number; | ||
imageUrl?: string; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<ion-header> | ||
<ion-navbar> | ||
<button ion-button menuToggle> | ||
<ion-icon name="menu"></ion-icon> | ||
</button> | ||
<ion-title>Produtos</ion-title> | ||
</ion-navbar> | ||
</ion-header> | ||
|
||
<ion-content padding> | ||
<ion-list> | ||
<button ion-item *ngFor="let item of items"> | ||
<ion-thumbnail item-start> | ||
<img [src]="item.imageUrl || 'assets/imgs/prod.jpg'"> | ||
</ion-thumbnail> | ||
<h2>{{item.nome}}</h2> | ||
<p>{{item.preco | currency}}</p> | ||
</button> | ||
</ion-list> | ||
</ion-content> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from 'ionic-angular'; | ||
import { ProdutosPage } from './produtos'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ProdutosPage, | ||
], | ||
imports: [ | ||
IonicPageModule.forChild(ProdutosPage), | ||
], | ||
}) | ||
export class ProdutosPageModule {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
page-produtos { | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage, NavController, NavParams } from 'ionic-angular'; | ||
import { ProdutoDTO } from '../../models/produto.dto'; | ||
import { API_CONFIG } from '../../config/api.config'; | ||
|
||
@IonicPage() | ||
@Component({ | ||
selector: 'page-produtos', | ||
templateUrl: 'produtos.html', | ||
}) | ||
export class ProdutosPage { | ||
|
||
items : ProdutoDTO[]; | ||
|
||
constructor(public navCtrl: NavController, public navParams: NavParams) { | ||
} | ||
|
||
ionViewDidLoad() { | ||
this.items = [ | ||
{ | ||
id: "1", | ||
nome: 'Mouse', | ||
preco: 80.99 | ||
}, | ||
{ | ||
id: "2", | ||
nome: 'Teclado', | ||
preco: 100.00 | ||
} | ||
] | ||
}; | ||
} |