0

私の新しいfactory.jsを私の新しい工場で稼働させようとしていますが、問題が発生してエラーが発生しています。私は確かにそれがどこか間違っているのか分かりません。あなたが私を助けることができれば、それはたくさんのことを意味するでしょう。インデックスにエラーはなく、ng-appが正しくあります。ありがとうございます未知のエラーをデバッグしてください。 Angular app.js

エラーなし:その空白の画面:/どのようにデバッグしますか?

var app = angular.module('starter', ['allmystuff']); 

(function() { 
    'use strict'; 

    app 

    .run(runFunction) 
    .config(configFn) 
    .controller('MainCtrl', MainCtrl) 
    .factory('myService', myService); 


    function runFunction($ionicPlatform) { 
    $ionicPlatform.ready(function() { 
     if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { 
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 
     cordova.plugins.Keyboard.disableScroll(true); 

     } 
     if (window.StatusBar) { 
     // org.apache.cordova.statusbar required 
     StatusBar.styleDefault(); 
     } 
    }) 
    } 


    MainCtrl.$inject = ['$scope', 'myService','$localStorage']; 

    function MainCtrl($scope, myService, $localStorage) { 
    function getSuccess(response) { 
     $scope.items = response.data; 
    } 

    function getError(response) { 
     console.log('Of course an error since the url is a invalid, but it should work with a valid url!'); 
    } 

    myService.getAll() 
     .then(getSuccess) 
     .catch(getError); 
    } 

    function myService($http) { 
    var factory = { 
     getAll: getAll 
    }; 

    return factory; 

    function getAll() { 
     return $http.get(""); 
    } 
    } 


function configFn($stateProvider, $urlRouterProvider) { 

    $stateProvider 

    // setup an abstract state for the tabs directive 
    .state('tab', { 
    url: '/tab', 
    abstract: true, 
    templateUrl: 'templates/tabs.html' 
    }) 

    .state('login', { 
     url: "/login", 
     cache: false, 
     controller: 'AccountCtrl', 
     templateUrl: "templates/login.html" 
    }) 

    .state('tab.account', { 
    url: '/account', 
    views: { 
     'tab-account': { 
     templateUrl: 'templates/tab-account.html', 
     controller: 'AccountCtrl' 
     } 
    } 
    }); 

    $urlRouterProvider.otherwise('/tab/dash'); 

} 

}); 
+0

/タブ/アカウントのURLを意味します'/ tt/dash'に' .state'がない場合は.... – Claies

答えて

0

問題は、あなたのtab.dash状態である$urlRouterProvider.otherwise('/tab/dash');

です。

たぶん、あなたがさて、上に行くために多くの情報がありませんので、あなたが任意のHTMLを示していないが、私は行くのは難しいだろう想像

$urlRouterProvider.otherwise('/tab/account'); 
+0

コードを短くするためにいくつかの状態を削除しようとしました。私は工場を使わずにテストしたので、htmlにエラーはありません。 –

+0

templateUrlが正しいパスを指しているかどうかを確認してください –

関連する問題