These are chat archives for canjs/canjs

8th
Feb 2019
qantourisc
@qantourisc
Feb 08 11:23
What function do I call from stache.addHelper(XXX,function( foo, options){ //from here } ) to render a stache.view ? stache.view()(options.scope) doesn't seem to do it. It us close, but it doesn't quite render it with the right/complete scope. It's "weird"
apsignifi
@apsignifi
Feb 08 13:20

Can4:
i have some code from can 3 which I am migrating to can4, in can 3 - this code generated a warning : {($checked)} is deprecated. And in can4, it does not work at all .

{{#if rolePromise.isResolved }}
    {{#each role.role_groups}}
        {{#each ../role.authorization}}
            {{#is ../role_group role_group}}
                <div class="form-group col-md-12">
                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox"  can-value="allow" can-true-value="t" can-false-value="f" />{{label}}
                    <span class="checkbox-span"></span></label>
                </div>
            {{/is}}
        {{/each}}
    {{/each}}
{{/if}}

I think understanding this line will help:

<input type="checkbox"  can-value="allow" can-true-value="t" can-false-value="f" />

I am clueless on where {($checked)} came from

apsignifi
@apsignifi
Feb 08 13:49
found the solution:
had to change checkbox code to :
<input type="checkbox"  checked:bind="allow" />
apsignifi
@apsignifi
Feb 08 14:25

question related to my message above.
can4 code:

checked:bind="either-or(allow, 't', 'f')"

throws a warning: Unable to find key "either-or()".
How do I fix this warning to get the checkbox code working properly

apsignifi
@apsignifi
Feb 08 15:03
fixed by importing can-stache-converters
Chasen Le Hara
@chasenlehara
Feb 08 17:07
Our community survey goes out today! We’re going to talk about it LIVE in just a few minutes: https://www.youtube.com/watch?v=UxBJtHm4Km0
qantourisc
@qantourisc
Feb 08 17:32
Now: trying to outsmart can's scope ...
(trying to reduce the amount of extra bind in a stache helper)