These are chat archives for canjs/canjs

14th
Sep 2017
Frank Lemanschik
@frank-dspeed
Sep 14 2017 09:26
hmmm i would omit the method stuff
<select name="method" id="method" style="width:200px;" value:bind="selected">
        {{#methods}}
            <option value="{{value}}">{{name}}</option>
        {{/methods}}
    </select>
it will at the end also allow then to use {{.}} for other actions
Kevin Phillips
@phillipskevin
Sep 14 2017 13:44
if you do that, it will walk up the scope if one of your methods doesn't have a value or name
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:44
but every methods needs a value and name
so they will all have this or i am wrong?
i assume strong to have the same structure under that methods property
else the each would produce empty filds also right?
Kevin Phillips
@phillipskevin
Sep 14 2017 13:47
options without value default to using the text content for the value
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:47
interristing
that could shorten my code a lot
:D
thanks learnd something
Kevin Phillips
@phillipskevin
Sep 14 2017 13:48
:thumbsup: you're welcome
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:48
your interrested into bindings right?
did you saw my stuff about http://jquerymy.com/ ?
Kevin Phillips
@phillipskevin
Sep 14 2017 13:50
no, I haven't
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:50
first look at the page this is nativ donejs compatible
:D
you can see it as new viewModel option
i tested it at present you have 2 ways to easy use it with donejs one way is use stache with html only or use it directly as done Component replacement
as its init method gets called as define-map would get and it can append html
:D
you can also use define-map to supply data i think but thats not battle tested
Kevin Phillips
@phillipskevin
Sep 14 2017 13:53
what do you like about it compared to just using DefineMap?
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:53
the syntax? and the nice stuff like delayed bindings and that
it will get the whole jquery community
and i like that it defines really everything in one object :)
template all like a done-component
you simply apply it to your custom tag like a done-component
simply look that click on code
compare to current donejs
your done ;)
it supports all the stuff like nesting and that
also it has no router and that stuff its good promotion stuff to advertise that can-route would be a good router for it?
Frank Lemanschik
@frank-dspeed
Sep 14 2017 13:59
i think that would even work all nice with the existing tool chain like using stache and all that :)
i will keep experimenting on that using it partial here and then
but at present it works really great i just put it into the js and apply it over a existing html tag in stache
i do it with a .component file
Justin Meyer
@justinbmeyer
Sep 14 2017 19:29
How CanJS is reducing the impact of its stateful code: https://www.bitovi.com/blog/coping-with-stateful-code
Nico R.
@nriesco
Sep 14 2017 21:16
@web-mech are you using progressive loading? I had issues with components within components specially with selects
Sometimes setting an option before the iteration helped
Nico R.
@nriesco
Sep 14 2017 21:35
in your example it would be something like this:
<select name="method" id="method" style="width:200px;" value:bind="selected">
  <option value="">Select an option</option>
  {{#each methods as method}}
    <option value="{{method.value}}">{{method.name}}</option>
  {{/each}}
</select>
I’m guessing that you are iterating over a resolved promise value
Frank Lemanschik
@frank-dspeed
Sep 14 2017 23:44
@justinbmeyer did i saw right you was using a plain object for the stream map?
and only kefir ?
no can-kefir loaded? over a can-define-map?
as i saw only can-all
i am wondering what did drive the values out of the streams in that widget live stream
i saw only a object and that had streams but they where decorated with can-stream-kefir i think because of the methods
Frank Lemanschik
@frank-dspeed
Sep 14 2017 23:49
does that mean kefir streams are now nativ supported like promises for stache templates without that stream: type on define-map?
that would be a great feature :) then i would rewrite some of my applications. i am also wondering why did you choose to add all that as individual variables why not placing that all on the object it self?