-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unbinding a model does not completely make the template's contents disappear #11983
Comments
it sure sounds like a bug. will need to double check against the JS version, as well as our bleeding_edge version (which contains many fixes since last pkg release) |
Apologies, I should have included this info: Dart Editor version 0.6.5_r25017 mdv: polymer: |
FWIW I still see the bug. I updated to Dart Editor version 0.6.9_r25388 polymer: mdv: |
yeah, I don't think any significant changes were picked up yet... that build is from Friday, all my catch-up CL's including the one that changes setting model, landed this week. let me try against bleeding edge. |
I was able to reproduce it in JavaScript. Moving issue over to MDV tracker: Added MovedToGithub label. |
Thanks for taking a look! |
This behavior now works in polymer.js. I opened https://code.google.com/p/dart/issues/detail?id=12687 to track the port to polymer.dart |
Consider this code:
<!DOCTYPE html>
<html>
<head>
<title>index</title>
</head>
<body>
<p>
The below will appear and disappear as a model object is
bound and unbound from the template. Conditionals are implemented
simply as "this template appears if something is bound" and
"this template disappears if nothing is bound".
</p>
<template id="tmpl" bind>
<p>Hello {{msg}}</p>
</template>
<script type="application/dart" src="index.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>
import 'dart:html';
import 'package:mdv/mdv.dart' as mdv;
import 'dart:async';
class Message {
String msg;
}
main() {
mdv.initialize();
var message = new Message()..msg = 'world';
var template = query('#tmpl');
new Timer.periodic(const Duration(seconds: 1), (_) {
if (template.model != null) {
template.model = null;
} else {
template.model = message;
}
});
}
My understanding is that, if no model is bound to the template, the contents of the template disappear from the DOM.
However, I only see 'world' appear and disappear. For the first second, I don't see 'Hello'. After one second, I see 'Hello, World', then 'Hello' then 'Hello World' etc
Bug?
The text was updated successfully, but these errors were encountered: