-1

The onBeforeRendering() function yesterday ran one when app starts, today in the morning it runs twice. And I have no idea why.

Here is the relavant part of the controller:

...
return Controller.extend("com.qv.controller.Household", { 
    variable: 1,
    onBeforeRendering: function() {
        console.log("variable",variable);
        this.variable++;
        ......
    },
    .......
}

In the console I see:

variable 1 controller_name.controller.js:14:7

variable 2 controller_name.controller.js:14:7

I navigate to this view from another view if it matters.

In a new project it runs once. I don't have any "rerender" things or stuff like that. How it is possible at all and how do I fix this?

Thank you.

keshet
  • 1,716
  • 5
  • 27
  • 54

1 Answers1

0

I think Your view which assign to controller rerender and lificycle method "onBeforeRendering" i run twice