(function () { "use strict"; angular.module('vocabulary') .component('wordBank', { templateUrl: '/js/redesign-angular/lessonPreview/word-bank.html', controller: 'WordBankCtrl', bindings: { words: "<", wordOrder: "@" } }) .controller('WordBankCtrl', ['orderByFilter', 'FeatureCheck', function WordBankCtrl(orderByFilter, FeatureCheck) { var ctrl = this; ctrl.orderedWords = function() { if(!FeatureCheck.isFeatureEnabled('VAZ_REDESIGN_LESSON_WORD_ORDER')) { return orderByFilter(ctrl.words, 'word_name'); } switch (ctrl.wordOrder) { case 'As Entered': return orderByFilter(ctrl.words, 'entry_order'); case 'Alphabetical': return orderByFilter(ctrl.words, 'word_name'); default: return orderByFilter(ctrl.words, 'entry_order'); } } }]); })();