微软JScript运行时错误:[$喷油器:modulerr]在AngularJS V1.3.0,beta.11 [英] Microsoft JScript runtime error: [$injector:modulerr] in AngularJS v1.3.0-beta.11

查看:146
本文介绍了微软JScript运行时错误:[$喷油器:modulerr]在AngularJS V1.3.0,beta.11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的错误

 微软JScript运行时错误:[$喷油器:modulerr] http://errors.angularjs.org/1.3.0-beta.11/$injector/modulerr?p0=MyApp&p1=%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.0-beta.11%2F%24injector%2Fnomod%3Fp0%3DMyApp

我怎么可能解决这个问题?我使用的是最新版本的 AngularJS 的是 AngularJS V1.3.0-beta.11

下面是我的的index.htm code:

 <!DOCTYPE HTML>< HTML LANG =ENNG-应用=MyMVC>
< HEAD>
    < META HTTP-EQUIV =X-UA-Compatible的内容=IE = 9的charset =UTF-8/>
    <标题>< /标题>
    <脚本SRC =LIB / jQuery的-1.11.1.min.js类型=文/ JavaScript的>< / SCRIPT>
    <脚本SRC =JSON3.min.js类型=文/ JavaScript的>< / SCRIPT>
    <脚本SRC =LIB /角/ angular.min.js类型=文/ JavaScript的>< / SCRIPT>
    <脚本SRC =LIB /角/角route.min.js类型=文/ JavaScript的>< / SCRIPT>
    <脚本SRC =LIB /角/ app.js类型=文/ JavaScript的>< / SCRIPT>
    <脚本SRC =LIB /角/ controllers.js类型=文/ JavaScript的>< / SCRIPT>
< /头>
<身体GT;
    < D​​IV NG-视图>< / DIV>

下面是我的 app.js code

  VAR对myApp = angular.module('MyMVC',[
    ngRoute',
    logController
]);myApp.config(['$ routeProvider',函数($ routeProvider)] {
    $ routeProvider。
    当('/列表',{
        templateUrl:'谐音/ list.htm',
        控制器:'ListController
    })。
    除此以外({
        redirectTo:'/列表
    });
});

这是我的 controller.js code:

  VAR logController = angular.module('logController',[]);logController.controller('ListController',函数($范围,$ HTTP){
    $ http.post('testws.asmx / GetLogs',{
        标题:{内容类型:应用/ JSON的;字符集= utf-8'}
    })。成功(功能(数据){
        $ scope.logs = data.d;
        $ scope.orderRecord ='​​的recordId';
    })
    .error(功能(错误){
        $ scope.error = ERR [消息];
    });
});

任何建议,将是一个很大的帮助。谢谢!

更新:改变角度JS精缩版不
这里是新的错误提示:

 微软JScript运行时错误:[$喷油器:modulerr]未能实例化模块MyMVC由于:
[$喷油器:NOMOD]模块'MyMVC不可!你要么拼写错误的模块名称,或忘了加载它。如果注册一个模块,确保指定的依赖关系作为第二个参数。
http://errors.angularjs.org/1.3.0-beta.11/$injector/nomod?p0=MyMVC
http://errors.angularjs.org/1.3.0-beta.11/$injector/modulerr?p0=MyMVC&p1=%5B%24injector%3Anomod%5D%20Module%20'MyMVC'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.0-beta.11%2F%24injector%2Fnomod%3Fp0%3DMyMVC


解决方案

  myApp.config(['$ routeProvider',函数($ routeProvider){
    $ routeProvider。
    当('/列表',{
        templateUrl:'谐音/ list.html',
        控制器:'ListController
    })。
    除此以外({
        redirectTo:'/列表
    });
}]);

解决这个问题,我只是放错了地方的] ,并将其移动到最后。感谢所有帮助: - )

I encountered error of

Microsoft JScript runtime error: [$injector:modulerr] http://errors.angularjs.org/1.3.0-beta.11/$injector/modulerr?p0=MyApp&p1=%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.0-beta.11%2F%24injector%2Fnomod%3Fp0%3DMyApp

How can I possibly fix this issue? I am using the latest version of AngularJS which is AngularJS v1.3.0-beta.11.

Here is my index.htm code:

<!DOCTYPE html>

<html lang="en" ng-app="MyMVC">
<head>
    <meta http-equiv="x-ua-compatible" content="IE=9" charset="UTF-8"/>
    <title></title>
    <script src="lib/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="JSON3.min.js" type="text/javascript"></script>
    <script src="lib/angular/angular.min.js" type="text/javascript"></script>
    <script src="lib/angular/angular-route.min.js" type="text/javascript"></script>
    <script src="lib/angular/app.js" type="text/javascript"></script>
    <script src="lib/angular/controllers.js" type="text/javascript"></script>
</head>
<body>
    <div ng-view></div>

Here is my app.js code

    var myApp = angular.module('MyMVC', [
    'ngRoute',
    'logController'
]);

myApp.config(['$routeProvider', function($routeProvider)]{
    $routeProvider.
    when('/list', {
        templateUrl: 'partials/list.htm',
        controller: 'ListController'
    }).
    otherwise({
        redirectTo: '/list'
    });
});

And here is my controller.js code:

    var logController = angular.module('logController', []);

logController.controller('ListController', function ($scope, $http) {
    $http.post('testws.asmx/GetLogs', {
        headers: { 'Content-Type': 'application/json; charset=utf-8' }
    }).success(function (data) {
        $scope.logs = data.d;
        $scope.orderRecord = 'RecordId';
    })
    .error(function (err) {
        $scope.error = err["Message"];
    });
});

Any suggestions will be a big help. Thanks!

UPDATE: change angular js minified version to not Here is the new error prompt:

    Microsoft JScript runtime error: [$injector:modulerr] Failed to instantiate module MyMVC due to:
[$injector:nomod] Module 'MyMVC' 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.
http://errors.angularjs.org/1.3.0-beta.11/$injector/nomod?p0=MyMVC
http://errors.angularjs.org/1.3.0-beta.11/$injector/modulerr?p0=MyMVC&p1=%5B%24injector%3Anomod%5D%20Module%20'MyMVC'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.3.0-beta.11%2F%24injector%2Fnomod%3Fp0%3DMyMVC

解决方案

 myApp.config(['$routeProvider', function($routeProvider){
    $routeProvider.
    when('/list', {
        templateUrl: 'partials/list.html',
        controller: 'ListController'
    }).
    otherwise({
        redirectTo: '/list'
    });
}]);

solve the issue, i just misplaced the ] and move it to the end. Thanks for all the help :-)

这篇关于微软JScript运行时错误:[$喷油器:modulerr]在AngularJS V1.3.0,beta.11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