@@ -23,40 +23,38 @@ import { extend } from 'angular-three';
2323import { Mesh , BoxGeometry } from ' three' ;
2424
2525extend ({
26- Mesh , // makes ngt-mesh available
27- BoxGeometry , // makes ngt-box-geometry available
28- /* ... */
29- MyMesh: Mesh , // makes ngt-my-mesh available
26+ Mesh , // makes ngt-mesh available
27+ BoxGeometry , // makes ngt-box-geometry available
28+ /* ... */
29+ MyMesh: Mesh , // makes ngt-my-mesh available
3030});
3131
3232// alternatively for demo purposes, you can use the following
3333// extend(THREE);
3434// This includes the entire THREE.js namespace
3535
3636@Component ({
37- // This Component is rendered in the Custom Renderer
38- standalone: true ,
39- template: `
40- <ngt-mesh>
41- <ngt-box-geometry />
42- </ngt-mesh>
43- ` ,
44- schemas: [CUSTOM_ELEMENTS_SCHEMA ], // required
45- changeDetection: ChangeDetectionStrategy .OnPush ,
37+ // This Component is rendered in the Custom Renderer
38+ template: `
39+ <ngt-mesh>
40+ <ngt-box-geometry />
41+ </ngt-mesh>
42+ ` ,
43+ schemas: [CUSTOM_ELEMENTS_SCHEMA ], // required
44+ changeDetection: ChangeDetectionStrategy .OnPush ,
4645})
4746export class SceneGraph {}
4847
4948@Component ({
50- // This Component is rendered normally in Angular.
51- selector: ' app-my-experience' ,
52- standalone: true ,
53- template: `
54- <ngt-canvas [sceneGraph]="SceneGraph" />
55- ` ,
56- imports: [NgtCanvas ],
49+ // This Component is rendered normally in Angular.
50+ selector: ' app-my-experience' ,
51+ template: `
52+ <ngt-canvas [sceneGraph]="SceneGraph" />
53+ ` ,
54+ imports: [NgtCanvas ],
5755})
5856export class MyExperience {
59- SceneGraph = SceneGraph ;
57+ SceneGraph = SceneGraph ;
6058}
6159```
6260
@@ -98,7 +96,7 @@ The consumers can add `web-types` property to the workspace's `package.json` and
9896
9997``` json
10098{
101- "web-types" : " node_modules/angular-three/web-types.json"
99+ "web-types" : " node_modules/angular-three/web-types.json"
102100}
103101```
104102
@@ -110,7 +108,7 @@ The consumers can enable it via `html.customData` in their `settings.json` file.
110108
111109``` json
112110{
113- "html.customData" : [" node_modules/angular-three/metadata.json" ]
111+ "html.customData" : [" node_modules/angular-three/metadata.json" ]
114112}
115113```
116114
@@ -122,7 +120,7 @@ Input bindings for `ngt-*` elements work the same way as they do in Angular.
122120
123121``` html
124122<ngt-mesh [position] =" [x, y, z]" [rotation] =" [x, y, z]" >
125- <ngt-mesh-basic-material color =" hotpink" />
123+ <ngt-mesh-basic-material color =" hotpink" />
126124</ngt-mesh >
127125```
128126
@@ -179,13 +177,13 @@ The consumers can query for the THREE.js entities like they would do in normal H
179177
180178``` ts
181179@Component ({
182- template: `
183- <ngt-mesh #mesh></ngt-mesh>
184- ` ,
180+ template: `
181+ <ngt-mesh #mesh></ngt-mesh>
182+ ` ,
185183})
186184export class Box {
187- mesh = viewChild .required <ElementRef <Mesh >>(' mesh' );
188- // notice that it is an ElementRef of THREE.Mesh instead of an HTMLElement
185+ mesh = viewChild .required <ElementRef <Mesh >>(' mesh' );
186+ // notice that it is an ElementRef of THREE.Mesh instead of an HTMLElement
189187}
190188```
191189
@@ -195,18 +193,18 @@ In order to participate in the animation loop, use `injectBeforeRender` inject f
195193
196194``` ts
197195@Component ({
198- /* ...*/
196+ /* ...*/
199197})
200198export class Box {
201- mesh = viewChild .required <ElementRef <Mesh >>(' mesh' );
202-
203- constructor () {
204- injectBeforeRender (() => {
205- // runs every frame
206- const mesh = this .mesh ().nativeElement ;
207- mesh .rotation .x += 0.01 ;
208- });
209- }
199+ mesh = viewChild .required <ElementRef <Mesh >>(' mesh' );
200+
201+ constructor () {
202+ injectBeforeRender (() => {
203+ // runs every frame
204+ const mesh = this .mesh ().nativeElement ;
205+ mesh .rotation .x += 0.01 ;
206+ });
207+ }
210208}
211209```
212210
@@ -216,9 +214,9 @@ Angular Three keeps track of its state via an internal store. The consumers can
216214
217215``` ts
218216export class Box {
219- store = injectStore ();
220- viewport = this .store .select (' viewport' ); // Signal<NgtViewport>
221- camera = this .store .select (' camera' ); // Signal<NgtCamera> - the default camera
222- /* many more properties */
217+ store = injectStore ();
218+ viewport = this .store .select (' viewport' ); // Signal<NgtViewport>
219+ camera = this .store .select (' camera' ); // Signal<NgtCamera> - the default camera
220+ /* many more properties */
223221}
224222```
0 commit comments