Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 06 18:40
    cherifGsoul review_requested #5441
  • Dec 06 18:39
    cherifGsoul opened #5441
  • Dec 06 18:22

    cherifGsoul on update-infrastructure-page

    Update infrastructure page with… (compare)

  • Dec 06 18:14
    greenkeeper[bot] commented #5422
  • Dec 06 18:14

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 06 18:11
    greenkeeper[bot] commented #5401
  • Dec 06 18:11

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 04 22:03
    chasenlehara opened #5440
  • Dec 04 22:03
    chasenlehara labeled #5440
  • Dec 04 19:18
    cherifGsoul review_requested #5432
  • Dec 04 14:09
    m-ahmadi starred canjs/canjs
  • Dec 04 10:52
    ansyeow starred canjs/canjs
  • Dec 03 14:53
    matthewp commented #5439
  • Dec 03 14:30
    frank-dspeed opened #5439
  • Dec 02 18:13
    greenkeeper[bot] commented #5392
  • Dec 02 18:13

    greenkeeper[bot] on core-js-3.4.7

    chore(package): update core-js … (compare)

  • Dec 02 17:48
    greenkeeper[bot] commented #5392
  • Dec 02 17:48

    greenkeeper[bot] on core-js-3.4.6

    chore(package): update core-js … (compare)

  • Dec 02 15:38
    phillipskevin commented #5438
  • Dec 02 15:38
    phillipskevin closed #5438
Thomas Sieverding
@Bajix
That’ll set viewModel.title whenever page.title is changed
Oh you probably have a capitalization issue
The attribute name needs to be lowercase
{sub-component-prop}=“myModel.computedProperty"
kebab case -> camel case
kabab case = snake case w/ dashes instead of underscores
Chris
@chrischrischris
Code Exerpt:
{{#each articles}}
    <p>This works: {{previewImgURL}}</p>
    <!-- passing in previewImgURL doesn't work below -->
    <article-tile {imageURL}="previewImgURL" {articleTitle}="title" />
{{/each}}
Thomas Sieverding
@Bajix
That’s incorrect
{{#each articles}}
    <p>This works: {{previewImgURL}}</p>
    <!-- passing in previewImgURL doesn't work below -->
    <article-tile {image-url}="previewImgURL" {article-title}="title" />
{{/each}}
Chris
@chrischrischris
ok, i'll try - but articleTitle works (2nd param)
Thomas Sieverding
@Bajix
imageURL isn’t a good property name, as it can’t be converted sanely between different casing
You should do imageUrl instead so that your attribute would be {image-url}=“{post.imageUrl}"
Possibly, I hadn’t played around with type sensitivity w/ the new binding syntax
AFAIK attribute names shouldn’t contain capitalized letters
Chris
@chrischrischris
ok yep - thanks so much! I didn't see anything about casing / kebab casing in the docs anywhere
but that was the issue. Been banging my head on the keyboard for a while so I really appreciate the help
Thomas Sieverding
@Bajix
Yea, I believe it’s mentioned in there somewhere, but not sure where
All of their examples use kebab casing at the very least
Chris
@chrischrischris
yeah - i think the fact that articleTitle was working for me made it that much harder to suspect that
Thomas Sieverding
@Bajix
Yea, and it’s only the attribute name that’s type sensitive
Oh they probably do that because attribute names are case insensitive, so FooBar===foobar
Chris
@chrischrischris
ah ok, that makes sense
Viktor Busko
@Lighttree

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-tagMaybe some updates in Can ?

Mohamed Cherif Bouchelaghem
@cherifGsoul
@Lighttree you use can.jquery.dev.js
if so just use can.jquery.js
for the first check if you have plateName in your viewModeland the later check the component tag existance
Justin Meyer
@justinbmeyer
@Lighttree are you using Mustache on purpose?
you should use stache if you can
The reason you'll see those warnings are because:
  1. you have something like {{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.
2. At the time of running the template, there's no my-parent-component-tag component defined.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@justinbmeyer How we can know that mustacheis used here?
Justin Meyer
@justinbmeyer
can/view/scanner is not used by stache.
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok thank you
Viktor Busko
@Lighttree

@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
@Lighttree can you ask the question in donejs chat room? https://gitter.im/donejs/donejs
Mohamed Cherif Bouchelaghem
@cherifGsoul

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

@Lighttree what you mean by this?

Viktor Busko
@Lighttree

@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
this sentence: "it will work, but this is not what I need"
Viktor Busko
@Lighttree
whats wrong with it ? :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
if it works, so it's fine it works or maybe I missunderstand :)
Viktor Busko
@Lighttree
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
@Lighttree can you make a jsbin that describe the problem?
Viktor Busko
@Lighttree
Yeah thats what I'm going to do :D
Mohamed Cherif Bouchelaghem
@cherifGsoul
thank you
Viktor Busko
@Lighttree
@cherifGsoul besides I've fixed issue, that I mention yesterday... it was typo in bindings (facepalm) I didn't saw that in one case we use {{..}} and in another {(..)}, I've expected to see double curly braces everywhere, so my eye didn't notice {()} :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
@Lighttree ok, good :)
Dovid Bleier
@dbleier
I am recursively calling setTimeout and when I do, stache never renders. I think the reason is because can-wait overrides setTimeout with it's own version. And then waits for it to resolve before rendering, but since it is recursive, it never finishes. How to get around this?
  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
    );
  },
Thomas Sieverding
@Bajix
Why would that be part of your zone?