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

  • Home
  • SEARCH
  • 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 7438717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:35:53+00:00 2026-05-29T10:35:53+00:00

Using ember-data, currently I’m loading data into the controller, on page load, as follows:

  • 0

Using ember-data, currently I’m loading data into the controller, on page load, as follows:

App.articlesController = Ember.ArrayController.create({
    content: App.store.findAll(App.Article)
});

Having a lot of controllers, this would result to a lot of requests. I would like to be able to fetch data from the server only when the controller is requested. Can you suggest, what is the “proper” way to do this?

  • 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-05-29T10:35:54+00:00Added an answer on May 29, 2026 at 10:35 am

    Zack,

    Have you looked at didInsertElement and willInsertElement? They will be called when a view did get put into the DOM or will get put into the DOM (respectively). I don’t think you need to use init here and you shouldn’t unless you have to.

    Another note: hardcoding references to controllers in your views isn’t best either. You should have a binding in your handlebars template. For example if your handlebars template has this:

    {{#view App.ArticlesView controllerBinding="App.articlesController"}}

    your view could then be something like:

    App.ArticlesView = Ember.View.extend({
      templateName: 'app_templates_layouts_articles',
    
      willInsertElement: function() {
        var controller = this.get('controller');
    
        if (controller && controller.get && controller.get('content') == null) {
          controller.refresh();
        }
      } 
    });
    

    That way if you ever need to reuse that view you can easily.

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

Sidebar

Related Questions

Using Ember.js I get an endless loop with the following code: Controller: App.activityDetailsController =
I am using Ember.js to create a table from a json feed. I have
I currently have a silverlight app designed mainly in expression blend, using a border
I am trying to use ember-data using https://github.com/emberjs/data as a reference. Specifically, I am
I'm using PHP from the command line and I'm trying to embed data into
I'm trying to embed a IPTC data onto a JPEG image using iptcembed() but
I'm using Webkit-sharp to embed Webkit into an application and I need to hook
Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into
Is it possible to embed a Gtk widget into an application using System.Windows.Forms? Thanks!
I am currently using App_data to store the dynamically created PDFs, Finding full path

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.