UNPKG

consumerportal

Version:

mydna Custimised for you

58 lines (47 loc) 1.8 kB
/// <reference path="../../includes.ts" /> module app { import IUser = services.IUser; class SportsResult { public tab: string; public color: string; constructor( public title: string, public description: string, public tabs: any[]) {} } class Controller { public details: any; public selected: any; public loaded: boolean = false; public navigation: any[] = this.sportsService.navigation(); public coloursets: any = { ACTN3: { CC: 'green', CT: 'orange', TT: 'red'}, AGT: { 'TT / CT': 'orange', TT: 'orange', CT: 'orange', CC: 'green'}, AMPD1: { CC: 'green', CT: 'orange', TT: 'red'}, PPARGC1A: { GG: 'green', AG: 'orange', AA: 'red'}, COL1A1: { TT: 'green', 'GG / GT': 'orange', GG: 'orange', GT: 'orange'}, COL5A1: { CC: 'orange', 'TT / CT': 'red', TT: 'red', CT: 'red'}, IL6: { GG: 'green', 'CG': 'orange', CC: 'red'} }; static $inject = [ '$scope', 'sportsService', 'user' ]; constructor( $scope: angular.IScope, private sportsService: services.ISportsService, public user: IUser ) { $scope.$on('dietMetricsChanged', (ev: any, details: any) => { this.details = details; this.selected = this.details[this.details.goal]; }); sportsService.details().then((value: any) => { this.details = value; this.loaded = true; }); } } angular.module('app').controller('sportsResultsCtrl', Controller); }