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
<ion-header> | |
<ion-navbar> | |
<ion-title>Home</ion-title> | |
</ion-navbar> | |
</ion-header> | |
<ion-content padding class="home"> | |
<ion-list> | |
<ion-item> | |
<ion-label>Something</ion-label> |
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
import gcm = require('node-gcm'); | |
let sender = new gcm.Sender('YOUR_GCM_SENDER_ID'); // this is basically your API key | |
function sendPushNotification(message, gcmIds){ | |
sender.send(message, {registerationTokens: gcm_ids}, (err, response) => { | |
if(err) console.log(err); | |
console.log(response); | |
}); |
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
changeAvatar(): void { | |
let handler: Function = (source: number) => { | |
let updateAvatar: Function = (image_url?: string) => { | |
this.api.post('user/avatar', {image_url: image_url}) | |
.then( | |
()=> { | |
this.events.publish('auth:status', true); | |
this.updateUserInfo(); | |
}, | |
(e)=>console.error(e) |
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
import { Component, AfterViewInit, Input, Output, EventEmitter } from '@angular/core'; | |
import { Platform } from 'ionic-angular'; | |
import { GoogleMap } from 'ionic-native'; | |
@Component({ | |
selector: 'GoogleMap', | |
template: '<div [id]="id" [style.height]="height" [style.width]="width" style="display: block;"></div>' | |
}) | |
export class GoogleMapComponent implements AfterViewInit { | |
@Input() id: string = 'GoogleMap'; | |
@Input() height: string = '100%'; |
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
import {Component, ElementRef, AfterViewInit, Output, EventEmitter, Input, Self} from '@angular/core'; | |
import {ControlValueAccessor, NgModel} from '@angular/common'; | |
declare var $: any; | |
@Component({ | |
selector: 'dropdown', | |
template: ` | |
<select class="ui dropdown" [(ngModel)]="selectedOption"> | |
<option value="">Select one</option> | |
<option *ngFor="let item of items" [value]="item[valueField]">{{item[textField]}}</option> | |
</select> |
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
import {Component, ElementRef, AfterViewInit, Output, EventEmitter, Input, Self} from '@angular/core'; | |
import {ControlValueAccessor, NgModel} from '@angular/common'; | |
declare var $: any; | |
@Component({ | |
selector: 'calendar', | |
template: ` | |
<div class="ui calendar"> | |
<div class="ui input left icon"> | |
<i class="calendar icon"></i> | |
<input type="text" placeholder="Click to select Date/Time" [value]="initialDate"> |
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
import {Component, ElementRef, Output, EventEmitter, AfterViewInit, OnDestroy} from '@angular/core'; | |
declare var google: any; | |
@Component({ | |
selector: 'places-auto-complete', | |
template: ` | |
<input type="text"> | |
` | |
}) | |
export class PlacesAutoCompleteComponent implements AfterViewInit, OnDestroy { | |
@Output() placeChange: EventEmitter<any> = new EventEmitter<any>(); |
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
import {Component, Input, Output, AfterViewInit, EventEmitter, NgZone, Self} from '@angular/core'; | |
import {NgClass} from '@angular/common'; | |
import {ControlValueAccessor, NgModel} from '@angular/common'; | |
@Component({ | |
selector: 'pagination', | |
template: `<div class="ui borderless menu" *ngIf="numberOfPages > 1"> | |
<a class="item" (click)="selectPage(1)" [ngClass]="{active: selectedPage==1}">{{1}}</a> | |
<a class="item disabled" *ngIf="numberOfPages > 10 && selectedPage > 5">...</a> | |
<a class="item" *ngFor="let page of pages" (click)="selectPage(page)" [ngClass]="{active: selectedPage==page}">{{page}}</a> |