Skip to content

Instantly share code, notes, and snippets.

View thivatm's full-sized avatar
🐦
Follow me on Twitter @thivagar__

Thivagar thivatm

🐦
Follow me on Twitter @thivagar__
View GitHub Profile
import { url } from './services.js';
class CardComponent extends HTMLElement {
constructor (){
super();
const shadow = this.attachShadow({mode: 'open'});
const template = document.getElementById('card-view');
const templateInstance = template.content.cloneNode(true);
shadow.appendChild(templateInstance);
<ion-content padding>
<!-- #region value -->
<div class="contents">
<ion-row>
<ion-input type="number" class="value-input" [(ngModel)]="fromValue" placeholder="from" (keyup)="calculateCurrencyOne()"></ion-input>
</ion-row>
<ion-row>
<ion-input type="number" class="value-input" [(ngModel)]="toValue" placeholder="to" (keyup)="calculateCurrencyTwo()"></ion-input>
</ion-row>
@thivatm
thivatm / home.ts
Last active February 1, 2019 15:19
calculateCurrencyOne() {
this.toValue = this.fromValue * parseFloat(this.resultRate);
}
calculateCurrencyTwo() {
this.fromValue = this.toValue / parseFloat(this.resultRate);
}
@thivatm
thivatm / home.ts
Last active February 1, 2019 15:18
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { CurrencyService } from "../service/cu-service";
import { WheelSelector } from '@ionic-native/wheel-selector';
import { HttpClient } from '@angular/common/http';
import { isNumber } from 'ionic-angular/umd/util/util';
@Component({
selector: 'page-home',
@thivatm
thivatm / home.html
Created January 12, 2019 18:39
Write the skeleton straight of in the Home component of your app
<ion-content padding>
<div class="header">
<ion-row>
<p>Convert</p>
</ion-row>
</div>
<!-- #region Value Inputs -->
<div class="contents">
<ion-row>
<ion-input type="number" class="value-input"></ion-input>