R
R
Roman Ogarkov2015-12-28 18:32:20
JavaScript
Roman Ogarkov, 2015-12-28 18:32:20

How to delete an object after it's initialized?

There is an ItemView:

define([
  'backbone.marionette',
  'hbs!templates/tables/left-container',
  'views/tables/item/report-add-btn',
  'views/tables/item/journal-operator/btn',
  'views/tables/item/journal-anxiety/btn'
  ],
function (Marionette, LeftContainer, ReportAddBtn, JournalOperatorBtn, JournalAnxietyBtn) {
  return Backbone.Marionette.ItemView.extend({
    template: LeftContainer,
    el: '.left-nav-container',
    initialize: function () {
      this.render();
      new ReportAddBtn;
      new JournalOperatorBtn;
      new JournalAnxietyBtn;
    }
  });
});

I initialize like this:
new LeftContainer;
How to delete an object created in this way without traces???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Turar Abu, 2015-12-28
@kemply

delete LeftContainer;

A
aen, 2015-12-28
@aen

When you initialize, write:
When you delete, write:
delete leftContainer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question