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.

Proposal: adding static choices #152

Open
@dimirc

Description

@dimirc

There are cases where we might need to show some static info at the dropdown. We could add a new directive ui-select-static-choice and I was thinking of something like this:

  <ui-select ng-model="person.selected">
    <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
    <ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
        <div ng-bind-html="person.name | highlight: $select.search"></div>
    </ui-select-choices>

    <ui-select-static-choice ng-if="!$select.items.length">
        No results for <b>{{$select.search}}</b>
    </ui-select-choices-static>

    <ui-select-static-choice ng-if="$select.items.length<10">
        <button ng-click="fetchFromServer($select.search)">Search more results on server</button>
    </ui-select-choices-static>

  </ui-select>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions