【问题标题】:Angularfire with OnsenUI and Monaca / PhonegapAngularfire 与 OnsenUI 和 Monaca / Phonegap
【发布时间】:2014-08-04 11:25:20
【问题描述】:

我正在开发一个使用 OnsenUI 作为 UI 的移动应用程序,在 Monaca / Cordova 框架内运行,通过 angularfire 模块使用 Firebase 作为 BaaS。

我在没有 Firebase 的情况下设置模块如下:

var myAppController = angular.module('myApp', ['onsen.directives']);
myAppController.controller('EventListCtrl', ['$scope', function($scope) {

但是,一旦我将 Firebase 添加为模块,应用程序就会停止工作。

var myAppController = angular.module('myApp', ['onsen.directives', 'firebase']);
myAppController.controller('EventListCtrl', ['$scope', '$firebase', function($scope, $firebase) {

你能告诉我我做错了什么吗?

谢谢

【问题讨论】:

  • “停止工作”是什么意思?你是如何在应用程序中安装 AngularFire 的?脚本标签?错误控制台中出现了什么?你看过Phonegap + Firebase tut吗?
  • 该页面是一个列表页面,它遍历一个 Json 集合。使用第一个代码集,我得到了所有行,但只需添加第二个代码集中所示的 firebase 依赖项,页面就会呈现为空白页面。而且我正在使用 onsenui 来渲染页面,而不是 ionic。
  • 我使用monaca IDE添加了fire base,然后在主页中引用,按照示例中显示的顺序,即。角,角路线,火基地,角火。

标签: angularjs cordova angularfire onsen-ui monaca


【解决方案1】:

根据这个link,试试这样怎么样:

var myAppController = angular.module('myApp', ['onsen.directives', 'firebase']);
myAppController.controller('EventListCtrl', function($scope, $firebase) {

【讨论】:

  • 不,没用,同样的问题。并且调试日志也没有显示任何错误。
【解决方案2】:

认为我应该自己回答这个问题,以帮助面临同样情况的其他人。

我的问题是 firebase js 脚本引用错误。即。我很粗心。

问候

【讨论】:

    猜你喜欢
    • 2017-12-29
    • 1970-01-01
    • 2014-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 2016-11-28
    • 1970-01-01
    相关资源
    最近更新 更多