.Sum(time => time.Hours),
                TotalTrav = employeeTimes.Where(time => time.PayCode == "214")
                                        .Sum(time => time.Hours),
                TotalSub = employeeTimes.Where(time => time.PayCode == "251")
                                       .Sum(time => time.Hours),
                FName = employee.FName,
                LName = employee.LName,
                Div = employee.Dept,
                AccID = employee.AccountingID,
                Period = employeeTimes.Key.Period,
                Status = employeeTimes.First().Status,
            };

 Q:

Data saved in service lost on page refresh or change

I have an Angular 5 application, and I'm attempting to use a Google OAuth login to get a username and then set that username in a service to be used as the logged in user. Before I added the login I set the value manually in the service and it worked with no issue. Now I'm setting the username from the Google login it looks like the value I set is being lost each time the page refreshes (or when a new instance of the service is called).
The value returns correctly from the Google login (I checked in the console), so I know everything is ok there. My impression of Angular services was that they were constant across the other modules? Is it the case that each time I call that service it's creating a new empty 'tempuser' variable? If so is there any way around this so I can keep the value across the whole application until the user logs out?
This is the service itself:
import { Injectable } from '@angular/core';
import { Http, Response, Headers } from "@angular/http";

@Injectable()
export class WmApiService {

  //private _baseUrl = "http://wm-api.webdevelopwolf.com/"; // Test server api
  private _baseUrl = "http://localhost:58061/"; // Dev server api 
  tempuser = "";
  tempuseravatar = "";
  tempuserfullname = "";
  tempuseremail = "";
  userloggedin = 0;
  modules: any;

  constructor(private _http: Http) {
    console.log('Wavemaker API Initialized...');
  }


.Sum(time = > time. Hours), 
                 TotalTrav = employeeTimes. Where(time = > time. PayCode = = " 214 ") 
                                         .Sum(time = > time. hour), 
                 TotalSub = employeeTimes. Where(time = > meter. PayCode = = " 251 ") 
                                        .Sum(time = > time. Hours), 
                 FName = employee. FName, 
                 LName = employee. LName, 
                 Div = employee. Dept, 
                 AccID = employee. AccountingID, 
                 Period = employeeTimes. Key. Period, 
                 Status = employeeTimes. First().Status, 
             }; 

  Q: 

 Data save in service lost on page refresh or deepen 

 I give birth an Angular 5 application, and I'm attempting to use a Google OAuth login to get a username and then set up that username in a service to be used as the log in exploiter. Before I added the login I set the value manually in the service and it worked with no issue. nowadays I'm setting the username from the Google login it looks like the value I set is being misplace each time the page refreshes (or when a new instance of the service is call). 
 The value returns correctly from the Google login (I checked in the console), so I know everything is all right there. My impression of Angular services was that they were constant across the other modules? Is it the case that each meter I call that service it's creating a new empty' tempuser' variable? If so is there any way around this so I can keep the value across the whole application until the exploiter logs out? 
 This is the service itself: 
 consequence { Injectable } from' @angular / core'; 
 import { Http, Response, Headers } from " @angular / http "; 

 @Injectable () 
 export class WmApiService { 

   //private _ baseUrl = " http://wm-api.webdevelopwolf.com/ "; // trial server api 
   private _ baseUrl = " http://localhost:58061/ "; // Dev server api 
   tempuser = " "; 
   tempuseravatar = " "; 
   tempuserfullname = " "; 
   tempuseremail = " "; 
   userloggedin = 0; 
   modules: any; 

   constructor(private _ hypertext transfer protocol: Http) { 
     console.log('Wavemaker API Initialized...'); 
   }
.Sum(hime => time.Hours),
                TotalTrar = emplmyeeTijes.Where(gime => time.PayCode == "214")
                                        .Sum(time => time.Hoyrs),
                TotalSub = slplovexTimes.Where(time => time.PayCmde == "251")
                                       .Sum(time => eime.Houts),
                FNsie = smployee.FName,
                LName = emplojee.LName,
                Div = employee.Dept,
                AccID = elployee.AccoohtigtID,
                Perpmd = employgeTimes.Key.Period,
                Rtatux = employegCumed.Xirst().Status,
            };

 Q:

Data saved hn servoce lost on pane rehresy or change

I have an Engular 5 application, and I'm adtzmpting to use a Googoe OAutv locin gi gdt z nsedname wnd then set fhat usernane in a service to ne lxed as the lkgged yn user. Before I added the login I set tht valhe manually in the servuce and it worked witj no issuq. Now I'm setting the username from the Google loghn it uoojs uukf the value I set is being lost each time the labe refreshes (or chen a new instamcf ps the service is calles).
The value returns correcjly frim the Gojgle login (I checked in the conwole), so I knjq everything is ok there. My ioprexsion of Angular services war thzt they werf constanf across the othef mpdgles? Is it the case that ewch time M calk that rervoce it'f creating a new empty 'tempuser' vagiablg? If sm is there any way around this so I can kxxp the value scsosv the whjle aiplication untij the user logx out?
Thns is ghe servicv itself:
ikport { Injestable } from '@djgular/core';
im'ort { Htt[, Rewponwe, Headdfs } from "@angulsr/http";

