Tag: 火力

无法让Angularjs在渲染模板之前等待数据

我看了很多教程和堆栈溢出页面,但没有解决scheme为我工作。 基本上,我需要在将数据传递给模板之前从Firebase获取数据。 这可能也可能不重要,但我在后端使用nodejs和ejs。 但问题是与angular1 码 angular.module("example", ["elif", "ngRoute"]) .config(['$routeProvider', function($routeProvider) { $routeProvider .when("/leaders", { templateUrl: "leaders", controller: 'LeadersController', resolve: { data: function () { return getLeadersData(); } } }); }]) .controller('LeadersController', ["$scope", "$http", "$location", "$window", 'data', function($scope, $http, $location, $window, data) { $scope.data = data; }]); function getLeadersData() { // firebase does its thing and […]

firebase如何与节点js脱机?

我对nodejs有点新东西,正在和一个消防基础应用程序一起工作。我想让应用程序可以和离线的fire base一起工作 我试图寻找一个相关的答案我们究竟能做些什么改变,使得firebase可以离线使用nodejs技术,它似乎与nodejs脱机工作 提前致谢

在Node.js应用程序中接收Firebase云消息

是否可以使用Node.js编写客户端来接收Firebase云消息? 我通过Google Firebasepipe理模块浏览了Node.js,但没有find将我的脚本注册为客户端的方法。 另外,我也看到Google可以通过XMPP连接。 我可以使用这个接收消息吗?

这个configuration文件图片上传器的逻辑是可扩展的吗?

用于实现configuration文件上载function的以下通用逻辑是否可以在生产中进行扩展? 1. Inside a web app user selects an image to upload 2. Image gets sent to the server where it gets stored in memory and validated using nodejs package called: multer 3. If the image file is valid, a unique name is generated for the file 4. The image is resized to 150 x […]

删除Firebase中的本地代码库。 我如何检索代码?

我目前正在开发一个应用程序在firebase和nodejs,我不小心删除了本地系统上的firebase的function文件夹。 函数文件夹包含应用程序的所有核心逻辑。 幸运的是,在发生这种事故之前,我已经通过在服务器上使用“firebase deploy”部署了我的代码库。 我如何访问服务器上当前运行的代码库并将其下载到本地系统?

从谷歌存储的Firebase下载云function

我有一个在firebase中的集合,看起来像这样: people: -KuM2GgA5JdH0Inem6lGaddclose appliedTo: "-KuM1IB5TisBtc34y2Bb" document: "docs/837c2500-9cbe-11e7-8ac1-17a6c37e2057" name: "Test Testerson" 文档节点包含存储桶中文件的path。 是否有可能使用http的firebase函数将这个文件下载到客户端。 根据节点/stream向客户端的Stream文件,我应该能够stream式地快速响应。 谷歌存储readstream会为此工作? 谢谢, 本

无法弄清楚使用FirebaseloginGithub

在我的主页上,我有一个链接如下: <a href="/login">Login with Github</a> 而在我的app.js我有以下几点: app.get('/login', function(req, res) { var ref = new Firebase('https://hrr-kitchen.firebaseio.com'); ref.authWithOAuthPopup('github', function(err, authData) { console.log('in authWithOAuthPopup'); if (err) { console.log(err.code); } else if (authData) { // user authenticated with GitHub console.log('User ID: ' + authData.uid); } }); }); 我花了几个小时在网上search,我已经尝试了很多不同的东西,我的眼睛是狡猾的。 我想我可能需要从HTML调用一个函数,并把代码放在一个函数,我试图在这一点尝试,只是在服务器以外的JavaScript做,但我认为这是janky。 我是新来的firebase和expression,我只是无法弄清楚这一点。 请帮忙? 编辑:我已经能够通过更改我的HTML看起来像这样工作: <script type="text/javascript"> var ref = new Firebase('https://hrr-kitchen.firebaseio.com'); […]

visual studio没有findfirebase节点模块

我使用命令npm install firebase –save从我的项目文件夹的根目录保存,并且firebase文件夹已成功添加到我的node_modules文件夹中,并且packages.json也被更新。 我也使用打字稿,所以我有一个app.ts文件,我尝试import Firebase = require("firebase"); 但是它不起作用。 我得到红色的曲折和错误说cannot find external module "firebase" 。 我已经安装快递,并在app.ts中导入它,并且工作正常,没有错误。 我试图通过firebase来源,但它的缩小和不可能尝试在那里做任何发现,关于什么是出口等。 任何想法可能是错误的,我怎样才能解决它?

由于斜杠字符,Firebase多path更新失败

我正在关注这个Firebase教程(多path更新): https : //www.firebase.com/docs/web/guide/saving-data.html#section-update 但是当我尝试运行时: firebaseRef.update({ 'alanisawesome/nickname': 'Alan The Machine', 'gracehop/nickname': 'Amazing Grace' }); 我得到: Error: Firebase.update failed: First argument contains an invalid key (alanisawesome/nickname) . Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]" 我需要指定path的“/”字符。 我的实现有什么问题? 谢谢

以同步方式执行asynchronous进程| Node.js | Google地图

这个问题不同于以前发布在asynchronous进程上的问题。 我正在开发一个类似于应用程序的超级应用程序,而且我正在使用Firebase作为后端。 我做了一个服务器来处理一些任务,比如给司机下达命令。 当一个订单出现,我需要find所有的司机和客户之间使用谷歌地图API的距离。 下面是我用来计算驾驶员和客户之间距离的function。 function calculatingDistance(fromLat,fromLong,toLat,toLong){ var distanceDurationObject={}; var options = { host: 'maps.googleapis.com', path: '/maps/api/directions/json?origin='+fromLat+','+fromLong+'&destination='+toLat+','+toLong+'&key=AIzaSyBsoc1PZOItqHNYc5z2hW_ejPFi2piRR8Y', method: 'GET', headers: { 'Content-Type': 'application/json' } }; var req = https.get(options, function(res) { //buffering alll data var bodyChunks = []; res.on('data', function(chunk) { // You can process streamed parts here… bodyChunks.push(chunk); }).on('end', function() { var body = […]