(function(){ 'use strict'; angular.module('raz') .component('phonicsLessonAssembly', { templateUrl: '/js/angular/phonics-lesson/components/phonics-lesson-assembly.html', controller: 'PhonicsLessonAssemblyController', bindings: { assembly: '<', orientation: '@' } }) .controller('PhonicsLessonAssemblyController', PhonicsLessonAssemblyController); PhonicsLessonAssemblyController.$inject = ['_']; function PhonicsLessonAssemblyController(_) { var ctrl = this; ctrl.$onInit = function() { ctrl.singleSidedHref = ctrl.assembly['Single-sided book assembly']['download_href']; ctrl.doubleSidedHref = ctrl.assembly['Double-sided book assembly']['download_href']; ctrl.singleSidedVideoId = ctrl.orientation === 'landscape' ? '496' : '500'; ctrl.doubleSidedVideoId = ctrl.orientation === 'landscape' ? '498' : '502'; ctrl.orientationTitle = ctrl.orientation === 'landscape' ? 'Landscape' : 'Portrait'; ctrl.imageType = ctrl.orientation === 'landscape' ? 'h' : 'v'; }; } })();