Hello I'm trying to inject variable with DI of Angular 2 to change a state of object initialized inside BabylonJs.
I used [(ngModel)]="Service.var"
to read the variable and ngModel Change)="methode"
to recall a methode inside my component.
The result is a big stress with the node server and a big augmentation with memory.
The best explanation that the old component is not removed and each time i triggered a DI a new instance of Babylon JS is recreated.
Objective: WebGl Object read the changes from the Injectable()
class without create a new instance:
my goal is to find a way to change the state of matrix object created the first time inside the createSeane()
called by the Babylon JS engine without reinstate the first reference that was create and see the changes in the real time.
if a click is realized in the menu component the service will change and the Babylon JS component will detect the changes and do again the again the calculation with the new changes and draw in the canvas the new changes.
How can I implement the best design pattern and how should I fix the problem and achieve my objective ?