I'm encountering an issue where the error Uncaught ReferenceError: $stateProvider is not defined keeps popping up, even though angular-ui-router.js
seems to be loading properly.
In the Developer Tools console, this error persists.
Below is my code snippet from app.js
:
var app = angular.module('app', ['ui.router']);
app.config([$stateProvider, $urlRouterProvider, function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('main',
{
url: '/',
templateUrl: '/partials/main',
controller: 'mainCtrl'
});
}
]);