"use strict"; angular.module("vocabulary") .component("premadeRazGraphic", { templateUrl: "/js/redesign-angular/premadeLessons/premade-resources-display.html", controller: "PremadeRazGraphicController", bindings: { categoryId: "<", parentCategoryId: "<", levels: "<", resources: "<", onUpdateNavigation: "&" } }) .controller("PremadeRazGraphicController",["$filter", function ($filter) { var ctrl = this; this.$onInit = init; ctrl.numColumns = "3"; ctrl.inclusiveFiltering = false; ctrl.requiresFiltering = false; function init(){ ctrl.onUpdateNavigation({ $event:{ selectedParentCategoryId: parseInt(ctrl.parentCategoryId, 10), selectedSubCategoryId: parseInt(ctrl.categoryId, 10) } }); ctrl.filteredResources = $filter('orderBy')(ctrl.resources , ['level', 'sortableTitle']); } ctrl.numColumnsIsFour = function(){ return true; }; ctrl.numColumnsIsThree = function(){ return false; }; }]);