AngularJS tips and tricks – broadcast online and offline status

Mr. D:

AngularJS tips and tricks – broadcast online and offline status

Originally posted on Terkildsen's Blog:

In continuing my experiments with AngularJS, I often stumble upon new challenges, I haven’t met before. One of these challenges was to broadcast the online and offline status of the browser.

I wanted to be able to hide different parts of the gui, if the user wasn’t online. In order to do that, I had to create a centralized variable, that would notify the gui whenever changes occurred. I did this by applying the following code in my app:


As you can see, the function adds an event listener that will…

View original 37 more words

Convert Utc time to local time zone c#

 /// <summary>
 /// converts utc date time to local time zone date time 
 /// </summary>
 /// timeUtc">
 /// <returns></returns>
 public static DateTime ConvertTimeFromUtc(DateTime timeUtc)
 DateTime destTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, TimeZoneInfo.Local);
 return destTime;

Read More here