OpenSlides/openslides/motions/static/js/motions/projector.js
2017-02-24 10:31:48 +01:00

38 lines
1018 B
JavaScript

(function () {
'use strict';
angular.module('OpenSlidesApp.motions.projector', [
'OpenSlidesApp.motions',
'OpenSlidesApp.motions.motionBlockProjector',
])
.config([
'slidesProvider',
function(slidesProvider) {
slidesProvider.registerSlide('motions/motion', {
template: 'static/templates/motions/slide_motion.html',
});
}
])
.controller('SlideMotionCtrl', [
'$scope',
'Motion',
'MotionChangeRecommendation',
'User',
function($scope, Motion, MotionChangeRecommendation, User) {
// Attention! Each object that is used here has to be dealt on server side.
// Add it to the coresponding get_requirements method of the ProjectorElement
// class.
var id = $scope.element.id;
$scope.mode = $scope.element.mode || 'original';
Motion.bindOne(id, $scope, 'motion');
User.bindAll({}, $scope, 'users');
MotionChangeRecommendation.bindAll({}, $scope, 'change_recommendations');
}
]);
}());