Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:27
    greenkeeper[bot] labeled #5392
  • 18:27
    greenkeeper[bot] opened #5392
  • 18:27

    greenkeeper[bot] on core-js-3.3.3

    chore(package): update core-js … (compare)

  • Oct 18 22:20
    greenkeeper[bot] labeled #5391
  • Oct 18 22:20
    greenkeeper[bot] opened #5391
  • Oct 18 22:20

    greenkeeper[bot] on can-observable-mixin-1.0.3

    fix(package): update can-observ… (compare)

  • Oct 18 19:08
    cherifGsoul labeled #5390
  • Oct 18 19:07
    cherifGsoul opened #5390
  • Oct 18 18:45
    greenkeeper[bot] labeled #5389
  • Oct 18 18:45
    greenkeeper[bot] opened #5389
  • Oct 18 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

    fix(package): update can-observ… (compare)

  • Oct 18 18:29

    matthewp on master

    Update dist for release (compare)

  • Oct 18 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • Oct 18 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • Oct 18 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • Oct 18 17:59
    matthewp closed #5388
  • Oct 18 16:46
    greenkeeper[bot] labeled #5388
  • Oct 18 16:46
    greenkeeper[bot] opened #5388
  • Oct 18 16:46

    greenkeeper[bot] on can-observable-array-1.0.2

    fix(package): update can-observ… (compare)

  • Oct 18 12:45
    greenkeeper[bot] labeled #5387
Nico R.
@nriesco
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?
alice61
@alice61
TabNav is not a constructor
Gira Minus
@gKreator
Are you importing it correctly?
alice61
@alice61
I'm using steal in another file since it's part of an older project
steal(
        "tabnav.js",
        function(TabNav) {
Gira Minus
@gKreator
can you get a screenshot of
console.log( TabNav );
alice61
@alice61
blob
Gira Minus
@gKreator
Show the actual console log output of the object
not the line it breaks on
and open the default >
Also try removing .extend
alice61
@alice61
I tried removing the extend and still running into an error
blob
Kevin Phillips
@phillipskevin
It’s just an issue with importing an ES6 module using steal(…) syntax
you’re getting the Module itself (with a default property) instead of the default export
if you do this.control = new TabNav.default('#control', {}); does it work?
alice61
@alice61
yeah, it does for dev mode
but once I run it in production mode, I get an error
Kevin Phillips
@phillipskevin
what version of Steal are you using?
alice61
@alice61
0.16.0
0.16.43 to be exact
Matthew Phillips
@matthewp
You need to get the .default i believe
oh, see that you tried that
There was a bug in the babel version in 0.16
so you have to do something like TabNav = TabNav.default || TabNav