執行僅除錯程式碼
Ember 有一個名為 runInDebug 的靜態全域性方法,它可以執行一個用於除錯的函式。
Ember.runInDebug(() => {
// this code only runs in dev mode
});
在生產版本中,此方法被定義為空函式(NOP)。在 Ember 本身中使用此方法將從 ember.prod.js
版本中刪除。
Ember 有一個名為 runInDebug 的靜態全域性方法,它可以執行一個用於除錯的函式。
Ember.runInDebug(() => {
// this code only runs in dev mode
});
在生產版本中,此方法被定義為空函式(NOP)。在 Ember 本身中使用此方法將從 ember.prod.js
版本中刪除。