1

I am using angular-ui collapse to hide and show 2 columns so when user click on glyphicon it will hide/show columns, Now when two columns are hidden at that time i want 10 columns to be 12 columns. is it possible to achieve this task ?

main.html

<span class="glyphicon glyphicon-th-list" class="btn btn-default" ng-click="isCollapsed = !isCollapsed" id="treelist"></span>
<div class="row">
  <div class="col-md-2" uib-collapse="isCollapsed">
      <p>test</p>
      <p>test</p>
  </div>
  <div class="col-md-10">
    contains some data here ...
  </div>
</div>

2 Answers 2

2

You should be able to use ng-class to switch between classes.

<div ng-class="{'col-md-12':isCollapsed,'col-md-10':!isCollapsed}">
    contains some data here ...
</div>
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect Boss that's what i was looking.Thanks
0

I am using this way in Angular

<div [ngClass]="{'col-md-12':!advancedSearch,'col-md-10':advancedSearch}"></div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.