@justinbmeyer justinbmeyer released this Oct 4, 2018 · 146 commits to master since this release

Assets 2

can-define

For example:

prop: {
  default: 21,
  value( {lastSet, resolve} ){
    resolve( lastSet.value );
  }
}

PR: canjs/can-define#398

can-simple-observable

can-stache

This was added to support simple setters directly within stache:

<div on:click="this.todo.name = something"></div>

can-stache-bindings

Example:

      <p>Priority: {{this.priority}}</p>
      <button on:click="this.priority = 0">Urgent</button>
      <button on:click="this.priority = 1">Critical</button>
      <button on:click="this.priority = 10">Fahgettaboudit</button>

The key that is being set can be any key accessible by the scope. For example:

  • Set values on the viewModel - on:click="this.priority = 0".
  • Set values on a variable in the scope - on:click="todo.priority = 0".
  • Set values on a scope value - on:click="scope.element.value = 0"

The value that is being set must be represented by an expression that evaluates to a value. For example:

  • primitives - on:click="this.priority = 0"
  • variables - on:click="this.priority = todo.priority"
  • functions - on:click="this.priority = this.getPriority(todo)"

PR: canjs/can-stache-bindings#492

can-view-live