Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do use mixins in models #103

Open
rauhryan opened this issue Nov 14, 2013 · 0 comments
Open

How do use mixins in models #103

rauhryan opened this issue Nov 14, 2013 · 0 comments

Comments

@rauhryan
Copy link
Contributor

If I define a mixin and try and use it in a model the mixin is undefined on the App object when the model is defined.

var Serializable = Ember.Mixin.create({
  serialize: function () {
    var result = {};
    for (var key in $.extend(true, {}, this))
    {
        // Skip these
        if (key === 'isInstance' ||
        key === 'isDestroyed' ||
        key === 'isDestroying' ||
        key === 'concatenatedProperties' ||
        typeof this[key] === 'function')
        {
            continue;
        }
        result[key] = this[key];
    }
    return result;
  }
});

module.exports = Serializable;
var Model = Ember.Object.extend(App.Serializable, {});

App. Serializable is undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant