injectLoader
injectLoader is a utility function that abstracts the process of loading 3D assets.
It accepts:
- A function that returns a THREE.Loaderconstructor
- A function that returns a stringorstring[]
- An option object that accepts the following properties:
- extensions: A function that accepts a- THREE.Loaderand returns nothing. It is used to extend the loader with additional functionality.
- onLoad: A function that accepts the loaded data and returns nothing. It is called after the loader has finished loading the data.
- onProgress: A function that accepts a- ProgressEventand returns nothing. It is called when the loader emits a progress event.
- injector: An- Injectorinstance. It is used to set the Injection Context for the loader
 
import { injectLoader } from 'angular-three';
@Component({  template: `    @if (gltfResult(); as gltf) {      <ngt-primitive *args="[gltf.scene]" />    }  `,})export class Experience {  gltfResult = injectLoader(() => GLTFLoader, () => 'path/to/model.glb');}