Skip to content

Custom attributes onChange handler interpolation issue #25

@ShamariFeaster

Description

@ShamariFeaster

Templar.attribute('showIf',{ onChange : function(self, val){ let arrHasItems = (Array.isArray(val) && val.length > 0); debugger; if(arrHasItems || val === true || val == 'true' || parseInt(val) > 0){ self.style.display = ''; }else{ self.style.display = 'none'; } } });

if attribute is [], val is NOT array, rather it is the token (ie, {{model.someAttribute}} )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions