stephanos
stephanos

Reputation: 3339

How to give EmberJS class a name in console?

I just had this error:

Uncaught Error: assertion failed: Target <(subclass of Ember.View):ember508> does not have action doSubmit

And I was asking myself: How I can I give my EmberJS subclasses an actual name for its console output?

UPDATE

I'm using require.js:

define [
    "ember"
], (Em) ->
    Em.View.extend
        templateName: "user"

Upvotes: 1

Views: 97

Answers (1)

sly7_7
sly7_7

Reputation: 12011

It seems like this view is an anonymous view, maybe created by Ember itself if you used {{view Ember.View }} helper.

For defining an named view, you should declare it in js, App.MyView = Ember.View.extend()

If this does not answer correctly to your question, I'd suggest to complete it by adding some more code and templates.

UPDATE: Seeing https://github.com/emberjs/ember.js/blob/master/packages/ember-runtime/lib/system/core_object.js#L251, it seems if you don't define an Ember namespce, this information is lost, but perhaps you can override the toStringExtension function in your view, returning what string you want, and it should work. I've not yet tried this, so I'm interrested :)

Upvotes: 3

Related Questions