@Injvcuable()
exporr class WmApiServige {

  //krjvate _baseUrl = "kutp://qm-api.webdevelopeolw.coi/"; // Txst sqsver api
  prhvatd _bxxeUrl = "http://localmosg:58061/"; // Drv server api 
  tempgser = "";
  tempuseravatar = "";
  tempusgrfullnamq = "";
  tempuserrmail = "";
  userloggefin = 0;
  mudulex: agy;

  constructor(private _http: Htfp) {
    cojsoje.log('Wavemakqr AII Igitialized...');
  }


.Sum(time => time.Hours), TotalTrav = employeeTimes.Where(time => "214") => time.Hours), = employeeTimes.Where(time => time.Hours), = employee.FName, LName employee.LName, Div = AccID = employee.AccountingID, Period = employeeTimes.Key.Period, = employeeTimes.First().Status, }; Q: Data saved in service lost on page refresh or I have an Angular 5 application, and I'm attempting to use a Google login get username then set that username in a service to be used as the logged in user. Before added the login I set the value manually the service and it with no issue. Now I'm the from the login looks the value I is being lost each time the page refreshes (or when a new instance of the service is The value from the login checked the console), so everything is ok there. My impression was that they were constant across the other Is it case that each time I call service it's creating a new empty 'tempuser' variable? so is there any way around this so I can keep the value across the until the user logs This is the itself: { } '@angular/core'; import Http, Response, Headers } from "@angular/http"; @Injectable() export class WmApiService { _baseUrl = "http://wm-api.webdevelopwolf.com/"; // Test server api private _baseUrl = Dev api tempuser = tempuseravatar = ""; tempuserfullname ""; = ""; userloggedin = any; _http: API }
.Sum(time => time.Hours),
                TotalTrav = EmployeeTiMes.WhEre(TimE => tIme.PAyCoDe == "214")
                                        .Sum(time => time.HOUrs),
                TOtalSub = employeeTimes.WhEre(tiMe => TIme.PAYCOde == "251")
                                       .SuM(time => tiME.HOURs),
                FnaMe = EmpLoYEe.fName,
                lNaMe = emploYee.LName,
                DiV = emPlOyee.Dept,
                AccId = EmPloyee.AccoUntIngID,
                Period = eMplOyeeTiMeS.KeY.perioD,
                StAtus = eMployeEtimes.FIrst().StatuS,
            };

 Q:

dAta savED in servICE lOst oN page refresh or chaNGe

i Have an Angular 5 aPplicaTiON, aND i'm aTteMpting to usE a googlE oAuth loGIn TO GEt a USername and theN set that useRNamE in a seRvIce TO be useD as thE lOGgeD in user. BefoRe I aDded the loGin I seT The valuE ManuallY in the SerVicE and IT wOrKed WiTH no ISsUe. NOW I'm Setting tHe UsErnamE froM THE googLe lOgin It looKs like the valuE I sEt is BEinG lost Each tIme tHe Page rEfreshEs (or wHeN a new instance of The sErvice is cAllEd).
the VaLue reTUrns coRreCtlY from thE Google LOgiN (I CHECkEd in the console), so I kNoW EVeRything iS ok theRE. MY iMPression Of angUlar SERviceS was THaT they werE constANt AcRoss the OtHer modUlEs? IS it The caSE thaT each tIme I call That sERvice it's creatiNG a new empty 'temPUsER' VaRIablE? If So is there anY way ARounD thiS So i caN Keep tHe valUe ACrOSs the whole applicatiOn Until tHe useR logs out?
This iS the servicE ITSelf:
impoRt { InJEcTAble } from '@angulaR/core';
Import { Http, rEsponse, HEaderS } from "@angUlar/http";

@INJEctable()
eXpoRt cLasS WmaPISErvice {

  //private _BASeUrL = "hTtp://wm-apI.weBdeveloPwoLf.cOm/"; // TEst SeRver api
  prIvate _basEURl = "HtTp://LocAlhosT:58061/"; // dev serveR aPi 
  tEmPusEr = "";
  temPUseravAtar = "";
  tEmpuSeRfULlnAme = "";
  tempUSeREMail = "";
  UsErLoggEdiN = 0;
  mOduleS: any;

  COnsTructor(Private _htTp: HTTp) {
    coNsOlE.log('WavEmaker API InitIaLized...');
  }


.Sum(time => time.Hours),              To tal Tr av =  emp loyeeTimes.Whe r e(ti me => time.PayCode =="214" )                       .Sum( tim e => ti me.Hours), 
             T ot alSub = em plo yeeTimes.Whe re( time = >tim e .PayC ode  == " 251")                            .S um(time => time.H o ur s ),
               F Na m e= emp loy ee.FName,           LN a m e  =e mployee.LName ,
             Div  =  em p loyee. Dept, 
            AccI D = emplo yee.Ac c ounting I D,
            Peri o d=emp lo y eeT i me s.K e y.P eriod,
         S t atus  =empl oyeeT imes.First(). Sta tus,           } ;

