当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript app.initializeApp函数代码示例

本文整理汇总了TypeScript中firebase/app.initializeApp函数的典型用法代码示例。如果您正苦于以下问题:TypeScript initializeApp函数的具体用法?TypeScript initializeApp怎么用?TypeScript initializeApp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了initializeApp函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: _firebaseAppFactory

export function _firebaseAppFactory(config: {}, appName?: string): FirebaseApp {
  try {
    if (appName) {
      return firebase.initializeApp(config, appName);
    } else {
      return firebase.initializeApp(config);
    }
  }
  catch (e) {
    return firebase.app(null);
  }
}
开发者ID:julienevano,项目名称:angularfire2,代码行数:12,代码来源:firebase.app.module.ts

示例2: _firebaseAppFactory

export function _firebaseAppFactory(config: FirebaseAppConfig, appName?: string): FirebaseApp {
  try {
    if (appName) {
      return firebase.initializeApp(config, appName) as FirebaseApp;
    } else {
      return firebase.initializeApp(config) as FirebaseApp;
    }
  }
  catch (e) {
    if (e.code === "app/duplicate-app") {
      return firebase.app(e.name) as FirebaseApp;
    }

    return firebase.app(null!) as FirebaseApp;
  }
}
开发者ID:cartant,项目名称:angularfire2,代码行数:16,代码来源:firebase.app.module.ts

示例3: newFirebaseClient

	function newFirebaseClient(port) {
		const name = `test-firebase-http-${sequentialConnectionId++}`;
		const url = `ws://localhost:${port}`;
		const config = {
			databaseURL: url,
		};
		app = firebase.initializeApp(config, name);
		return app.database().ref();
	}
开发者ID:urish,项目名称:firebase-server,代码行数:9,代码来源:http-server.spec.ts

示例4: initializeFirebaseApp

export function initializeFirebaseApp() {
  firebase.initializeApp({
    apiKey: process.env.FIREBASE_API_KEY,
    authDomain: process.env.FIREBASE_AUTH_DOMAIN,
    databaseURL: process.env.FIREBASE_DATABASE_URL,
    storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
    messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID
  });
}
开发者ID:vdsabev,项目名称:betahaus-sofia-office-manager,代码行数:9,代码来源:firebase.ts

示例5: constructor

 constructor(){
   this.fireBaseUrl = 'https://customer-manager-application.firebaseio.com/';
   this.fbConfig = {
     apiKey: "AIzaSyAFIe8-VH4N1GzUAEsHgUPdV6NFm4i0HWo",
     authDomain: "localhost",
     databaseURL: this.fireBaseUrl,
     storageBucket: "customer-manager-application.appspot.com",
   };
   firebase.initializeApp(this.fbConfig);
 }
开发者ID:bhaniel,项目名称:angular2-webpack,代码行数:10,代码来源:app.component.ts

示例6:

const loadEnvironment = (application:any, environment:any) => {
    const config = Object.assign({}, environment);
    delete config.options;
    delete config.name;
    const options = Object.assign({}, config.options);
    options.name = options.name || environment.name;
    firebase.initializeApp(config, options);
    const serviceName = options.name === '[DEFAULT]' && `firebase-app` || `firebase-${options.name}`;
    application.register(`service:${serviceName}`, FirebaseAppService.extend({ name: options.name }), { instantiate: true });
}
开发者ID:firebase,项目名称:emberfire,代码行数:10,代码来源:emberfire.ts

示例7: _firebaseAppFactory

export function _firebaseAppFactory(options: FirebaseOptions, nameOrConfig?: string|FirebaseAppConfig|null) {
    const name = typeof nameOrConfig === 'string' && nameOrConfig || '[DEFAULT]';
    const config = typeof nameOrConfig === 'object' && nameOrConfig || {};
    config.name = config.name || name;
    // Added any due to some inconsistency between @firebase/app and firebase types
    const existingApp = firebase.apps.filter(app => app && app.name === config.name)[0] as any;
    // We support FirebaseConfig, initializeApp's public type only accepts string; need to cast as any
    // Could be solved with https://github.com/firebase/firebase-js-sdk/pull/1206
    return (existingApp || firebase.initializeApp(options, config as any)) as FirebaseApp;
}
开发者ID:PaulD11,项目名称:angularfire2,代码行数:10,代码来源:firebase.app.module.ts

示例8: constructor

	constructor(public router: Router) {
		const firebaseConfig = {
			apiKey: "AIzaSyCVsm1c-nS9qS1fFfFo6JCAb908AfPU6Ag",
			authDomain: "rin-anidb.firebaseapp.com",
			databaseURL: "https://rin-anidb.firebaseio.com",
			projectId: "rin-anidb",
			storageBucket: "rin-anidb.appspot.com",
			messagingSenderId: "669722574117",
		};

		initializeApp(firebaseConfig);
	}
开发者ID:RinMinase,项目名称:anidb,代码行数:12,代码来源:app.component.ts

示例9: constructor

 constructor() {
     const firebaseConfig = {
         apiKey: "AIzaSyBw73BRk-qWeZm-fp3-Ijf7s0EemdaWuCQ",
         authDomain: "selecquest.firebaseapp.com",
         databaseURL: "https://selecquest.firebaseio.com",
         projectId: "selecquest",
         storageBucket: "selecquest.appspot.com",
         messagingSenderId: "434339253679"
     };
     firebase.initializeApp(firebaseConfig);
     this.db = firebase.firestore()
     this.db.enablePersistence({experimentalTabSynchronization: true});
 }
开发者ID:scunningham777,项目名称:SelecQuest,代码行数:13,代码来源:game-settings-manager.ts

示例10:

import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";

firebase.initializeApp({
  apiKey: "AIzaSyCjBDyhwbXcp9kEIA2pMHLDGxmCM4Sn6Eg",
  authDomain: "canigraduate-43286.firebaseapp.com",
  projectId: "canigraduate-43286"
});

export const firestore = firebase.firestore();
firestore.settings({ timestampsInSnapshots: true });

export const auth = firebase.auth();
开发者ID:kevmo314,项目名称:canigraduate.uchicago.edu,代码行数:14,代码来源:firebase.ts


注:本文中的firebase/app.initializeApp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。