Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
feat(core): type safe ready for Points
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Dec 28, 2021
1 parent 2d2a7a9 commit ec84c88
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/core/points/src/lib/points.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import {
NgtMaterialGeometryController,
NgtMaterialGeometryControllerModule,
} from '@angular-three/core';
import { Directive, Inject, NgModule } from '@angular/core';
import {
Directive,
EventEmitter,
Inject,
NgModule,
Output,
} from '@angular/core';
import * as THREE from 'three';

@Directive({
Expand All @@ -17,10 +23,16 @@ import * as THREE from 'three';
],
})
export class NgtPoints {
@Output() ready = new EventEmitter<THREE.Points>();

constructor(
@Inject(NGT_MATERIAL_GEOMETRY_WATCHED_CONTROLLER)
private materialGeometryController: NgtMaterialGeometryController
) {}
) {
materialGeometryController.readyFn = () => {
this.ready.emit(this.points);
};
}

get points() {
return this.materialGeometryController.objectController
Expand Down

0 comments on commit ec84c88

Please sign in to comment.