import { Component } from '@angular/core';
import { NavController, ToastController } from 'ionic-angular';
import { AdditionProvider } from '../../providers/addition/addition';
var HTML_TEMPLATE = "\n<ion-header>\n  <ion-navbar>\n    <ion-title>\n      Ionic Blank\n    </ion-title>\n  </ion-navbar>\n</ion-header>\n\n<ion-content padding>\n  The world is your oyster.\n  \n\n  <ion-item>\n    <ion-label color=\"primary\" stacked>Value of A\n    </ion-label>\n    <ion-input type=\"number\" placeholder=\"enter value\" [(ngModel)]=\"value.a\">\n    </ion-input>\n  </ion-item>\n\n  <ion-item>\n    <ion-label color=\"primary\" stacked>Value of B</ion-label>\n    <ion-input type=\"number\" placeholder=\"enter value\" [(ngModel)]=\"value.b\"></ion-input>\n  </ion-item>\n\n  <button ion-button color=\"secondary\" (click)=\"Add()\">Addition</button>\n\n  <ion-item>\n    <ion-label color=\"primary\" stacked>{{ data }}</ion-label>\n  </ion-item>\n\n</ion-content>\n";
var CSS_STYLE = "\n.special-text {\n    font-weight: 800;\n    font-size: 15pt;\n    text-align: center;\n    color: #0000FF;\n}\n";
var HomePage = /** @class */ (function () {
    function HomePage(navCtrl, adder, toastCtrl) {
        this.navCtrl = navCtrl;
        this.adder = adder;
        this.toastCtrl = toastCtrl;
        this.value = {
            a: '',
            b: ''
        };
    }
    HomePage.prototype.Add = function () {
        console.log(this.value);
        this.data = parseInt(this.value.a) + parseInt(this.value.b);
        this.adder.Addition(this.value);
        this.presentToast();
    };
    HomePage.prototype.presentToast = function () {
        var toast = this.toastCtrl.create({
            message: 'User was added successfully',
            duration: 3000,
            position: 'top'
        });
        toast.onDidDismiss(function () {
            console.log('Dismissed toast');
        });
        toast.present();
    };
    HomePage.decorators = [
        { type: Component, args: [{
                    selector: 'page-home',
                    template: HTML_TEMPLATE
                },] },
    ];
    /** @nocollapse */
    HomePage.ctorParameters = function () { return [
        { type: NavController, },
        { type: AdditionProvider, },
        { type: ToastController, },
    ]; };
    return HomePage;
}());
export { HomePage };
//# sourceMappingURL=home.js.map