久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='5muYW'><tr id='5muYW'><dt id='5muYW'><q id='5muYW'><span id='5muYW'><b id='5muYW'><form id='5muYW'><ins id='5muYW'></ins><ul id='5muYW'></ul><sub id='5muYW'></sub></form><legend id='5muYW'></legend><bdo id='5muYW'><pre id='5muYW'><center id='5muYW'></center></pre></bdo></b><th id='5muYW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5muYW'><tfoot id='5muYW'></tfoot><dl id='5muYW'><fieldset id='5muYW'></fieldset></dl></div>
        <bdo id='5muYW'></bdo><ul id='5muYW'></ul>
      <tfoot id='5muYW'></tfoot>

    1. <small id='5muYW'></small><noframes id='5muYW'>

    2. <legend id='5muYW'><style id='5muYW'><dir id='5muYW'><q id='5muYW'></q></dir></style></legend>

        如何在角度2中動態(tài)更改css類名

        How to change the css class name dynamically in angular 2(如何在角度2中動態(tài)更改css類名)

        • <small id='DnY7D'></small><noframes id='DnY7D'>

              <tbody id='DnY7D'></tbody>
              <bdo id='DnY7D'></bdo><ul id='DnY7D'></ul>
              <legend id='DnY7D'><style id='DnY7D'><dir id='DnY7D'><q id='DnY7D'></q></dir></style></legend>

              1. <i id='DnY7D'><tr id='DnY7D'><dt id='DnY7D'><q id='DnY7D'><span id='DnY7D'><b id='DnY7D'><form id='DnY7D'><ins id='DnY7D'></ins><ul id='DnY7D'></ul><sub id='DnY7D'></sub></form><legend id='DnY7D'></legend><bdo id='DnY7D'><pre id='DnY7D'><center id='DnY7D'></center></pre></bdo></b><th id='DnY7D'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DnY7D'><tfoot id='DnY7D'></tfoot><dl id='DnY7D'><fieldset id='DnY7D'></fieldset></dl></div>

                • <tfoot id='DnY7D'></tfoot>
                  本文介紹了如何在角度2中動態(tài)更改css類名的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有兩個CSS類名如下

                  .icon_heart{顏色:#bdbdbd;}.icon_heart_red{顏色:#a6b7d4;;}

                  我的 HTML 有一個心形圖標

                  <div class="icon_heart" *ngIf="showheartIcon">

                  這里我有兩個 div 標簽,心形圖標最初是灰色,點擊后我會將其更改為藍色.

                  這是我的 ts 文件代碼:

                   showheartIcon=true;showheartIconRed =假;setWishlistTrue(id){this.showheartIconRed = true;this.showheartIcon = false;}setWishlistFalse(id){this.showheartIconRed = false;this.showheartIcon = true;}

                  我有兩個不同顏色的圖標.

                  問題

                  是否可以更改圖標的類別而不是兩個心形圖標?

                  我在 JavaScript 中看到我們可以更改它w3schools 簡單的方法將類應用于 div 標簽,但我是 TypeScript 的新手.如何更改班級?

                  解決方案

                  <div [ngClass]="showheartIconRead ? 'icon_heart_red' : 'icon_heart'">

                  I have two CSS class name as follows

                  .icon_heart{
                       color: #bdbdbd;
                  }
                  
                  .icon_heart_red{
                      color:#a6b7d4;;
                  }
                  

                  My HTML has a heart icon

                  <div class="icon_heart" *ngIf="showheartIcon">
                      <ion-icon name="heart" (click)="setWishlistTrue(category.product_id);" class="heart"></ion-icon>
                  </div>
                  <div class="icon_heart_red" *ngIf="showheartIconRed">
                      <ion-icon name="heart" (click)="setWishlistFalse(category.product_id);" class="heart"></ion-icon>
                  </div>
                  

                  Here I have two div tags, the heart icon is of gray color initially and on clicking that I will change it to blue color.

                  Here is my ts file code: showheartIcon=true; showheartIconRed =false; setWishlistTrue(id){ this.showheartIconRed = true; this.showheartIcon = false; } setWishlistFalse(id){ this.showheartIconRed = false; this.showheartIcon = true; } I have two icons of different color. Question Instead of having two heart icons is it possible to change the class of the icon? I have seen in JavaScript we can change it w3schools simple way to apply class to the div tag, but I am new to TypeScript. How can I change the class? 解決方案 <div [class.icon_heart]="!showheartIconRead" [class.icon_heart_red]="showheartIconRead"> or<div [ngClass]="showheartIconRead ? 'icon_heart_red' : 'icon_heart'"> 這篇關(guān)于如何在角度2中動態(tài)更改css類名的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)! 【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - Angular 2 amp;離子2)
                  How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加載離子頁面)
                  Retrieve localstorage value when value is change in Ionic 2(當 Ionic 2 中的值發(fā)生變化時檢索本地存儲值)

                  1. <tfoot id='QQGXq'></tfoot>
                        <tbody id='QQGXq'></tbody>

                      <small id='QQGXq'></small><noframes id='QQGXq'>

                        • <bdo id='QQGXq'></bdo><ul id='QQGXq'></ul>

                        • <legend id='QQGXq'><style id='QQGXq'><dir id='QQGXq'><q id='QQGXq'></q></dir></style></legend>
                          <i id='QQGXq'><tr id='QQGXq'><dt id='QQGXq'><q id='QQGXq'><span id='QQGXq'><b id='QQGXq'><form id='QQGXq'><ins id='QQGXq'></ins><ul id='QQGXq'></ul><sub id='QQGXq'></sub></form><legend id='QQGXq'></legend><bdo id='QQGXq'><pre id='QQGXq'><center id='QQGXq'></center></pre></bdo></b><th id='QQGXq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QQGXq'><tfoot id='QQGXq'></tfoot><dl id='QQGXq'><fieldset id='QQGXq'></fieldset></dl></div>

                            主站蜘蛛池模板: 一区二区三区四区免费视频 | 国产a久久麻豆入口 | 久久综合热 | 一区二区在线免费观看 | av片在线免费观看 | 黄色片视频网站 | 国产精品成人一区二区 | 成人免费毛片观看 | 欧美一级欧美三级 | 日韩在线免费 | 一区二区欧美日韩 | 久久久久久97 | 国产a久久麻豆入口 | 午夜美女福利 | 国产高清自拍视频 | 特黄aaaaaaaaa真人毛片 | 国产成人精品一区二区三区视频 | 久久av红桃一区二区小说 | 亚洲视频精品 | 狠狠艹狠狠干 | 极品淫少妇 | 在线观看黄网 | 完全免费av | a级成人毛片| 97在线播放 | 手机av在线免费观看 | 九九热这里只有 | 99视频在线| 国产伦精品一区二区 | 在线国产91 | 亚洲黄色精品 | 欧美在线视频播放 | 欧美日视频 | 熟女毛片 | 亚洲激情五月 | 欧美日韩国产一区二区 | 国产在线网站 | 一级黄片毛片 | 日本在线看片 | 国产日韩久久 | 成人免费在线播放 |