Skip to content

Instantly share code, notes, and snippets.

View justinramel's full-sized avatar

Justin Ramel justinramel

View GitHub Profile
<ion-navbar *navbar>
<ion-title>Today</ion-title>
</ion-navbar>
<ion-content class="today">
<ion-card>
<ion-item>
<button clear (click)="prevDay()" item-left>
<icon rewind></icon>
</button>
import {Page} from 'ionic/ionic';
import {Calculate} from '../../services/calculate';
import {Dates} from '../../services/dates';
@Page({
templateUrl: 'build/pages/today/today.html',
providers: [Calculate, Dates]
})
export class Today {
import {Page, Modal, NavParams} from 'ionic/ionic';
import {TransactionsService} from './transactions.service';
@Page({
templateUrl: 'build/pages/transactions/input-modal.html',
providers: [TransactionsService]
})
export class TransactionInputModal {
constructor(modal: Modal, params: NavParams, transactionsService: TransactionsService) {
this.modal = modal;
import {Page, Modal} from 'ionic/ionic';
import {TransactionInputModal} from './input-modal';
import {TransactionsService} from './transactions.service';
import {ToFloat} from '../../pipes/to-float';
import {DirectionIcon} from '../../components/direction-icon';
@Page({
templateUrl: 'build/pages/transactions/transactions.html',
providers: [TransactionsService],
pipes: [ToFloat],
import {CustomStorage} from '../../storage/custom-storage';
import * as _ from 'lodash';
export class TransactionsService {
constructor() {
this.storage = new CustomStorage();
this.createTransactionsTableIfItDoesNotExist();
}
all() {
import {Pipe} from 'angular2/core';
import * as _ from 'lodash';
@Pipe({
name: 'toFloat'
})
export class ToFloat {
transform(value, args) {
if (value === null || value === undefined || _.trim(value) === '') {
return 0;
import {Pipe} from 'angular2/core';
import * as _ from 'lodash';
@Pipe({
name: 'toInteger'
})
export class ToInteger {
transform(value, args) {
if (value === null || value === undefined || _.trim(value) === '') {
return 0;
import {Component} from 'angular2/core';
import {IONIC_DIRECTIVES} from 'ionic/ionic';
@Component({
selector: 'direction-icon',
template: `
<button clear secondary *ngIf="direction === 'In'"><icon thumbs-up></icon></button>
<button clear danger *ngIf="direction === 'Out'"><icon thumbs-down></icon></button>
`,
directives: [IONIC_DIRECTIVES],
import {Page, Modal} from 'ionic/ionic';
import {InputModal} from './input-modal';
import {RatesService} from './rates.service';
import {ToInteger} from '../../pipes/to-integer';
import {ToFloat} from '../../pipes/to-float';
import {DirectionIcon} from '../../components/direction-icon';
@Page({
templateUrl: 'build/pages/rates/rates.html',
providers: [RatesService],
import {CustomStorage} from '../../storage/custom-storage';
import * as _ from 'lodash';
export class RatesService {
constructor() {
this.storage = new CustomStorage();
this.createRatesTableIfItDoesNotExist();
}
all() {