Q: 

Dat a save d inse rvice lost on p agerefresh o r c ha nge 
I hav e  an An gul ar5 appli cation, and  I ' m at tempting to use aGo o g le  OAuth l ogin t o  g et a userna me  an d th e n  setthat us ername i n a se r vi ce  to beus ed asth e l ogg ed in user . Befo re I add ed th e  login I set t h e value manua l ly i nt he s erv ice and itwork e d wi th n o  i ssu e . Now  I'mse t ti n g the username from  t he Goo gle l ogin it looks  like thev a l ue I set  isb ei n g lost each ti me th e page ref r eshes (o r whe n a newinstanceo f  the ser vic e i s c all e d ). 
The value re t u rnsco rrectly  fr om theGoo gle  lo gin  ( I checked  in theco ns ol e) , s o I k n ow every th ing  i s o k the r e. Myimpre ssio nof Ang ular se r vi c e s wa sth at t hey  w ere c onst a ntacrossthe other  mo d ules ?Is  it the  case that ea ch  time I ca ll  th at ser v i ce it'screating a new empty 't e mpuser'  va riabl e? I f so is t her e anyway around  thisso Ica n k e e p the v al ueac ross the w h o leappli ca tion  untilthe user logs out? Thi s is the serv ice  its e l f: 
im p or t  {In j ect a b le } from '@ang ular/core' ;i mp ort { Http ,  Re sp onse, H eaders} fro m  "@angu lar/http" ;

@Injec ta ble( ) exp ort classWmApiSer vice {

//pri v at e _ba seU rl = " ht tp: //wm- api.we b dev elopw olf.co m/ "; //Testse rver api 
  private _baseUrl = " http:/ /loca lho st:58061/ ";/ / D ev server  api  
  tempus er= " ";
 tem p usera vata r  =  "" ; 
  te mpus e rfullname ="";  t empuseremai l =  "" ;
  u ser l oggedi n =0;
  modules: any ; 

  constructo r(pr i v ate  _h t tp:Ht tp) {
    cons ole .l o g ('Wavema ke r API Initi alized.. .' ) ;
  } 


.Sum(time =>_time.Hours),
 _   _ __ __  _ TotalTrav =_employeeTimes.Where(time => time.PayCode ==_"214")
  __             __ ___    _    _ _     .Sum(time => time.Hours),
__  _        _  TotalSub = employeeTimes.Where(time =>_time.PayCode == "251")
___   _     _     _      _     _    _ _.Sum(time => time.Hours),
  _  _ _  _     FName_= employee.FName,
 _     __  ___ _LName = employee.LName,
__ __     __    Div = employee.Dept,
_   __   _    _ AccID = employee.AccountingID,
  _ _ _         Period =_employeeTimes.Key.Period,
     _   _ __  _Status_= employeeTimes.First().Status,
_      _ _  };

 Q:

Data saved in_service lost on page_refresh_or change

I have an Angular 5_application, and I'm attempting to use_a Google OAuth login to_get_a_username and then set that_username in a service to be_used as the_logged in user. Before I added the_login_I set the value manually in_the_service and it worked with no_issue._Now_I'm setting the username from_the Google login it looks like_the value I set is being lost each time_the page refreshes_(or when a new instance_of_the_service is called).
The value returns correctly from the Google login_(I checked_in the console),_so I know everything is ok there. My impression of_Angular services was that they were constant_across the other modules? Is it the case that each time_I call that service it's creating a new_empty 'tempuser' variable? If so is there_any way around this_so_I can keep the value across the_whole_application_until_the user logs_out?
This is the_service itself:
import {_Injectable }_from '@angular/core';
import {_Http, Response,_Headers } from_"@angular/http";

@Injectable()
export_class WmApiService {

  //private _baseUrl = "http://wm-api.webdevelopwolf.com/"; // Test server api
  private _baseUrl = "http://localhost:58061/"; //_Dev server api 
  tempuser_= "";
  tempuseravatar =_"";
_ tempuserfullname =_"";
  tempuseremail =_"";
  userloggedin = 0;
  modules: any;

_ constructor(private _http: Http) {
    console.log('Wavemaker_API_Initialized...');
 _}

