cherifGsoul on upgrade-docs-html-canjs
cherifGsoul on master
Upgrade the site theme for new … (compare)
cherifGsoul on upgrade-docs-html-canjs
Upgrade the site theme for new … (compare)
https://canjs.com/docs/can.view.bindings.twoWay.html
Someone know why can throw warning on this page ? (in console)WARN: can/view/stache/mustache_core.js: Unable to find key or helper "plateName".
Because I have same warnings in my code and can't find the reason. There is also another case when I have different Issue with WARN: can/view/scanner.js: No custom element found for my-parent-component-tag
Maybe some updates in Can ?
can.jquery.js
plateName
in your viewModel
and the later check the component tag existance
{{plateName}}
, but there's no object with a plateName
property defined in the scope. This can be ok. It's just a warning. In those cases, it's faster if you do something like {{./plateName}}
. Giving a hint on where to look speeds up the bindings.@justinbmeyer
"are you using Mustache on purpose?" I am not :)
All my components generated by DoneJS generator (and all the templates are .stache), so not sure what can cause mustache processing.
What I'm trying to do is repeat behaviour from the end of this video: https://www.youtube.com/watch?v=mKOwwcKRBic (Share value between 2 components).
This is template for "parent" component that should import 2 others and child components should share data between each other.
<can-import from="trialsetup/components/user-edit-form/user-edit-form" />
<section class="container">
<header class="row">
<div class="col-md-12">
<h1>Lets get you set up with recognition</h1>
<p class="lead">Add your details below</p>
</div>
</header>
<main class="row">
<div class="col-md-7">
<gf-user-edit-form></gf-user-edit-form>
</div>
<div class="col-md-5">
Placeholder for the second component
</div>
</main>
</section>
So I'm going to use reference binding here like "*myReference"But as soon as I add input with 2-way binding to "user-edit-form" template:
<input type="text" name="name" {{$value}}="message">
It throws me WARN: can/view/scanner.js: No custom element found for gf-step-admin-setup
gf-step-admin-setup
- actually "parent" component (you can find its template above) so looks like it have to exist when I import another component. (unless there is some tricky life-cycle)
The fun thing that I can see my template with input for a second but after that something happens it disappear from the page :)
f I'll change binding to something like that:
<input type="text" name="name" {$value}="message">
It will work, but this is not what I need :(
{{$value}}
- I'll have the issue that I described above. But I was trying different things to fix it and understand whats wrong with my code. And this {$value}
just an example that it can find everything (components, references etc.), but something wrong with the case when I change it to {{$value}}
.
loadSlide(slides, index) {
var self = this, cs = slides[index],
next = (index + 1) % slides.length;
this.attr('currentSlide', cs);
setTimeout(function() {
self.loadSlide.call(self, slides, next);
},
cs.props.duration * 1000
);
},