Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:25
    matthewp edited #5384
  • 17:00

    matthewp on can-dom-mutate-2.0.7

    (compare)

  • 17:00

    matthewp on master

    fix(package): update can-dom-mu… Merge pull request #5386 from c… (compare)

  • 17:00
    matthewp closed #5386
  • 16:27
    greenkeeper[bot] labeled #5386
  • 16:27
    greenkeeper[bot] opened #5386
  • 16:27

    greenkeeper[bot] on can-dom-mutate-2.0.7

    fix(package): update can-dom-mu… (compare)

  • 16:25

    matthewp on can-dom-mutate-2.0.6

    (compare)

  • 16:24
    matthewp closed #5379
  • 16:24
    matthewp commented #5379
  • 15:26

    greenkeeper[bot] on can-type-1.1.2

    (compare)

  • 15:26

    matthewp on master

    fix(package): update can-type t… Merge pull request #5385 from c… (compare)

  • 15:26
    matthewp closed #5385
  • 14:11
    matthewp closed #5377
  • 14:11
    matthewp closed #5376
  • 14:11
    matthewp closed #5375
  • 14:07
    greenkeeper[bot] labeled #5385
  • 14:07
    greenkeeper[bot] opened #5385
  • 14:07

    greenkeeper[bot] on can-type-1.1.2

    fix(package): update can-type t… (compare)

  • Oct 16 20:07
    matthewp commented #5384
Chasen Le Hara
@chasenlehara
@gsmeets, if you could re-open that issue with any additional detail, that’d be great.
And just to be clear about what Frank was saying: the core team is starting to talk about how we can improve templating in CanJS, whether that’s a can-stache 4 release, or another project (similar to how we created can-define as an improved API over can-map and the define plugin).
We first started talking about it last week, and in the contributors meeting we said we would put out some info about what we want to improve. We’ll ask for proposals & feedback, then start making some decisions in March at the earliest.
There should be more info about all of this next week. 🙂
Frank Lemanschik
@frank-dspeed
/join
Jeroen Cornelissen
@jeroencornelissen
How do you guys handle routing in your stache files?
With a switch {{#switch page}} or with the routeCurrent helper {{#if routeCurrent(page='MyPage')}} ?
Julian
@pYr0x
i think you can do both
in all donejs apps it is currently with switch
Guido Smeets
@gsmeets
I'm using canjs mainly as an SPA with a multiple document interface, so I'm not using the default routing at all
Kevin Phillips
@phillipskevin
@jeroencornelissen I think {{#switch page}} is usually used in the main index.stache file where the context is your AppState
and routeCurrent can be used in sub-templates where you might not have direct access to all the properties of the route
but like @pYr0x said, you can do either/both
Jeroen Cornelissen
@jeroencornelissen
thx @phillipskevin @pYr0x
Gira Minus
@gKreator
blob
I am trying to use can-stache-converters, and it is not selecting the options
blob
I did import 'can-stache-converters', and it is in my package.json and node_modules
Kevin Phillips
@phillipskevin
what is task_template.project_type_id ?
Gira Minus
@gKreator
it is a number: 1
you can see in the test attribute in the html
Gira Minus
@gKreator
Can we do something like this:
blob
Nico R.
@nriesco

this should be an easy one...
I'm trying to do some sort of "variable-variable" thing.

This code works but seems like a workaround:

{{#each headers}}
  <td>
    <input class="disabled no-form" {($value)}="{{varName}}">
  </td>
{{/each}}

(varName is name, lastName, and so on..)

what I really want to do is something like this, but of course it won't work:

{{#each headers}}
  <td>
    {{{{varName}}}}
  </td>
{{/each}}

I guess there is a simple way of doing this, maybe a modifier or special keyword.
thanks

p.s. I don’t want to edit the contents, just to show the value, the input part is covered and working
Gira Minus
@gKreator
I tjink it is {{.}}
Nico R.
@nriesco
I mean header is an array that contains an object, this object has a property called varName and I need to print whatever is in there like {{name}} only that the value name is name, lastName, etc..
Gira Minus
@gKreator
{{Urobject.urname}}
Nico R.
@nriesco
@gKreator no that won’t work
Gira Minus
@gKreator
You want the key?
Sorry the way ur asking this is a bit confusing. Can you make a jsbin?
Jeroen Cornelissen
@jeroencornelissen

@nriesco I think you want something like:

{{#each headers}}
  {{#each .}}
    <p>{{%index}} -- {{%key}} -- {{.}}</p>
  {{/each}}  
{{/each}}

http://jsbin.com/robafivefe/1/edit?html,js,output

Gira Minus
@gKreator
That should cover all possibilities lol
Nico R.
@nriesco
@gKreator yes, my question is no so clear
@jeroencornelissen that will print the keys and the values but I would like to print the value of the varible wich name is that key or value
Gira Minus
@gKreator
Ohhh
You want to print from a second object?
Nico R.
@nriesco
this works: <input class="disabled no-form" disabled="disabled" {($value)}="{{varName}}”>
that way the value is set in a “variable” way
I just thought there might be a simple way of doing something like {{{{varName}}}}
some sort of modifier
Gira Minus
@gKreator
Use a helper function
Jeroen Cornelissen
@jeroencornelissen
You could use a helper function where you pass the %key to
Gregg Roemhildt
@roemhildtg

@nriesco you can do this:

        {{#each element as e}}
          <tr>
            {{#each headers}}
              <td>
                {{e[varName]}}
              </td>
            {{/each}}
          </tr>
        {{/each}}

http://jsbin.com/keyuniceqe/edit?html,js,output

This wasn't added till canjs 3 though so not sure if it'll work with your donejs app
Kevin Phillips
@phillipskevin
yep, Bracket expressions are the way to do this without a helper: http://canjs.com/doc/can-stache/expressions/bracket.html
Justin Meyer
@justinbmeyer
I'll be going through some thoughts on 3.0 later today: https://www.youtube.com/watch?v=eT78XxsvpQw
alice61
@alice61

Hi, I'm running into some trouble with my can control below. When I tried to initialize it, I get an error. However, in production mode it works. I'm using babel as my transpiler.

export default can.Control.extend({}, {
    init: function(element, options) {
        ....
    },
    '.tabNav-row a click': function(el, ev) {
        ...
    }
});
this.control = new TabNav('#control', {});

Please let me know what the issue with my controller could be

Kevin Phillips
@phillipskevin
what is the error?