私の新しい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');
}
});
/タブ/アカウントのURLを意味します'/ tt/dash'に' .state'がない場合は.... – Claies