2014-11-15 5 views
2

최신 이오니아를 사용 중이며 앱용 파이어베이스 백엔드를 구현하고 싶습니다. 나는 ionic get started guide를 따라 갔다. 그리고 나서 bower install을 사용하여 firebase와 angular fire를 설치했다. 생산Ionic + firebase, 오류 'firebase'모듈을 사용할 수 없습니다.

오류 :

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to: 
Error: [$injector:modulerr] Failed to instantiate module starter.controllers due to: 
Error: [$injector:modulerr] Failed to instantiate module firebase due to: 
Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 

그래서 나를 위해 적어도이 문제를 해결하지 않는 index.html을에 중포 기지 링크를 추가. bower를 사용하여 firebase를 설치하면 controllerbase.js에 'firebase'를 전달하여 자동으로 번들해야하지만이 오류가 발생합니다. 어떤 아이디어? 고마워요!

Index.html을

<!DOCTYPE html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
    <title></title> 

    <link href="lib/ionic/css/ionic.css" rel="stylesheet"> 
    <link href="css/style.css" rel="stylesheet"> 

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above 
    <link href="css/ionic.app.css" rel="stylesheet"> 
    --> 

    <!-- ionic/angularjs js --> 
    <script src="lib/ionic/js/ionic.bundle.js"></script> 

    <!-- cordova script (this will be a 404 during development) --> 
    <script src="cordova.js"></script> 

    <!-- your app's js --> 
    <script src="js/app.js"></script> 
    <script src="js/controllers.js"></script> 
    <script src="js/services.js"></script> 
    </head> 
    <body ng-app="starter" animation="slide-left-right-ios7"> 
    <!-- 
     The nav bar that will be updated as we navigate between views. 
    --> 
    <ion-nav-bar class="bar-stable nav-title-slide-ios7"> 
     <ion-nav-back-button class="button-icon icon ion-ios7-arrow-back"> 
     Back 
     </ion-nav-back-button> 
    </ion-nav-bar> 
    <!-- 
     The views will be rendered in the <ion-nav-view> directive below 
     Templates are in the /templates folder (but you could also 
     have templates inline in this html file if you'd like). 
    --> 
    <ion-nav-view></ion-nav-view> 
    </body> 
</html> 

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) 

.run(function($ionicPlatform) { 
    $ionicPlatform.ready(function() { 
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 
    // for form inputs) 
    if(window.cordova && window.cordova.plugins.Keyboard) { 
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 
    } 
    if(window.StatusBar) { 
     // org.apache.cordova.statusbar required 
     StatusBar.styleDefault(); 
    } 
    }); 
}) 

controller.js app.js :

이것은 내가 지금까지 응용 프로그램에서 변경 한 모든입니다

(210)
angular.module('starter.controllers', ['firebase']) 

.controller('DashCtrl', function ($scope, $firebase) { 

    // TV Shows Table 
    var moviesRef = new Firebase("https://moviehunt.firebaseio.com/"); 
    var sync = $firebase(moviesRef); 
    $scope.movies = sync.$asArray(); 

}) 

답변

2

좋아, 완전히 대신 사이드 메뉴와 이온 응용 프로그램 생성 여기 내 솔루션, 나는 처음부터 시작했다 :

이온 시작을 myApp이

을 sidemenu을 한 후 정자와 정자가 중포 기지 설치 angularfire를 설치 사용

<script src="lib/firebase/firebase.js"></script> 
<script src="lib/firebase-simple-login/firebase-simple-login.js"></script> 
<script src="lib/angularfire/dist/angularfire.js"></script> 
: 다음

은 index.html을에 다음 HTML 링크를 추가
관련 문제