Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Not able to set object value while using Angular #283

Open
nikhilsarvaiye opened this issue May 17, 2016 · 0 comments
Open

Not able to set object value while using Angular #283

nikhilsarvaiye opened this issue May 17, 2016 · 0 comments

Comments

@nikhilsarvaiye
Copy link

Hi,

I have seen below lines of code which was making value to string in every case,

// Normalize label and value
attrs.value = $.trim(attrs.value.toString());
attrs.label = attrs.label && attrs.label.length ? $.trim(attrs.label) : attrs.value

    // Bail out if has no value or label, or label is too short
    if (!attrs.value.length || !attrs.label.length || attrs.label.length <= this.options.minLength) return

which we can make it to

// Normalize label and value
attrs.value = typeof attrs.value === 'string' ? $.trim(attrs.value.toString()) : attrs.value;
attrs.label = attrs.label && attrs.label.length ? $.trim(attrs.label) : attrs.value

    // Bail out if has no value or label, or label is too short
    if(typeof attrs.value === 'string')
        if (!attrs.value.length || !attrs.label.length || attrs.label.length <= this.options.minLength) return

The problem will be in case of using Angular and Ng - Model as object
Please add support for it, currently we are abel to do the same in create token event

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant