title: how to get device id of a computer and browser in angular 5?
body: <p><a href="https://i.stack.imgur.com/bnUK6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bnUK6.png" alt="enter image description here"></a>I am working in <strong>WEB</strong> bank app with angular 5. the task is I want to find out device id of a computer and browser name. </p>
  
  <p>i tried this NPM module:</p>
  
  <pre><code>npm install ngx-device-detector --save
  
  import { NgModule } from '@angular/core';
    import { DeviceDetectorModule } from 'ngx-device-detector';
    ...
    @NgModule({
      declarations: [
        ...
        LoginComponent,
        SignupComponent
        ...
      ],
      imports: [
        CommonModule,
        FormsModule,
        DeviceDetectorModule.forRoot()
      ],
      providers:[
        AuthService
      ]
      ...
    })
  
  import { Component } from '@angular/core';
    ...
    import { DeviceDetectorService } from 'ngx-device-detector';
    ...
    @Component({
      selector: 'home',  // &lt;home&gt;&lt;/home&gt;
      styleUrls: [ './home.component.scss' ],
      templateUrl: './home.component.html',
      ...
    })
  
    export class HomeComponent {
      deviceInfo = null;
      ...
      constructor(..., private http: Http, private deviceService: DeviceDetectorService) {
        this.epicFunction();
      }
      ...
      epicFunction() {
        console.log('hello `Home` component');
        this.deviceInfo = this.deviceService.getDeviceInfo();
        console.log(this.deviceInfo);
      }
      ...
    }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{  
     "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
     "os":"windows",
     "browser":"chrome",
     "device":"unknown",
     "os_version":"windows-10",
     "browser_version":"66.0.3359.139"
  }
  </code></pre>
  
  <p>I am getting browser name but not device id. take a look at JSON. the device 
   is <strong>device: unknow</strong>. </p>
  
  <p><strong>If any other options or NPM Modules, please recommend me to accomplish this task.</strong></p>
  
  <p>please help me.</p>