These are chat archives for canjs/canjs

10th
Oct 2016
swipie
@swipie
Oct 10 2016 08:42

I get this warning: WARN: can/view/stache/mustache_core.js: Unable to find key or helper "user.username".
This is inside my index.stache

<user-model get="{}">
                {{#if isPending}}
                    Loading..
                {{/if}}
                {{#if isResolved}}
                    {{#if value}}
                        {{log value}}
                        <can-import from="passwd/username/" />
                        <passwd-username user="{value}" />
                    {{/if}}
                {{/if}}

Inside passwd-username component I have this input field

<input class="form__row__inputfield" readonly type="text" name="Username" value="{{user.username}}">

Any idea why I have this warning?

Frank Lemanschik
@frank-dspeed
Oct 10 2016 16:00
maybe check the value if it exists?
out of my point of view your passing in value of user-model get into the passwd-username user
so when user.username not exists it probally not exists :D
thats what i get always when i set var names wrong :)
Gregg Roemhildt
@roemhildtg
Oct 10 2016 18:41
@swipie I think your passwd-username has the wrong syntax for passing an object. Try <passwd-username {user}="value" />
Marc Godard
@MarcGodard
Oct 10 2016 22:14
Hey guys, I am doing caching like the example in the canJS docs (model caching) and am wondering the easiest way to reset it? When you logout of my site and log back into it with a different user, it's still showing the old cached stuff. Any quick ideas on a quick fix?
Diana Whitten
@hurgleburgler
Oct 10 2016 22:15
@MarcGodard are you using can-connect?
Marc Godard
@MarcGodard
Oct 10 2016 22:17
No, I have a custom API backend and couldn't use it.
@hurgleburgler my backend requires special headers and signing features that would have required a custom copy of can-connect.
Diana Whitten
@hurgleburgler
Oct 10 2016 22:19
@MarcGodard gotcha ... not sure then
Marc Godard
@MarcGodard
Oct 10 2016 22:20
@hurgleburgler maybe I should fork can-connect and do that work? Do you think it would be worth it for the caching?
Diana Whitten
@hurgleburgler
Oct 10 2016 22:21
I've been using it lately , its nice. But its totally dependent on how easy it would be for you to update it ... it took me a while to update my old models to it
Marc Godard
@MarcGodard
Oct 10 2016 22:21
I mean would that fix the caching issues?
Diana Whitten
@hurgleburgler
Oct 10 2016 22:21
but, once it was updated, I'm able to clear the cache via
{connection object}.cacheConnection.clear()
but, I'm not sure if that's the cleanest way to clean it either, works for me though
Marc Godard
@MarcGodard
Oct 10 2016 22:23
Ok thanks. I will look deeper into can-connect and see. Might be worth it considering it's other features.
Diana Whitten
@hurgleburgler
Oct 10 2016 22:24
I've been using the supermap too, its helpful, since t here are a LOT of features in connect
Marc Godard
@MarcGodard
Oct 10 2016 22:26
Cool. Will do a deep dive :g
:)
Frank Lemanschik
@frank-dspeed
Oct 10 2016 23:26
i have a little question befor my head explodes
could it be that for example i can create a donejs app called app edit app.js and put my whole code in that for all other components?
or does realy every donejs component its own scope via ViewModels
so i my components have no viewmodel what the javascript scope does it have or should it have access to all scripts importet in the main app?
i am examining the possebilitys to convert existing code to donejs but it don't works as expected
and all the demo apps are using simply a own view model and canJS so no external stuff i would like to see a Tutorial how to create a DoneJS app out of something like https://fullcalendar.io/