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, | |
Injector, | |
ComponentFactoryResolver, | |
EmbeddedViewRef, | |
ApplicationRef | |
} from '@angular/core'; | |
@Injectable() | |
export class DomService { |
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 {FirebaseAuth, AngularFire} from "angularfire2"; | |
import {Subject, Observable, BehaviorSubject} from "rxjs"; | |
import {AuthInfo} from "./auth-info"; | |
@Injectable() | |
export class AuthService { | |
static UNKNOWN_USER = new AuthInfo(null); | |
authInfo$: BehaviorSubject<AuthInfo> = new BehaviorSubject<AuthInfo>(AuthService.UNKNOWN_USER); |
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
//file service | |
angular.service('FileDialog', function($q){ | |
//reads file from disk, returns a promise (integrated into the digest cycle) | |
function readFile(filename){ | |
return $q(function(resolve, reject){ | |
fs.readFile(fileName, 'utf-8', function (err, data){ | |
if(err){ | |
reject(err); | |
return; |
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
// Ajax File upload with jQuery and XHR2 | |
// Sean Clark http://square-bracket.com | |
// xhr2 file upload | |
$.fn.upload = function(remote, data, successFn, progressFn) { | |
// if we dont have post data, move it along | |
if (typeof data != "object") { | |
progressFn = successFn; | |
successFn = data; | |
} |