Function

Available since v1.5.0

func
Function
The function to be executed.

Run a function meant for debugging.

  • In a production build, this method is defined as an empty function (NOP). Uses of this method in Ember itself are stripped from the ember.prod.js build.
1
2
3
4
5
6
7
8
9
10
import Component from '@ember/component';
import { runInDebug } from '@ember/debug';

runInDebug(() => {
  Component.reopen({
    didInsertElement() {
      console.log("I'm happy");
    }
  });
});