Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Tagging: handling invalid and/or multiple entries by the tagging function #485

Closed
@darrudi

Description

@darrudi

Feature Request regarding free tagging:
The user may enter a string which is considered invalid by the tagging function. So the tagging function should be able to return null upon receiving the input. I did this but a bunch of errors surfaced. My tagging function (an email client):

    $scope.uiSelectNewTag = function(email){
        email = email.trim();

        if (email.match(/^[a-z][a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/i)) {
            var newItem = {
                type: 2,
                email: email,
                key: email
            };
            return newItem;

        } else {
            return null;
        }
    };

Also the user may copy-paste a string (e.g. a list of emails separated by semicolons) into the ui-select and the tagging function may decide there are more than one item in the input. So I guess its a good idea to have the tagging function return an array (zero or more items) instead of a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions