Skip to content

Commit b38b4a5

Browse files
committed
fix: use NgtObjectEvents as host directive
1 parent f92a3d9 commit b38b4a5

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-three-gltf",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "GLTF to Angular Three converter",
55
"scripts": {
66
"cleanup": "rimraf node_modules"

src/utils/parser.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ function parse(fileName, gltf, options = {}) {
547547
const imports = `
548548
import type * as THREE from 'three'
549549
import { Group } from 'three'
550-
import { NgtGroup, NgtObjectEvents, NgtObjectEventsHostDirective${hasArgs ? ", NgtArgs" : ""} } from 'angular-three';
551-
import { Component, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Signal, input, computed, viewChild, ElementRef, inject, effect${hasAnimations ? ", model" : ""} } from '@angular/core';
550+
import { NgtGroup, NgtObjectEvents${hasArgs ? ", NgtArgs" : ""} } from 'angular-three';
551+
import { Component, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Signal, input, viewChild, ElementRef, inject, effect${hasAnimations ? ", computed, model" : ""} } from '@angular/core';
552552
import { injectGLTF } from 'angular-three-soba/loaders';
553553
import { GLTF } from 'three-stdlib';
554554
${hasAnimations ? "import { injectAnimations } from 'angular-three-soba/misc';" : ""}
@@ -585,7 +585,27 @@ ${printTypes(objects, animations)}
585585
imports: [NgtArgs],`
586586
: ""
587587
}
588-
hostDirectives: [NgtObjectEventsHostDirective],
588+
hostDirectives: [
589+
{
590+
directive: NgtObjectEvents,
591+
inputs: ['ngtObjectEvents'],
592+
outputs: [
593+
'click',
594+
'dblclick',
595+
'contextmenu',
596+
'pointerup',
597+
'pointerdown',
598+
'pointerover',
599+
'pointerout',
600+
'pointerenter',
601+
'pointerleave',
602+
'pointermove',
603+
'pointermissed',
604+
'pointercancel',
605+
'wheel',
606+
],
607+
},
608+
],
589609
schemas: [CUSTOM_ELEMENTS_SCHEMA],
590610
changeDetection: ChangeDetectionStrategy.OnPush
591611
})

0 commit comments

Comments
 (0)