简体   繁体   中英

How to show uI-select(angularjs) when, click on html element?

I want to show UI-select drop-down when, we click on html-element. Please see the demo DEMO . In Demo we are showing three elements, when we select any of elements it must show related ui-select(angularjs) . How I will do this...

<div class="wrapper col-md-12 col-sm-12">
    <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'week'}" ng-click="makeActive('week')">week</a>
    <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'month'}" ng-click="makeActive('month')">month</a>
    <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'year'}" ng-click="makeActive('year')">year</a>
</div>

Try this way, here is the hint for you. Demo

<div class="wrapper col-md-12 col-sm-12">
        <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'week'}" ng-click="makeActive('week')">week
        <select ng-show="selectedType == 'week'">
          <option>week 1</option>
          <option>week 2</option>
          <option>week 3</option>
        </select>
        </a>
        <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'month'}" ng-click="makeActive('month')">month
        <select ng-show="selectedType == 'month'">
          <option>month 1</option>
          <option>month 2</option>
          <option>month 3</option>
        </select>
        </a>
        <a title="week? category"  class="tag" ng-class="{selected:selectedType == 'year'}" ng-click="makeActive('year')">year
        <select ng-show="selectedType == 'year'">
          <option>year 1</option>
          <option>year 2</option>
          <option>year 3</option>
        </select>
        </a>
      </div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM