You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an item is inserted to an array, the rendering has a glitch: the new item is shown multiple times at the end of the list (N times where N is the total length of the list - I think). The extra items are shown only for a fraction of a second, after which they disappear. But, on another app the extra items are not disappearing until a page refresf (not sure why).
varapp=module.exports=require('derby').createApp('hello',__filename);app.loadViews(__dirname);varComments;app.component(Comments=(function(){functionComments(){}Comments.prototype.name='comments';Comments.prototype.add=function(){varcomment={id: this.model.id(),text: this.model.root.get('_page.comment')}console.log(this.model.root.get('_page.comment'));this.model.root.push('_page.comments',comment);};returnComments;})());// Routes render on client as well as serverapp.get('/',function(page,model){// Subscribe specifies the data to syncvarcomments=model.at('comments.foo')model.subscribe(comments,function(err){model.ref('_page.comments',comments.at('list'));page.render();});});
<Body:><viewname="comments" as="comments"></view><viewname="list" comments="{{_page.comments}}"></view><viewname="comment-form"></view><list:><ul>{{each @comments as #comment}}<viewname="comment"></view>{{/}}</ul><comment:><li>{{unescaped #comment.text}}</li><comment-form:><form><inputvalue="{{#root._page.comment}}"><buttonon-click="comments.add()">Add</button></form>
The text was updated successfully, but these errors were encountered:
AttributePathExpression.prototype.dependencies=function(context,forInnerPath){varattributeContext=context.forAttribute(this.attribute);// Attributes are either a ParentWrapper or a literal valuevarvalue=attributeContext&&attributeContext.attributes[this.attribute];varinner=value&&(typeofvalue.dependencies==='function')&&value.dependencies(attributeContext,true);varouter=outerDependency(this,context,forInnerPath);returnconcat(outer,inner);};
This function was returning segments that didn't seem right for the each block. That is, the <li> were getting segments such as _page.comments which should be defined only for the <ul> I think.
We have recently been actively updating the Derby and Racer packages, and both repos are now in Typescript and published with types on npm. As we have quite a few old issues open we have made the decision to close out of date issues.
If this issue still matters to you we encourage reproducing against the current versions of the repo and opening a new issue.
When an item is inserted to an array, the rendering has a glitch: the new item is shown multiple times at the end of the list (N times where N is the total length of the list - I think). The extra items are shown only for a fraction of a second, after which they disappear. But, on another app the extra items are not disappearing until a page refresf (not sure why).
A video of it: http://youtu.be/NbDkqKqqCAM
The code is simple:
The text was updated successfully, but these errors were encountered: