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
Assigning view collection in preLayout results in "Maximum call stack size exceeded" #901
Comments
@rparree Thanks for the issue! If you're reporting a bug, please be sure to include:
If your issue is related to one of the following, please open an issue there:
|
I am working on something like assemble/assemble-core#8 (comment) p.s. We should add a recipe for this afterwards. |
When the context is built for rendering the view, the view's I'd recommend using a helper to get to the collection. (or use the built-in "plural" helper): custom helperapp.helper('collection', function(name) {
// add some validation and error handling
return this.app.views[name];
}); {{#each (collection 'decks')}}
{{/each}} Built-in "plural" helperWe've been working on making this easier. The built-in helper will return a List created from the specified collection. Each view is in the {{#decks}}
{{#each this.items}}
{{/each}}
{{/decks}} I hope this is helpful. |
Great! I am getting the collection using the "plurals" form. In a previous version i used the following code to check if i was in the same "directory"/context: {{#is dirname ../dirname}}}
...
{{/is}} But even when i print : {{dirname}} - {{../../dirname}} or {{dirname}} - {{../dirname}} It only has a value for
|
I am adding the dirname to the data myself: app.preRender(/\.hbs$/, function (view, next) {
view.data.dirname = view.dirname;
next();
}); What happened to {{#each pages}}
<li{{#if this.isCurrentPage}} class="disabled"{{/if}}>… </li>
{{/each}} |
Forget this ( |
version
assemble
0.17.1
description
I am trying to assign a view collection to a data property on the view. I am using this technique in another project (which uses
assemble-core
version0.16.0
). On my current project i am trying to useassemble
however.This code works on my other project but not on my current one:
i am getting the following error message:
Maximum call stack size exceeded
When i assign any other value to
view.data.pages
it does not result in an error. I need this collection to create some lists with links to other pages.assemblefile.js
The text was updated successfully, but these errors were encountered: