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 WebGL(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 changement in the real time. if a click is realized in the menu component the service will change and the webGL component will detect the changes and do again the again the calculation with the new changes and draw in the canvas the new changement.
how could i implement the best design pattern and how i fix the problem and achieve my objective ?
Aucun commentaire:
Enregistrer un commentaire