gpt4 book ai didi

angularjs - 使用 ng-route 时 checklist-model 模块不起作用

转载 作者:行者123 更新时间:2023-12-02 23:09:38 25 4
gpt4 key购买 nike

我试图在我的应用程序中使用 [checklist-model] ( https://github.com/vitalets/checklist-model ) 模块,但我发现了一个错误,我发现这是因为在同一个应用程序中使用 (ngRoute) 模块。

var mainMod = angular.module('MainApp', ['ngRoute'],['checklist-model']);

mainMod.config(['$routeProvider',function($routeProvider) {

$routeProvider
.when("/patient-list", {
templateUrl: "patient-list.html",
controller: "dbCtrl"

})
.when("/patientRecord", {
templateUrl: "patientRecord.html",
controller: "MainCtrl2"
})
.otherwise({
templateUrl: "patient-list.html",
controller: "dbCtrl"

})

}

]);

错误:

angular.min.js:6Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.24/$injector/modulerr?p0=MainApp&p1=Error%3…%20gc%20(http%3A%2F%2Flocalhost%2Ftest%2Ffiles%2Fangular.min.js%3A36%3A309)

如果有任何解决方案,我将很高兴知道。

感谢您的努力

最佳答案

第二个参数应该是所有依赖项的数组。试试angular.module('MainApp', ['ngRoute', 'checklist-module']);相反。

此外,在开发工作中使用未缩小的版本将产生更有用的错误消息。

关于angularjs - 使用 ng-route 时 checklist-model 模块不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37272430/

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