In angular the internal injectors for all of the scope controls are initialized by the app. You managed to detach your app from your controller definition so angular didn't know how to inject the pieces needed for the use of the $scope object.
Option 1
So to get this to work so you need to either define an app/module that get's passed into the space where the control is defined:
define(['angular'], function (angular) {
'use strict';
return angular.module('TP.controllers', []);
});
calendar control:
define([
"jquery",
"controllers",
"jqueryui",
"full_calendar",
"calendar",
],
function($, controllers) {
return controllers
.controller('calendarCtrl', ['$scope', function($scope) {
....
In which case you'd have to include every individual controller in your top level application like:
define([
'angular',
'controllers',
'calendarCtrl',
'full_calendar',
'calendar'
], function (angular, controllers) {
'use strict';
return angular.module('TP', ['TP.controllers', 'ui.calendar']);
});
Which to some degree defeats the purpose of using AMD.
Option 2
A better option is to define your calendar as it's own module then define it as a child of controllers. This maintains the angular injection chain so the scope has the proper context when initializing the calendar actions.
Defining the controllers root:
define(['angular', 'calendarCtrl'], function (angular) {
'use strict';
return angular.module('TP.controllers', ['calendarCtrl']);
});
Defining the calendar controller:
define([
"jquery",
"angular",
"jqueryui",
"full_calendar",
"calendar",
],
function($, angular) {
return angular.module('calendarCtrl', [])
.controller('calendarCtrl', ['$scope', function($scope) {
...
Working plunker of this version at http://plnkr.co/edit/Xo41pqEdmB9uCUsEEzHe?p=preview.