Angular 2 : bottom border on click -


i have 3 tabs , want bottom border when clicking on tab. when click on tab bottom border should given tab.

i have tried below code.

.features_selection_menu .menu_div {    display: inline-block;    margin-left: -3px;    vertical-align: bottom;  }  .features_selection_menu .menu_div .menu_text_div {    display: table-cell;    vertical-align: bottom;    height: 50px;    border-bottom: 2px transparent solid;  }  .features_selection_menu .menu_div .menu_text_div span {    position: relative;    bottom: 8px;    font-size: 18px;  }  .features_selection_menu .menu_div .menu_text_div_border_bottom {    border-bottom: 2px #3a3f51 solid;  }  .features_selection_menu .menu_div .default_feature_text_color {    color: #98a6ad;  }    .features_selection_menu .menu_div:first-child {    margin-left: 0px !important;  }  .features_selection_menu .menu_div:nth-child(n) {    margin-left: 40px;  }
<div class="features_selection_menu" [ngswitch]="currentfeature">                <div class="menu_div">                  <div class="menu_text_div {{currentfeature=='website'  ? 'menu_text_div_border_bottom' : ''}}  " (click)="currentfeature='website'">                     <span class="cursor_pointer {{currentfeature=='website' ? 'selected_feature_text_color' : 'default_feature_text_color'}}  ">&nbsp;website&nbsp;</span>                  </div>                </div>                  <div class="menu_div">                  <div class="menu_text_div {{currentfeature=='app' ? 'menu_text_div_border_bottom' : ''}}  " (click)="currentfeature='app'">                     <span class="cursor_pointer {{currentfeature=='app' ? 'selected_feature_text_color' : 'default_feature_text_color'}}  ">&nbsp;app&nbsp;</span>                  </div>                </div>                                </div>

i don't output on click.

any great.

thank you.

yeah use ngclass instead of normal class attribute

<div [ngclass]="{'menu_text_div': true, 'menu_text_div_border_bottom': currentfeature=='app'}  " > 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -