Yet another troubling situation with a new project:
Following controller code:
(function () {
'use strict';
angular
.module('offerRequest', [])
.controller('offerRequestCtrl', offerRequestCtrl);
offerRequestCtrl.$inject = ['$scope', '$rootScope', '$location'];
function offerRequestCtrl($scope, $rootScope, $location) {
// controller code starts here.
/* jshint validthis:true */
var vm = this;
vm.title = 'offerRequestCtrl';
activate();
function activate() { }
}
})();
With the following routing:
// state for requesting offers
.state('offerrequest', {
url: '/offerrequest',
templateUrl: 'app/components/offerrequest/offerrequest.html',
controller: 'offerRequestCtrl'
})
Causes the following error message:
Argument 'offerRequestCtrl' is not a function, got undefined
Tried the older style of defining it:
angular.module('offerRequest', [])
.controller('offerRequestCtrl', function offerRequestCtrl() {
});
Throws the same error. What could I be doing wrong in the first implementation which I would like to work with?