I want to implement a feature (in Angular2) i.e. After login, if a user keeps browser idle for 30 minutes, he should be logged out when coming back after 30 minutes. This has to be done by the front end only. 

I am using angular CLI of Angular version 2.4

How can I implement this feature in my Angular2 application?