These are chat archives for canjs/canjs

5th
Aug 2016
Leath Cooper
@IcculusC
Aug 05 2016 03:42
@Bajix is there documentation that demonstrates how to use the value/Type constructs you mentioned on the map
I think I saw some but now I can't find it
Thomas Sieverding
@Bajix
Aug 05 2016 03:43
For 3.0?
Leath Cooper
@IcculusC
Aug 05 2016 03:43
yeah
var ViewModel = DefineMap.extend({
  user: {
    value: Object,
    Type: User
  }    
});
Leath Cooper
@IcculusC
Aug 05 2016 03:45
ah hah
I quite like that
Thomas Sieverding
@Bajix
Aug 05 2016 03:46
Yea, value: Object/Array is the way to go
Leath Cooper
@IcculusC
Aug 05 2016 03:48
hmm, so for the User class would I use an extended map
Thomas Sieverding
@Bajix
Aug 05 2016 03:49
Yes
Leath Cooper
@IcculusC
Aug 05 2016 03:49
also, if I create an extended map can I extend it again as if it were a subclass
haven't ran into that use case yet but I think I am now
Leath Cooper
@IcculusC
Aug 05 2016 03:56
!!! it works ty @Bajix
Leath Cooper
@IcculusC
Aug 05 2016 04:25
although I still get that warning on load
Andrei Balmus
@abalmush
Aug 05 2016 09:05
Guys is it possible to update the value of the text area in viewModel on keypress? not on focus out?
sometest.gif
Andrei Balmus
@abalmush
Aug 05 2016 09:10
oh I think I know I have to use ($keypress)=“someMethod()"
Leath Cooper
@IcculusC
Aug 05 2016 17:35
I've been wondering the same thing
Leath Cooper
@IcculusC
Aug 05 2016 17:54
<button type="button" class="btn btn-warning btn-large btn-block" ($click)="signUp()">Sign Up</button>
let SignUpViewModel = DefineMap.extend({
    user: {
        value: Object,
        Type: User
    },
    signUp: function() {
        console.log(arguments);

        User.createData({ email: this.user.email, password: this.user.password });
    }
});

on click I get this error in console

can-stache-bindings.js:329 Uncaught TypeError: expr.hash is not a function

any ideas?

Mason Shin
@minsooshin
Aug 05 2016 17:56
define: {
  user: {
    value: Object,
    Type: User
  }
},
signUp() {
  …
}
wrapping with define maybe?
I am not sure, tho
even though, it is extended from DefineMap
nm
I didn’t look at the above messages
it doesn’t need define wrapper with can.define
the-learning-man
@the-learning-man
Aug 05 2016 18:06
where is the canjs3-pre repo?
Leath Cooper
@IcculusC
Aug 05 2016 18:39
@minsooshin ty yeah I don't know it seems to be an error in the can code, it's basically a clone of the simplest example in the docs for binding a dom event handler
@the-learning-man as far as I can tell can 3 is compartmentalized so there is no repo for can3 like there is for can 2.3
but you can install each package individually with npm
Christopher Oliphant
@RALifeCoach
Aug 05 2016 19:10
@Bajix I have my first page working - I used can.ajax after finally giving up on superMap. It works fine on my desktop for all breakpoints. However, when I run the same page on my phone, the saved data isn’t displaying. I have tried android chrome, android native browser and iPhone safari. Same results on them all.
the-learning-man
@the-learning-man
Aug 05 2016 21:20
@IcculusC thanks
Leath Cooper
@IcculusC
Aug 05 2016 22:18
@the-learning-man fo sho