Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // A mixin for `Em.ContainerView` that allows an initial render from
- // a template, followed by further additions by mutating childViews.
- // Note that the template should *only* contain calls to
- // `{{childView}}`
- App.Mixins.TemplateContainerView = Em.Mixin.create({
- render: function() {
- if (!this.get('_renderedFromTemplate')) {
- Em.View.prototype.render.apply(this, arguments);
- this.set('_renderedFromTemplate', true);
- } else {
- return this._super.apply(this, arguments);
- }
- }
- });
- App.Views.TemplateContainerView = Em.ContainerView.extend(App.Mixins.TemplateContainerView);
Add Comment
Please, Sign In to add comment