Ember.JS and Coffeescript wrapping all Coffescript objects #157

bchaney opened this Issue Mar 18, 2013 · 2 comments


None yet

3 participants


I'm trying to use ember.js to render only part of a page and am running into some trouble with other Coffeescript objects on the page. When using #=require ember in my application.js.coffee, it forces itself into all objects on that page. I only want ember to control part of the page that I am rendering.

On the page in question I initialize ember as following:

<%= content_for :javascript do %>
  <script type="text/javascript">
<% end %>

(($) ->
  namespace 'AT.Test.Activity', (exports) ->
    exports.init = () ->
      Activity = Ember.Application.create()
) jQuery

If I log any object that was created through coffeescript but in a completely different file and namespace, I see the following proto always attached to it:

[Object, isEnumerable: true, nextObject: function, firstObject: undefined, lastObject: undefined, contains: function…]
  0: Object
  length: 1
  __proto__: Array[0]
    @each: undefined
    []: undefined
    __ember1363643717872_meta: Meta
    addArrayObserver: function (target, opts) {
    addBeforeObserver: function (key, target, method) {
    addEnumerableObserver: function (target, opts) {
    addObject: function (obj) {
    addObjects: function (objects) {
    addObserver: function (key, target, method) {
    arrayContentDidChange: function (startIdx, removeAmt, addAmt) {
    arrayContentWillChange: function (startIdx, removeAmt, addAmt) {
    beginPropertyChanges: function () {
    cacheFor: function (keyName) {

If I expand the 0: Object field it shows me the original object that I don't want wrapped.

Is there any way to prevent this wrapping from happening?

Ember.js member

this isn't a ember-rails issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment