10
我只在Chrome中得到這個錯誤文本。根本沒有任何附加信息:如何在Angular中獲得更詳細的錯誤信息?
是什麼意思?發生了什麼?有沒有辦法告訴Angular或Chrome顯示更詳細的錯誤信息?
這是我的app.js文件。閒來無事包括:
'use strict';
// Declare app level module which depends on filters, and services
var vsApp = angular.module('vsApp', [
'ngRoute',
'vsApp.filters',
'vsApp.services',
'vsApp.directives',
'vsApp.controllers'
]);
vsApp.config(["$routeProvider"], function($routeProvider) {
$routeProvider.when('/registration', {templateUrl: 'partials/reg.html', controller: 'regCtrl'});
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'loginCtrl'});
$routeProvider.otherwise({redirectTo: '/'});
});
vsApp.controller("regCtrl", function() {});
vsApp.controller("loginCtrl", function() {});
ng-app
屬性包括:
<!DOCTYPE html>
<html ng-app="vsApp">
我<head>
標籤:
<script id="angularScript" src="/bower_components/angular/angular.js"></script>
<script src="/bower_components/angular-route/angular-route.js"></script>
<script src="/assets/js/app.js"></script>
UPD:
量角器帶來了更多的信息:
Message:
UnknownError: unknown error: [$injector:modulerr] Failed to instantiate module vsApp due to:
Error: [ng:areq] Argument 'fn' is not a function, got string
http://errors.angularjs.org/1.3.0-build.2795+sha.222d473/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20string
at http://localhost:3000/bower_components/angular/angular.js:78:12
at assertArg (http://localhost:3000/bower_components/angular/angular.js:1583:11)
at assertArgFn (http://localhost:3000/bower_components/angular/angular.js:1593:3)
at annotate (http://localhost:3000/bower_components/angular/angular.js:3318:5)
at Object.invoke (http://localhost:3000/bower_components/angular/angular.js:3986:21)
at runInvokeQueue (http://localhost:3000/bower_components/angular/angular.js:3915:35)
at http://localhost:3000/bower_components/angular/angular.js:3924:11
at Array.forEach (native)
at forEach (http://localhost:3000/bower_components/angular/angular.js:320:11)
at loadModules (http://localhost:3000/bower_components/angular/angular.js:3905:5)
是的!它完成了這項工作。問題在於語法。 – Green
是的,我也做了一個jsfiddle來嘗試重現你的錯誤信息,但我只得到一個全面的:/ –