These are chat archives for canjs/canjs

14th
Mar 2016
Viktor Busko
@Lighttree
Mar 14 2016 07:01

@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 :(

Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 08:46
@Lighttree can you ask the question in donejs chat room? https://gitter.im/donejs/donejs
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 08:58

It will work, but this is not what I need :(

@Lighttree what you mean by this?

Viktor Busko
@Lighttree
Mar 14 2016 13:21

@Lighttree what you mean by this?

It will render the component without issues but I need 2-way binding here. I'll try to go with CanJS only and check if it will work.

Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 13:22
this sentence: "it will work, but this is not what I need"
Viktor Busko
@Lighttree
Mar 14 2016 13:23
whats wrong with it ? :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 13:24
if it works, so it's fine it works or maybe I missunderstand :)
Viktor Busko
@Lighttree
Mar 14 2016 13:27
It doesn't work correctly. If I add {{$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}}.
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 13:28
@Lighttree can you make a jsbin that describe the problem?
Viktor Busko
@Lighttree
Mar 14 2016 13:28
Yeah thats what I'm going to do :D
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 14 2016 13:29
thank you