These are chat archives for canjs/canjs

23rd
Jan 2019
apsignifi
@apsignifi
Jan 23 16:47

can4:

    translation: {
        get: function() {
            return new Translations();
        }
    }

in stache to create translation, I have

<textarea class="form-control" el:value:bind="translation().key" />

on page load, shows 'undefined' in textarea, - how do I modify code to show blank instead of undefined ?

Kevin Phillips
@phillipskevin
Jan 23 17:19
if you're using a getter, you don't have to call it like a function
try el:value:bind="translation.key"
apsignifi
@apsignifi
Jan 23 17:36

thanks.
I tried

<textarea class="form-control" el:value:bind="translation.key"/>

I get this warning:
unable to find key "translation.key"

Kevin Phillips
@phillipskevin
Jan 23 17:51
you can put a {{ scope.log() }} above that <textarea>
and it should print out the scope so you can see what is available
apsignifi
@apsignifi
Jan 23 19:02
ok, thanks.