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

Partial defined by registerView throws error after element is modified #2174

Closed
mjstahl opened this issue Jan 8, 2016 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@mjstahl
Copy link
Contributor

mjstahl commented Jan 8, 2016

can.view.registerView('partial', '{{name}}');

var data = new can.Map({
  items: [
    {name: 'foo'},
    {name: 'bar'},
    {name: 'baz'}
  ]
});

var renderer = can.stache('{{#each items}}{{>partial}}{{/each}}');

can.$(document.body).append(renderer(data));

setTimeout(function() {
  data.attr('items.0.name', 'WORLD');
}, 1000);

setTimeout(function(){
  data.attr('items').splice(0, 0, {name: 'HELLO'});
}, 2000);

Uncaught TypeError: Cannot read property 'insertBefore' of null

can.insertBefore @ can.jquery.js:685add @ can.jquery.js:4325can.dispatch @ can.jquery.js:546can.batch.stop @ can.jquery.js:1433Map.extend.splice @ can.jquery.js:3246(anonymous function) @ dalamevoca.js:20

@justinbmeyer justinbmeyer added this to the 2.3.9 milestone Jan 8, 2016
mjstahl pushed a commit that referenced this issue Jan 11, 2016
Use latest Testee

Partials should leave binding to their helpers and properties

Changed jquery dependecies to less than 2.2.0

Evaluate un-observed partial rendering functions

can.__notObserve needs a funtion as an argument

Fix up tests to run across all platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants