(function() { "use strict"; angular.module('raz') .component('autoAssignedGoalSetNotification', { templateUrl: '/js/angular/connected-classroom/components/auto-assigned-goal-set-notification.html', controller: 'AutoAssignedGoalSetNotificationController', bindings: { categoryId: '<', additionalClass: '@?' } }) .controller('AutoAssignedGoalSetNotificationController', ['autoAssignedGoalSets', function AutoAssignedGoalSetNotificationController(autoAssignedGoalSets) { var ctrl = this; ctrl.$onInit = function() { autoAssignedGoalSets.getAutoAssignedStudentsForGoalSet(ctrl.categoryId) .then(function(result) { ctrl.students = result; var isMultipleStudents = ctrl.students.length > 1; ctrl.studentString = ctrl.students.length; ctrl.studentString += isMultipleStudents ? ' students' : ' student'; ctrl.hasString = isMultipleStudents ? 'have' : 'has'; }) }; } ]) })();