'Easiest way to display a 3d model in Angular 4.0?

I’m new to development and I’m making my own portfolio website to display some models and some products I’ve worked on in my career. The 3-d models are fairly simple and I can export them in pretty much any format (obj, stl, gltf etc..). I’m building the project in Angular and it’s almost done so I would very much like to stick with it, with that in mind does anyone have any fairly simple suggestions to display 3-d models? I have had a look into threeJS but without clear working examples in angular im struggling to get it working. I did stumble upon the npm module “angular-stl-model-viewer” but once I’ve successfully installed it into an angular project directory via npm, and then try to import it in to app.module.ts I get errors. I think this may be due to the module being quite old.

Error below.

Build at: 2022-04-14T18:30:38.090Z - Hash: 81dc5d17ac2a0515 - Time: 7538ms

Error: node_modules/three/src/renderers/WebGLRenderer.d.ts:35:31 - error TS2304: Cannot find name 'OffscreenCanvas'.

35 canvas?: HTMLCanvasElement | OffscreenCanvas; ~~~~~~~~~~~~~~~ × Failed to compile.

Any help would be great thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source