calilonghorn calilonghorn - 1 year ago 354
AngularJS Question

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

I am getting the error message below when trying to run the ionic app after adding a new controller and html page to my existing ionic angular app. I've been debugging this for a few hours now and am stuck.

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

I have made sure to add the 'settings.controller' as a dependency to my module definition in the app.js file.

app.js file

(function() {

var matchpoint = angular.module('matchpoint', [

// Dashboard

// Authentication - Registration / Login

// Matches

// Friends and Groups

// Communication

// Settings

settings.controller.js file

(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) {




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

<ion-nav-bar class="bar-dark">

<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 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">
<div class="padding">
<button class="button button-block button-positive" ng-click="done()">
<div class="error" ng-if="errorMessage" ng-bind="errorMessage">
<div class="error password-strength-error" ng-if="!passwordValid">
Password must:
<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>
<button class="button button-stable button-block" ng-if="!isFirstPasswordChange"

Answer Source

I'm not entirely sure if I should put this in a comment or an answer, but:

If you are running the ionic app with the ionic serve command, there is a good chance that you are running into a cache problem. I have run into a very similar problem. The index.html file is cached in your browser, and I'm guessing you added the reference to the settings.controller.js file in index. Try clearing your cache.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download