UNPKG

consumerportal

Version:

mydna Custimised for you

55 lines (43 loc) 1.76 kB
/// <reference path="../../includes.ts" /> module app { import IAlcoholReport = services.IAlcoholReport; class Controller { public details: any; public loaded: boolean = false; public phenotype: string; public outcome: string; public recommendations: string; public interpretations: string; static $inject = ['$scope', '$sce', '$routeParams', 'alcoholService', 'user']; constructor( private $scope: angular.IScope, private $sce: angular.ISCEService, private $routeParams: angular.route.IRouteParamsService, private alcoholService: services.IAlcoholService, public user: services.IUser ) { alcoholService.details($routeParams.ADH1B, $routeParams.ALDH2).then((value: any) => { this.details = value; let report: IAlcoholReport = alcoholService.getReport(); this.phenotype = report.Phenotype; this.outcome = $sce.trustAsHtml(report.Outcome); this.recommendations = $sce.trustAsHtml(report.Recommendation); this.interpretations = $sce.trustAsHtml(report.Interpretation); this.loaded = true; $('body').addClass('printing'); $scope.$on('$destroy', () => { $('body').removeClass('printing'); }) }); } public open(hash: string) { window.location.hash = hash; } public print() { window.print(); } } angular .module('app') .controller('alcoholReportCtrl', Controller); }