import { Injectable } from '@angular/core' ; import * as THREE from 'three' ; import { AbstractCacheService } from './abstract-cache.service' ; @ Injectable ( ) export class FontService extends AbstractCacheService < THREE . Font > { protected getValue ( key ) { return new Promise < THREE . Font > ( resolve => { const loader = new THREE . FontLoader ( ) ; loader . load ( key , resolve ) ; } ) ; } }