Monday, May 21, 2018

Angular 4 - How to detect device in browser

Its very simple and straight forward to use plugin for Angular 4 typescript as below

Use plugin https://www.npmjs.com/package/ngx-device-detector which can be added to package.json to install as reference

Include in your app.module as below

import { DeviceDetectorModule } from 'ngx-device-detector';


imports: [
      DeviceDetectorModule.forRoot()
    ],

Include in your component or service as below


import { DeviceDetectorService } from 'ngx-device-detector';

constructor(private deviceService: DeviceDetectorService) {   }

To get device info use as below in component

this.deviceService.getDeviceInfo();  //This will get all device useragent info 
this.deviceService.isTablet(); //This will get device is tablet or not
this.deviceService.isDesktop(); //This will get device is desktop or not
this.deviceService.isMobile(); //This will get device is mobile or not



Wednesday, May 2, 2018

VS - Asp.Net core application not worked and run only on fiddler

I have faced some specific issue, where .Net core project was not running on my local machine visual studio and ruins only when Telerik Fiddler ruins. It always goes to 500 error page (only for me). I have tried changing all browser proxy settings, but those not fixed my

I was searching for my Outlook automatic replies not opened and calendar schedules not shown issue, for that got fix from Microsoft as https://support.microsoft.com/en-in/help/2847833/proxy-server-causing-issues-in-outlook-with-free-busy-oof-and-mailtips, surprisingly it fixed my visual studio .net core project issue. Try below steps to reset proxy