gpt4 book ai didi

angularjs - Uncaught Error : [$injector:modulerr] http://errors. angularjs.org/1.2.16

转载 作者:行者123 更新时间:2023-12-01 23:56:57 25 4
gpt4 key购买 nike

一旦我添加这一行

<html lang="en" ng-app="myApp">

我收到这个错误

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=mctApp&p1=Error%3A…rg%2F1.2.16%2F%24injector%2Fnomod%3Fp0%3DmctApp%0A%20%20%20%20at%20Error%2...<omitted>...1) 

我已经添加了这些脚本

<script type="text/javascript" src="/resources/js/lib/angular.min.js"></script>
<script type="text/javascript" src="/resources/js/lib/angular-route.min.js"></script>
<script type="text/javascript" src="/resources/js/lib/angular-resource.min.js"></script>

Javascript 应用程序代码

angular.module('myApp', []).config(mctRouter);

function mctRouter($routeProvider) {

$routeProvider
.when('/', {
templateUrl: 'home.jsp'
});
}

最佳答案

您忘记将 ngRoute 注入(inject)到您的应用中。像这样注入(inject)

angular.module('myApp', ['ngRoute']).config(mctRouter);

关于angularjs - Uncaught Error : [$injector:modulerr] http://errors. angularjs.org/1.2.16,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23212692/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com