completed popover with appropriate denomination units

This commit is contained in:
Darren Nelsen 2018-01-30 17:04:25 -05:00
parent 66e8cbc911
commit b233467c6e
2 changed files with 28 additions and 12 deletions

View File

@ -1,4 +1,10 @@
<!-- Generated template for the DenominationComponent component -->
<div>
{{text}}
</div>
<ion-list radio-group [(ngModel)]="currency.currencySymbol">
<ion-list-header>
Units
</ion-list-header>
<ion-item *ngFor="let unit of units">
<ion-label color="dark">{{ unit }}</ion-label>
<ion-radio value="{{ unit }}" (click)="close()"></ion-radio>
</ion-item>
</ion-list>

View File

@ -1,11 +1,7 @@
import { Component } from '@angular/core';
import { CurrencyProvider } from '../../providers/currency/currency';
import { ViewController } from 'ionic-angular';
/**
* Generated class for the DenominationComponent component.
*
* See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
* for more info on Angular Components.
*/
@Component({
selector: 'denomination',
templateUrl: 'denomination.html'
@ -13,10 +9,24 @@ import { Component } from '@angular/core';
export class DenominationComponent {
public text: string;
public units: any = [];
constructor() {
console.log('Hello DenominationComponent Component');
constructor(
public currency: CurrencyProvider,
public viewCtrl: ViewController
) {
this.text = 'Hello World';
this.units = [
'USD',
this.currency.defaultCurrency,
'm' + this.currency.defaultCurrency,
'bits'
];
}
public close(): void {
console.log('hey, closing');
this.viewCtrl.dismiss();
}
}