import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class FuseUtilsService { /** * Constructor */ constructor() { } // ----------------------------------------------------------------------------------------------------- // @ Public methods // ----------------------------------------------------------------------------------------------------- /** * Generates a random id * * @param length */ randomId(length: number = 10): string { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let name = ''; for ( let i = 0; i < 10; i++ ) { name += chars.charAt(Math.floor(Math.random() * chars.length)); } return name; } }