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 7644111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:36:22+00:00 2026-05-31T09:36:22+00:00

I have the following ember controller that is going to wait for json objects

  • 0

I have the following ember controller that is going to wait for json objects to be passed from a websocket server via the onmessage handler:

Lead.Controllers.ParsingController = Ember.Object.extend
  start_parsing: (url_search) ->
    socket = new Lead.WebSocket("ws://#{document.domain}:61615")

    socket.onopen = (evt) ->
      socket.send url_search.search_url

    socket.onmessage = (evt) ->
      Lead.leads_controller.addLead evt.data

My LeadsController currently looks like this:

Lead.Controllers.Leads = Ember.Object.extend

  addLead: (lead) ->    
    @view = Ember.View.create
      controller: @
      #etc.

My questions are these:

  1. Am I right not to use an ArrayController because they are only to be used for collections? Sorry for the obvious question but I just want to check.
  2. If I create a new view, everytime the addLead method is called, will I need to keep a reference to each view in an internal array and iterate over the array calling dispose on each child view when I am disposing of the main view?
  3. Would I be better off creating a separate controller for each child view that is appended? I am guessing no but would like to check.

Any help or guidance on these questions would be greatly appreciated.

  • 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-31T09:36:23+00:00Added an answer on May 31, 2026 at 9:36 am

    I’m not going to answer your specific questions, but rather suggest an alternate implementation that I think would be more idiomatic Ember and be simpler.

    It’s hard to tell what your broader view layer looks like, but I based on my guess at your problem domain, I would think that you would have a #each helper or CollectionView that is databound to a leadsController which subclasses ArrayProxy. When the json comes in from the websocket, call pushObject on the leadsController. Bindings will automatically update and render the new lead in the view output.

    If I misunderstood the app’s functionality, please do clarify.

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

Sidebar

Related Questions

I have a route that looks like the following: map.newsletter '/newsletter', :controller => newsletter
I have the following controller which contains a view: Lead.Controllers.UrlSearch = Ember.Object.extend init: ->
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have a project that involves three frontend developers. We're going to use backbone
I have the following ember.js code: app.js: Game = Ember.Application.create({ ready: function() { Game.gameController.getChallenge();
Say I have the following ember-data model: App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'),
I have the following element in an Ember view: {{view Ember.TextField size=30 valueBinding=urlSearch.search_url}} But
I have the following html file that plays a wav file when the user
I have the following URL format: example.com/page/m6aoeh/embed I want to block any bots from
I have the following html and js code snippets. Basically, I'm trying out Ember's

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.