"use strict"; angular.module("vocabulary") .component("commonCoreStandards", { templateUrl: "/js/redesign-angular/standardsAndCorrelations/standards/common-core-standards.html", controller: "CommonCoreStandardsController" }) .controller("CommonCoreStandardsController", ["standardsAndCorrelationsService", "$sce", function (standardsAndCorrelationsService, $sce) { var ctrl = this; this.$onInit = init; ctrl.edGateUrl = ""; ctrl.haveEdGateUrl = false; function init() { standardsAndCorrelationsService.setActiveStandardsCategory('commoncore'); ctrl.haveEdGateUrl = false; ctrl.gradeList = standardsAndCorrelationsService.getGradeListForCountry('us'); if(ctrl.gradeList != null){ ctrl.selectedGrade = ctrl.gradeList[0].value; } } ctrl.changeGrade = function(){ ctrl.edGateUrl = ""; ctrl.haveEdGateUrl = false; }; ctrl.updateStandards = function(){ console.log ("selected grade is:" + ctrl.selectedGrade ); ctrl.edGateUrl = $sce.trustAsResourceUrl(standardsAndCorrelationsService.getRequestUrl(ctrl.selectedGrade, 'CCK12', 'LA')); ctrl.haveEdGateUrl = true; }; } ]);