Migrate Instructions

This guide will help you migrate from 1.x to 2.x. If you are first time using nya-bootstrap-select , just ignore this section.

Data Structure

The collection which are used to populate options and the model which are used to work with selection results don't changed.

Both array and object collection are supported by the new directive nya-bs-option. See the document to learn usage.

model of multiple selection is array and model of single selection is object or string as.

Rewrite Template

The most changes are the template. <select> is totally deprecated. you need to use new directive nya-bs-select to build your select. If you are using static options you should use nya-bs-option class and value attribute to identify your option. otherwise. the nya-bs-option directive must be used to populate options.

In the 1.x version:

<select class="nya-selectpicker" ng-model="model" ng-options="option in options">
  ...
</select>

In the 2.x version:

<ol class="nya-bs-select" ng-model="model">
  <li nya-bs-option="option in options">
    <a>
      {{ option }}
      <span class="glyphicon glyphicon-ok check-mark"></span>
    </a>
  </li>
</ol>

Note that the element of nya-bs-select directive can be any block level element. To make your html semantically. we suggest use some list container tag, like ul or ol.

Anyway you can use <nya-bs-select> or <div nya-bs-option> and other form as well.

The nya-bs-option is a different case. Which its element should aways be <li> element, in order to utilize the bootstrap class. So is its children <a>, it's also a required direct child of nya-bs-option.

For group and other usage changes, see the examples.

Features of Bootstrap-select

If you have used some features of Bootstrap-select in the 1.x version. Those features may not be supported or have a different implementation at current version.

Features Not supported

Features with different implementing.