Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:39
    leoj3n commented #5107
  • 16:37
    leoj3n commented #5107
  • 16:32
    ThomasBrickerBK starred canjs/canjs
  • Jan 18 01:06
    greenkeeper[bot] commented #5422
  • Jan 18 01:06

    greenkeeper[bot] on @feathersjs

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

  • Jan 18 00:48

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 18 00:46

    greenkeeper[bot] on @octokit

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

  • Jan 17 18:14
    patosullivan starred canjs/canjs
  • Jan 17 17:42
    bmomberger-bitovi synchronize #5451
  • Jan 17 17:42

    bmomberger-bitovi on update-deps

    update can-view-live, can-dom-m… (compare)

  • Jan 16 00:11
    greenkeeper[bot] labeled #5458
  • Jan 16 00:11
    greenkeeper[bot] opened #5458
  • Jan 16 00:11

    greenkeeper[bot] on can-simple-dom-1.7.1

    fix(package): update can-simple… (compare)

  • Jan 14 01:51
    likun7981 starred canjs/canjs
  • Jan 13 14:06
    piraz starred canjs/canjs
  • Jan 11 00:56
    KonTrax starred canjs/canjs
  • Jan 10 02:37
    jlburke starred canjs/canjs
  • Jan 09 04:17
  • Jan 09 04:17
    bbbbbroot starred canjs/canjs
  • Jan 06 18:58
    greenkeeper[bot] commented #5442
Gregg Roemhildt
@roemhildtg
Here's the updated: http://jsbin.com/vifapemobo/1/edit?html,js,console,output
Basically, when the value of rows changes in the child, I want to update another property on the parent viewModel. The reason I don't think a getter on the other property would work is because parameters is not an entirely 'virtual' property, parameters could be passed into the parent component.
dylanrtt
@dylanrtt

You could still allow it to be passed in since it is available as the 1st argument to the get() function.

parameters: {
  get(lastSetValue) {
    if (lastSetValue) {
      return lastSetValue;
    }
    return this.attr('myRows');
  }
}

You could do some kind of merge in there as well

Gregg Roemhildt
@roemhildtg
That's essentially what I'm trying to do with the {viewModel.myRows add} function but the event doesn't seem to fire. http://jsbin.com/wuwajugeru/1/edit?html,js,console,output
dylanrtt
@dylanrtt
oh, my bad. it should be '{viewModel.myRows} add'. the {} part is the subject and after that is the event name
Gregg Roemhildt
@roemhildtg
I think I'm close, http://jsbin.com/nufijipela/1/edit?js,console,output Although I'm not necessarily interested in rendering the JSON data, it should update in the template which isn't happening..I think I've got something wrong...
dylanrtt
@dylanrtt
It might be a bug with #each for objects, but it doesn't update in the template even though it is actually updated
You should also make your default value for "parameters" a function that returns an object unless you want all instances of <my-component> to have the same value for it
Gregg Roemhildt
@roemhildtg
@dylanrtt okay, I think it might be. And yes, value is now a function. Question, when you create an event listener like '{viewModel.myRows} change', can you also do that on a property that is type: 'number'? Or should it be type:'compute'?
dylanrtt
@dylanrtt
@roemhildtg The subject of the event should be a map/list or compute. If you want to listen to changes to a field, then use '{map} field' where the event name is the field name.
Gregg Roemhildt
@roemhildtg
Awesome. Thanks!
Thomas Sieverding
@Bajix
Does StealJs just do a SystemJS trace for stache files, build, cache, reset config, and rebuild?
Viktor Busko
@Lighttree

Hi guys,
I'm doing some research for new project and would like to know some opinions. Basically we are using CanJS in scope of our Java application already. But this is still Java app with some CanJS insertions on couple of pages.
We are starting new stream (project) and I would like to go with full client-side app (with Java as web-services), but in some reason I can't just use DoneJS (it is awesome actually and do all the things that I need :D), mostly because there is couple of reasons from customer side (it will be hardly possible to have NodeJS on production) and tech-stack that already used on the project.
It seems that I have to create my own bicycle for build/deploy etc.
For now I see 2 ways:
1) go with NPM scripts (uglify-js, eslint, node-sass, etc) and build everything into one bundle. (this way seems easiest and straightforward to develop/maintain and since the app itself not so large, I think I don't really need progressive-loading)
2) go with WebPack :| (hard and painful, but functionality close to steal, seems like more future-proof)

Maybe someone has any suggestions or experience with such approaches :)

Mohamed Cherif Bouchelaghem
@cherifGsoul
Hi @Lighttree I use this approach with PHP for non-single page applications where I use canjs in some parts like poll system or likes/deslikes widgets with comments etc
Viktor Busko
@Lighttree
@cherifGsoul Hi, well actually this is how we work with CanJS also. But I'm trying to push CanJS (DoneJS if it will be possible) as main framework for single-page applications. And go from JSP pages to small single page apps. So I have to establish some process to build and deploy client-side apps, because currently we do it by some Java (maven etc.) and our custom tools.
Chris
@chrischrischris
Hi, I'm trying out canjs for the first time and really enjoying it, however I've got a simple problem that I can't find an answer to: I have a Component that uses a .stache template loaded using can.view. The data for the component is loaded in the viewModel using articles: Article.findAll(). In my template I'm using {{#each articles}} but I get a "TypeError: Cannot use 'in' operator to search for 'xxx' in pending" which is happening as it's trying to render before the data is loaded. Any simple pointers for me?
Also interestingly if I don't use a property within the {{each}} loop, it loops 9 times before any data is even loaded
Chris
@chrischrischris
And of course, once I ask for help online, I figure it out myself =). I've got it going thanks to the can.List.promise docs
Mohamed Cherif Bouchelaghem
@cherifGsoul
@chrischrischris nice
Chris
@chrischrischris
New question: I have a Model that pulls data from a rest api using findall, and also have a define property defined in the model instance that is a computed property from the rest data. I want to pass this define property to sub-component, but the value is never passed (using {subComponentProp}="definedProperty". I can see the correct value in the parent component - and in the console the property is visible via attr('definedProperty'), but not via .definedProperty. Any ideas how I can pass this value to the subcomponent?
Thomas Sieverding
@Bajix
Markup?
Chris
@chrischrischris
@Bajix - is that in response to my question? I don't follow what you mean by Markup?
Thomas Sieverding
@Bajix
Oh so you need to use .attr to read computed values
Chris
@chrischrischris
yes and that works, but I can't figure out how to pass that value in the stache template
Thomas Sieverding
@Bajix
{title}=“page.title"
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