gpt4 book ai didi

javascript - Uncaught Error : [$injector:modulerr] Failed to instantiate module matchpoint due to:

转载 作者:行者123 更新时间:2023-11-29 15:27:45 29 4
gpt4 key购买 nike

在将新 Controller 和 html 页面添加到我现有的 ionic angular 应用程序后尝试运行 ionic 应用程序时,我收到以下错误消息。我已经调试了几个小时了,但卡住了。

ionic.bundle.js:8895 Uncaught Error: [$injector:modulerr] Failed to instantiate module matchpoint due to: Error: [$injector:modulerr] Failed to instantiate module settings.controller due to: Error: [$injector:nomod] Module 'settings.controller' 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.

我已确保将“settings.controller”添加为我在 app.js 文件中的模块定义的依赖项。

app.js 文件

(function() {

var matchpoint = angular.module('matchpoint', [
'ionic','ionic.service.core',

// Dashboard
'dash.controller',

// Authentication - Registration / Login
'auth.controller',
'auth.service',

// Matches
'match.controller',

// Friends and Groups
'friends.controller',
'friends.service',
'groups.service',

// Communication
'chat.controller',
'chat.service',
'email.service',

// Settings
'settings.controller',
...

settings.controller.js 文件

(function() {

var app = angular.module('settings.controller', []);

app.controller('SettingsController', ['$scope', 'authService', 'jsonService', 'config', 'utilityService', '$state', '$localStorage', 'friendsService', '$ionicPopup', 'mixpanelService', function($scope, authService, jsonService, config, utilityService, $state, $localStorage, friendsService, $ionicPopup, mixpanelService) {

}]);

});

settings.html

<ion-view view-title="Settings" class="settings-view">

<ion-nav-bar class="bar-dark">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>

<ion-content>
<div class="list">
<label class="item item-input item-stacked-label">
<span class="input-label">{{ passwordLabel }}</span>
<input type="password" placeholder="{{ passwordPlaceholder }}" ng-model="user.oldPassword">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">New Password</span>
<input type="password" placeholder="Your new password" ng-model="user.newPassword">
</label>
</div>
<div class="padding">
<button class="button button-block button-positive" ng-click="done()">
Done
</button>
<div class="error" ng-if="errorMessage" ng-bind="errorMessage">
</div>
<div class="error password-strength-error" ng-if="!passwordValid">
Password must:
<ul>
<li>have at least 1 uppercase letter</li>
<li>have at least 1 lowercase letter</li>
<li>have at least 1 digit</li>
<li>be at least 8 characters long</li>
</ul>
</div>
<br><br><br>
<button class="button button-stable button-block" ng-if="!isFirstPasswordChange"
ui-sref="app.dashboard">
Cancel
</button>
</div>
</ion-content>
</ion-view>

最佳答案

我不确定我是否应该将其放在评论或答案中,但是:

如果您使用 ionic serve 命令运行 ionic 应用程序,您很可能会遇到缓存问题。我遇到了一个非常相似的问题。 index.html 文件缓存在您的浏览器中,我猜您在 index.html 中添加了对 settings.controller.js 文件的引用。尝试清除缓存。

关于javascript - Uncaught Error : [$injector:modulerr] Failed to instantiate module matchpoint due to:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37626959/

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