Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: [ng:areq] Argument 'ProjectsController' is not a function, got undefined

Tags:

angularjs

Why is my ProjectsController undefined? I get this error message from my browser console.

you can check that for yourself see this plunker:

http://plnkr.co/edit/0DJ6W7QEPx2UzpdzDrVu?p=preview

'use strict';
angular
  .module('projectplanner', ['ui.router'])
  .config(function($stateProvider, $urlRouterProvider) {

    $urlRouterProvider.otherwise('/projects');
    $stateProvider
      .state('projects', {

        url: '/projects',
        views: {
          'menu': {
            template: 'Start your projects!'

          },
          'content': {
            templateUrl: "projects.html",
            controller: 'ProjectsController'
          }
        }
      })
      .state('projects.selected', {
        url: '/:projectId'
      })
      .state('projects.selected.dates', {
        url: '/dates/:date',
        views: {
          'menu': {
            templateUrl: 'menu.html'

          },
          'content': {
            templateUrl: 'dateplanner.html',
            controller: 'DateplannerController'
          }
        }
      })
  });



'use strict';
angular.module('projectplanner').controller('ProjectsController', function ($scope, $state) {


});
like image 327
Pascal Avatar asked Mar 19 '23 22:03

Pascal


1 Answers

you have not included its js

  <script src="app.js"></script>
  <script src="ProjectsController.js"></script> 

corrected PLUNKER LINK

like image 100
harishr Avatar answered Apr 25 '23 08:04

harishr