Answer the question
In order to leave comments, you need to log in
Why is the behavior of a service different from that of the constructor function of that service?
There is a class C which I use as a service. When I get it in the run method and manually create class A, everything works fine, that is, the render result is visible. But if I design class A as a service, then nothing is displayed. In the console, a manually created object and a service object look exactly the same.
what could be the problem? If this is such synchronicity, then why does it only apply to angular objects? And to be honest, this cannot be synchronicity, since I see that the service is created before I add it. What's the matter? I understand that you do not understand what kind of render I have there ... Canvas render .. At least express your thoughts, otherwise I don’t have any at all.
class A {
constructor(){
// здесь происходит создание класса B и его рендер
}
}
class C {
constructor(){
}
addChild(child){
this._stage.addChild(child);
}
}
// и где-то в коде
var a = new A();
stageService.addChild(a); // все прекрасно рендерится
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question