Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7930549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:27:45+00:00 2026-06-03T20:27:45+00:00

In a method on an Ember.View subclass, I would like to make changes to

  • 0

In a method on an Ember.View subclass, I would like to make changes to the DOM only if the view element has already been inserted into the DOM. How can I check that?

I know I could create an auxiliary property like so:

didInsertElement: function() {
  this.set('elementIsInserted', true);
}
willDestroyElement: function() {
  this.set('elementIsInserted', false);
}

But is there some canonical, built-in way?

I didn’t find anything skimming view.js, but perhaps I’m missing something.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:27:47+00:00Added an answer on June 3, 2026 at 8:27 pm

    If you want to avoid having to set an auxiliary flag, you can extend Ember.View:

    Ember.View.reopen({
        didInsertElement: function() {
           this.set('elementIsInserted', true);
           this._super();
        },
    
        willDestroyElement: function() {
           this.set('elementIsInserted', false);
           this._super();
        }
    });
    

    Now every View that extends Ember.View will get the above.

    Also a member of the core team suggested that you avoid referring to inDOM as it is an internal variable and not intended to be used in code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found a helper method that I would like to use to resize embedded
I have a basic Ember application. It has 2 controls: a select element and
What method would you use to determine if the the bit that represents 2^x
ExecuteQuery() method returns an IEnumerable but is there a way to make it return
I've been looking around for a method to embed and call javascript functions in
I would like to know how to embed my div tag, which I want
I would like to use the universal code and have ran into difficulties getting
what is the use of ready method in Ember.Application? Will it be called after
In this subclass of UIWebView, I am looking to set up a method to
I am creating a lightweight, single-file database administration tool and I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.