File

projects/atft/src/lib/object/loader/services/font.service.ts

Extends

AbstractCacheService

Index

Properties
Methods

Methods

Protected getValue
getValue(key: string)
Inherited from AbstractCacheService
Parameters :
Name Type Optional
key string No
Returns : Promise<Font>
Public Async load
load(key: string)
Inherited from AbstractCacheService
Parameters :
Name Type Optional
key string No
Returns : Promise<V>

Properties

Protected cache
Default value : new Map<string, Promise<V>>()
Inherited from AbstractCacheService
import {Injectable} from '@angular/core';
import {AbstractCacheService} from './abstract-cache.service';
import {Font, FontLoader} from 'three/examples/jsm/loaders/FontLoader.js';

@Injectable()
export class FontService extends AbstractCacheService<Font> {

  protected getValue(key: string): Promise<Font> {
    // console.log('FontService.getValue');
    return new Promise<Font>(resolve => {
      const loader = new FontLoader();
      loader.load(key, resolve);
    });
  }

}

results matching ""

    No results matching ""