Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

can.Component Helper Functions

$
0
0
If have a block in my mustache template like this and instead of printing the content within, it is displaying the return value of "true" when it is truthy of the "isActive" helper function on the can.Component
  1. <li>
    {{#isActive}}
    Hello
    {{else}}
    World
    {{/isActive}}
    </li>
When using Steal, do I need to steal additional files to get the functionality?

This can.Component is declared within the init of my main Controller
  1. can.Component.extend({
        tag: 'shares-settings',
        template: settingsTmpl,
        scope: {},
        helpers: {
            isActive: function(options) {
                return true;
            }
        },
        events: {
            "inserted": function() { }   // FIRED TWICE
        }
    });

Viewing all articles
Browse latest Browse all 3491

Trending Articles