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 { Injectable } from '@angular/core'; | |
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | |
import { Observable } from 'rxjs'; | |
import { Router } from '@angular/router'; | |
import * as firebase from 'firebase/app'; | |
import 'firebase/auth'; | |
@Injectable({ | |
providedIn: 'root' |
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
// ... | |
const routes: Routes = [ | |
{ path: '', redirectTo: 'register', pathMatch: 'full' }, | |
{ path: 'home', loadChildren: './home/home.module#HomePageModule' }, | |
{ path: 'register', loadChildren: './register/register.module#RegisterPageModule' }, | |
]; | |
// ... |
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
'user strict' | |
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
// Prevent firebase from initializing twice | |
try { | |
admin.initializeApp(functions.config().firebase) | |
} catch (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
<header> | |
<h1> {{ site.title }} </h1> | |
<img src="{{ site.img_file }}"> | |
</header> | |
<nav> | |
<ul> | |
<li *ngFor="let menuitem of menu"> | |
{{ menuitem }} | |
</li> | |
</ul> |
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
<!--The content below is only a placeholder and can be replaced.--> | |
<div style="text-align:center"> | |
<h1> | |
Welcome to {{title}}! | |
</h1> | |
<img width="300" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> | |
</div> | |
<h2>Here are some links to help you start: </h2> | |
<ul> | |
<li> |
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
angular.module('starter', ['ionic','starter.controllers', 'starter.services']) | |
.run(function ($ionicPlatform) { | |
$ionicPlatform.ready(function () { | |
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard | |
// for form inputs) | |
if (window.cordova && window.cordova.plugins.Keyboard) { | |
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | |
} | |
if (window.StatusBar) { | |
StatusBar.styleDefault(); |
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
angular.module('starter', ['ionic', 'starter.services','starter.controllers','ngCordova']) | |
.controller("barCodeCtrl", function ($scope, $cordovaBarcodeScanner) { | |
$scope.scanBarcode = function () { | |
$cordovaBarcodeScanner.scan().then(function (result) { | |
$scope.barcode = result.text; | |
$scope.format = result.format; | |
}, function (error) { | |
console.warn("An error happened -> " + error); | |
}); | |
}; |
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-view> | |
<ion-nav-buttons side="right"> | |
<button class="button" ng-if="login" ng-click="logout()">登出</button> | |
</ion-nav-buttons> | |
<ion-content> | |
<ion-list class="list" ng-repeat="item in activities"> | |
<ion-item class="item"> | |
<h2>{{item.activity_name}}</h2> | |
<p>{{item.heldAt.iso|date:'yyyy-MM-dd HH:mm':'UTC'}},{{item.place}}</p> | |
<p>講師:{{item.instructor.name}}</p> |
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
var map = null; | |
angular.module('starter', ['ionic', 'starter.services']) | |
.config(function ($stateProvider, $urlRouterProvider) { | |
$stateProvider | |
.state('list', { | |
url: '/list', | |
templateUrl: 'templates/list.html', | |
controller: 'listCtrl' | |
}) | |
.state('detail', { |
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
angular.module('starter', ['ionic', 'ngCordovaOauth', 'ngStorage']) | |
.config(function ($stateProvider, $urlRouterProvider) { | |
$urlRouterProvider.otherwise('/login'); | |
$stateProvider | |
.state('login', { | |
url: '/login', | |
templateUrl: 'templates/login.html', | |
controller: 'OauthCtrl' | |
}) | |
.state('feed', { |
NewerOlder