File

src/app/services/ip.service.ts

Index

Methods

Methods

Async getLocalIpAddress
getLocalIpAddress()
Returns : Promise<string | undefined>
import { Injectable } from '@angular/core';
import { internalIpV4 } from 'internal-ip';


@Injectable({
  providedIn: 'root'
})
export class IpService {
  async getLocalIpAddress(): Promise<string  | undefined> {
    const ipAddress = await internalIpV4();
    console.log(ipAddress)
    return ipAddress;
  }
}

results matching ""

    No results matching ""