projects/atft/src/lib/object/loader/services/font.service.ts
Properties |
|
Methods |
Protected getValue | ||||||
getValue(key: string)
|
||||||
Inherited from
AbstractCacheService
|
||||||
Defined in
AbstractCacheService:8
|
||||||
Parameters :
Returns :
Promise<Font>
|
Public Async load | ||||||
load(key: string)
|
||||||
Inherited from
AbstractCacheService
|
||||||
Defined in
AbstractCacheService:5
|
||||||
Parameters :
Returns :
Promise<V>
|
Protected cache |
Default value : new Map<string, Promise<V>>()
|
Inherited from
AbstractCacheService
|
Defined in
AbstractCacheService:3
|
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);
});
}
}