0

I'm working on a mobile app using OnsenUI for the UI, running within the Monaca / Cordova framework, using Firebase as a BaaS through the angularfire module.

I've setup the module without Firebase as follows:

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

However, as soon as I add Firebase as a module, the app stops working.

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

Can you please tell me what I'm doing wrong?

Thanks

Andi Pavllo
  • 2,506
  • 4
  • 18
  • 30
vjm
  • 49
  • 1
  • 9
  • What does "stops working" mean? How did you install AngularFire in the app? Script tags? What is appearing in the error console? Have you looked at the [Phonegap + Firebase tut](https://www.firebase.com/blog/2014-07-25-ionic-simple-login.html)? – Kato Aug 04 '14 at 16:30
  • The page is a list page which iterates through a Json collection. With the first codeset, I get all the rows but just by adding the firebase dependencies as shown in the second codeset, the page is rendered as a blank page. And I'm using onsenui to render the pages, not ionic. – vjm Aug 04 '14 at 22:19
  • I added fire base using monaca IDE and then referenced in the main page, in the order shown in the examples, ie. angular, angular-route, fire base, angular fire. – vjm Aug 04 '14 at 22:25

2 Answers2

0

According to this link, how about trying it this way:

var myAppController = angular.module('myApp', ['onsen.directives', 'firebase']);
myAppController.controller('EventListCtrl', function($scope, $firebase) {
khemry
  • 585
  • 3
  • 7
  • Nope, didn't work, same problem. And the debug logs don't show any errors either. – vjm Aug 05 '14 at 10:59
0

Thought I should answer this myself to help anyone else facing the same situation.

My issue was that the firebase js script reference was wrong., ie. I was careless.

Regards

vjm
  • 49
  • 1
  • 9