Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Aggelos Karalias
@mehiel
I removed the compute wrapping for now in mustache_core.js:391 to make it work.. but this is a brute force workaround that probably breaks lots of other things..
I'll try to dig deeper in that and see if there's a way to make it work as expected with can-value's in there..
Matthew Phillips
@matthewp
can-value is defined in can/view/bindings
i doubt that's related to the bug though
Alex
@whitecolor
Is it posible to have some part of the template rendered without bindings (so it will speed up the whole thing), where data is actually static. Maybe it is possilbe to declare some attributes as "not bindable" as they are not supposed to change?
Marshall Thompson
@marshallswain
@whitecolor You can try this helper to opt out of live binding for a property: https://gist.github.com/marshallswain/7e07a23971ab70f78a11
Alex
@whitecolor
@marshallswain itresting, I think a like ability should be included in can out of the box.
opolyo01
@opolyo01
I don't see any examples where can.component would be instantiated inside of another can.component. Is it even possible or I have to declare it inside of the template? If it were can.Control inside of can.Component then I would simply instantiate new MyControl("#selectorId", {})
Alexis Abril
@alexisabril
@opolyo01 Yep, you’d want to use it inside a template. In one component’s template it’s common to use other components.
espretto
@espretto
somebody knows how to tell when canjs has rendered everything? i'd like to embed my app in a server-side phantom instance to serve indexable content. i chose amd over stealjs.
David Luecke
@daffl
CanJS renders synchronously so you just need to keep track of all the asynchronous loading you are doing.
2.3.0-pre also supports server side rendering now using https://github.com/canjs/can-ssr
@espretto
dylanrtt
@dylanrtt
can.param converts nested objects to bracket syntax like country[name] but my backend expects them to be like country.name in the query string. Is there an easy way to do that so it applies to all requests? should I just overwrite it?
Chris Gomez
@akagomez
@dylanrtt Maybe you can extend can.route.param: https://github.com/bitovi/canjs/blob/master/route/route.js#L203
It’ll create the bracket based nested objects, and you can replace them using a regex afterwards.
dylanrtt
@dylanrtt
well I'm using the util which I guess is jquery, not the route version, but that should work. thanks!
James Atherton
@James0x57
This message was deleted
Juan Orozco
@Macrofig
It seems like Stache doesn't like block level html inside SPAN tags. http://jsbin.com/gurezu/1/edit?html,js,output
Has anyone else seen this?
Curtis Cummings
@ccummings
I’ve seen it. We fixed it specifically for <a> tags in 2.2
Issue: bitovi/canjs#1134
PR: https://github.com/bitovi/canjs/pull/1431/files
The fix was to make the parser treat <a> like a block element, not sure we want to do the same for a span though
Juan Orozco
@Macrofig
Hrm... that's not cool...
I mean, that Stache cares so much about HTML structure. Then again, I know zero about it so...
Curtis Cummings
@ccummings
Stache implements an HTML5 parser to create a DocumentFragment, which is way different than parsing a string to create HTML (like Mustache and EJS)
Patrick Clancy
@patrickclancy
Does Stache support an inline svg? I’m not sure I’m doing this correctly so feel free to point out my errors.
http://jsbin.com/jafali/edit?html,css,output
<svg class="shape-icon">
    <use xlink:href="#shape-icon_back" />
  </svg>
Justin Meyer
@justinbmeyer
@patrickclancy Stache does support SVG
but I'm not sure about all use-cases
avg6003
@avg6003
Patrick Clancy
@patrickclancy

Is it possible to pass (via an attribute) in a deferred object to a component? I can pass a plain object, so my assumption was this would work. But it doesn’t…

<test-component2 my-dfd="{dfd}"></test-component2>

http://jsbin.com/fukocu/edit?html,js,output

dylanrtt
@dylanrtt
@patrickclancy wrapping the deferred in a promise (e.g., Promise.resolve(defObj)) works but you won't be able to resolve it from the child component if that's your use case
Patrick Clancy
@patrickclancy
@dylanrtt interesting… wrapping it in another then’able’ object works. Still feels strange. But that is a solution.
thank you
Justin Meyer
@justinbmeyer
https://github.com/bitovi/canjs/issues/1781#issuecomment-121981031 Thoughts on how to make validations work across components.
Justin Meyer
@justinbmeyer
@DipeshRaichana let me know if you want to talk through those questions.
Justin Meyer
@justinbmeyer
Here's some docs on how you can migrate away from can.Model to can-connect: http://connect.canjs.com/doc/can-connect%7Ccan%7Cmodel.html
Patrick Clancy
@patrickclancy
@dylanrtt Turns out a promise won’t work for me. I’ll see if I can find why passing a deferred fails.
Justin Meyer
@justinbmeyer
@patrickclancy @dylanrtt if passing a promise or deferred doesn't work, can you create an issue?
it certainly seems like a bug
oh, I know what the problem is
this isn't a bug
but an API thing we should fix for 3.0
the problem is that the template isn't rendered until all promises were resolved
this is a hold-over from early JMVC days
before live-binding
Justin Meyer
@justinbmeyer
it works if you do it this way:
avg6003
@avg6003

@justinbmeyer Actually I am using a css class on which I am changing my template using route. Now on the same page when I am switching the template the previuos controller is effecting on my latest temaplte which I have loaded and it is also affected by its own controller too as I have added other controller on the same class. Here is my code.

`define(['can', 'jquery', 'models/DomainModel', 'controllers/FormHeader'], function(can, $, DomainModel, FormHeader) {
'use strict';
var DomainController = can.Control.extend({
defaults: {
view: 'views/domainSearch.hbs'
}
},{
init: function(element, options) {
new FormHeader('#header');
},
'input keyup': function() { ... }
});
return DomainController;
});

I have other login controller but I am calling bothe of them on new LoginController('.main-container');' andnew DomainController('.main-container')`

So when I start to type in login.hbs template the input keyup event automatically getting fired