Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:24

    greenkeeper[bot] on @octokit

    (compare)

  • 04:23

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 28 17:46

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 28 17:44

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 28 16:41
    cherifGsoul edited #5465
  • Jan 28 16:40
    cherifGsoul labeled #5465
  • Jan 28 16:40
    cherifGsoul opened #5465
  • Jan 27 21:03
    justinbmeyer commented #5464
  • Jan 27 20:33
    bmomberger-bitovi opened #5464
  • Jan 27 19:13

    greenkeeper[bot] on @octokit

    (compare)

  • Jan 27 19:12

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Jan 27 14:09
    rjgotten edited #5463
  • Jan 27 13:57
    rjgotten edited #5463
  • Jan 27 13:48
    rjgotten edited #5463
  • Jan 27 13:45
    rjgotten edited #5463
  • Jan 27 12:20
    rjgotten edited #5463
  • Jan 27 09:42
    rjgotten edited #5463
  • Jan 27 09:04
    rjgotten opened #5463
  • Jan 26 16:06
    chamsou123 starred canjs/canjs
  • Jan 25 20:18

    greenkeeper[bot] on @octokit

    (compare)

Frank Lemanschik
@frank-dspeed
also solved :) problem was maybe that my new internel helper caused that via return stache(template)(this); inside a value function from inside a viewModel
it can get ignored its probally a antipattern
Runn Vermel
@runn-vermel
i have a new issue that just popped up: i have a select tag, and i'm running a #each loop inside of it. i'm calling a method on change, and i'm trying to pass the selected element's value. this code has historically worked with %element.value - although, for whatever reason, that's not working now. i tried updating it to scope.element.value, like the warning suggested, but i'm still not getting a value back.
<select class="form-control" {($value)}="trainsByPlatform[platform.name]" ($change)="upsertInitialRelease(platform.name, scope.element.value)"> <option></option> {{#each trains[platform.name] as train}} <option value="{{train.name}}">{{train.name}}</option> {{/each}} </select>
any ideas?
Runn Vermel
@runn-vermel
it seems as the scope.element portion is working, but the value isn't being set on the select when an option is chosen
Morgan Heimbeck
@Xitstrategies
change may trigger before value is set... try putting a timeout in the upsertInitialRelease function?
Runn Vermel
@runn-vermel
hmm, if i do that, i'll still be receiving the value as empty tough.
though*
maybe if i put the timeout in the call with an anonymous function.. let me check
oh, wait, that's a v2 link
argh
Morgan Heimbeck
@Xitstrategies
which version of can are you using?
Runn Vermel
@runn-vermel
3
oh, this isn't react, i can't do an anonymous function on the call.
oy.
Runn Vermel
@runn-vermel
that's not it, though - the selectedIndex doesn't change at all when i select a new option, so it's not a timing issue
Runn Vermel
@runn-vermel
where can i find docs about the ($change) method? i assume an event should be passed when this is called?
Nico R.
@nriesco
@runn-vermel try this:
include outside of the loop (#each) an option tag
{{#if mainModelPromise.isResolved}}
  <select class="form-control" value:bind="selected">
    <option value="">Select an option</option> <!— if I remove this line nothing works —>
    {{#each mainModelPromise.value}}
      <option value="someValue">{{someVar}}</option>
    {{/each}}
  </select>
{{/if}}
in my case it seems to be necessary because it is a two way binding
Frank Lemanschik
@frank-dspeed
@phillipskevin :/ do you know the current state of on:inserted ?
are there new callbacks for can4?
i remember something but find no entry points about that
Kevin Phillips
@phillipskevin
@runn-vermel that is just setting up a https://developer.mozilla.org/en-US/docs/Web/Events/change event
@frank-dspeed https://canjs.github.io/next/doc/migrate-4.html has a section on inserted/removed
there is a new connectedCallback, or you can add back in support for inserted
import "can-3-4-compat/dom-mutation-events";
Gregg Roemhildt
@roemhildtg
Hey guys, I often run into this error:
Potentially unhandled rejection [2] TypeError: Cannot define property _instanceDefinitions, object is not extensible
Finding the cause isn't hard, its usually I forgot to define a property, so I usually just set a console.log breakpoint on the line with the prop name..but I think having some sort of warning for newbies would be really helpful
Kevin Phillips
@phillipskevin
I agree - that warning is really unhelpful
can you open an issue in can-define?
we should be able to give the name of the prop and the name of the DefineMap
Gregg Roemhildt
@roemhildtg
Yep, will do.
Gregg Roemhildt
@roemhildtg
canjs/can-define#309
Gregg Roemhildt
@roemhildtg
Anyone ever created a "batch save" method in can-connect? Instead of model.save(oneItem) saving multiple items in one requestmodel.save([item1, item2, item3]);?
I gotta create about a thousand records in one go...and I think calling .save x1000 would not be pretty
feathersClient accepts an array of data though...so maybe a custom behavior with a special function like saveBatch would be the way to go.
sound about right?
Nico R.
@nriesco
@roemhildtg the Potentially unhandled rejecttion … object is not extensible error occurs when that variable is not defined in the viewmodel
usually happens when you are trying to get a property from the wrong place
Kevin Phillips
@phillipskevin
the problem he is pointing out is that _instanceDefinitions is not the name of the property that is being set
Nico R.
@nriesco
or you just forgot to define it, I think the difficutly is that it only occurs when trying to save or when you don’t load an inital content
Oh, I see
Gregg Roemhildt
@roemhildtg
Hey, calling a definMap.get should return all its properties, right? Even if serialize:false is set on a property?
Or does serialize: false affect .get() as well as .serialize()?
Kevin Phillips
@phillipskevin
get also just returns enumerable properties