How to Change Only One Ion-item Color in Ion-list When Clicked?

To change only one Ion-item color in the ion-list when clicked, you can use the following methods: On Mac OS X. Click Tools > Preferences, and then select the Colors tab Put down the color by using Color Picker Bar.

color element in a list onclick angular

By godwin_kvggodwin_kvg on Jan 29, 2021
<ul class="horizontal" id="nav">
  <li 
    *ngFor="let state of states"
    (click)="setStateAsActive(state)">
    <a [class.active]="state === activeState">
      {{ state }}
    </a>
  </li>
</ul>

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  activeState = 'Draft';

  states = [
    'Draft',
    'Planned',
    'Started',
    'Suspended',
    'Ended',
  ]

  setStateAsActive(state) {
    this.activeState = state;
  }

}

Add Comment

0

To change only one ion-item color in ion-list, click the icon of settings.

Javascript answers related to "color element in a list onclick angular"

View All Javascript queries

Javascript queries related to "color element in a list onclick angular"

color element in a list onclick angular An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack: could not find module "@angular-devkit/build-angular" An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' radio button onclick jquery set onclick jquery how to call a function in react with arguments onclick how to change style class by using onclick function with multiple buttons in react js react why onclick property function trigger without click reactjs pass slug to parameter onclick onclick node js javascript onclick href location load url onclick javascript onclick href how to change the text in a button on onclick Div onclick function angular get element by classname angular get first element ngfor angular show element in component jquery select element inside element how to change list item text color in react delete element from list javascript change nav background color on scroll css without bootstrap platform check in react native for status bar color ionic status bar color flutter app bar action button color how ot make a background color faor evaluationbutton in flutter javascript background color how to change background color using js javascript set color in hex how to color console.log typescript convert color to rgb random color generator random color generator javascript Random color generator javascript RGB change the color of toast toastr js angular Failed to make request to https://www.gstatic.com/firebasejs/releases.json angular file upload app with django angular filter ngfor angular find value in json array angular firebase angular flex layout angular for loop angular form set value without fire event angular form validation whitespace angular formarray remove all angular format phone number while typing angular formData print values angular formgroup on value change angular generat model angular generate component angular generate component without spec angular generate guid Angular generate without spec angular generer guard angular get current route angular get current time angular get current timestamp angular get device information angular get firebase firestore angular get geolocation angular get name of component angular get response headers angular get router path angular get today angular go to route angular google maps angular google maps my location button angular guard redirect angular hash sign in url angular how to check previous route angular how to copy text with button angular how to get previous state angular how to run code every time you route angular how to use service in class angular http async false angular http call caching issue even after no-cache angular http error handling angular http get status code angular http request query params angular httpclient post body angular httpclient query params not working angular image upload angular img angular img src binding angular img tag angular implementing Validator angular import google maps angular import service angular in memory web api login curd exmpal angular property binding angular socket.io with token header Global Angular CLI version greater than local version how to revert angular cli version material icons angular angular setTimeout Your global Angular CLI version (11.0.2) is greater than your local version Your global Angular CLI version is greater than your local version angular interceptor error handling angular lazy loading angular interceptor angular js angular An accessor cannot be declared in an ambient context. angular date angular refresh page without reloading angular navigate using component angular reload component remove duplicate objects based on id from array angular 8 date format angular angular date pipe 24 hour format angular get route url represent array items angular import images angular hide and show in angular 8 router params angular ng class in angular input property angular angular number pipe angular date pipe How to Reload a Component in Angular how to update firebase document field angular slider plugin for angular workspace angular interceptor in angular 9 For loop angular javascript install toastr in angular Angular version command How to check angular version in project date pipe in angular angular sweet alert jquery scroll to element jquery see if element is visible jquery select a dynamic element jquery select element based on for attribute jquery select element with class jquery select element with data jquery select element with two classes create react element with string how to add multiple style attributes in react element how to get element from arraylist react pass element from child to parent react vue get height of element ref vue js get width of element get element by id html javascript get last element of array convert a string to html element in js remove element from array javascript create element javascript javascript style an element add an element to an array javascript find a single element in array of objects javascript puppeteer click element with custom property how to remove element from array in foreach javascript how to remove the last element of an array in javascript how to replace array element in javascript without mutation js array modify element get the last element of array javascript javascript remove the last element from array target element in jss kendo treeview get element dexie update table element how to get child element in javascript Return the first element of the array javascript max element in array last element in array how to remove all element from formarray how to get last element of an array how to find the last element in an array Mongodb Remove array element by index es6 get first and last element of array remove element from array how to find last element in array how to get the last element of an array Property 'value' does not exist on type 'EventTarget & Element'. how to get last element of array in typescript remove one element using splice how to change an element in a different elements code css REACT TS roperty 'value' does not exist on type 'EventTarget & Element' get id of element javascript hide element by id how to add react.memo in export list how to load a drop down list in reactjs using json data node list files in directory json decode list flutter list of javascript cheat sheet xcode list simulators When rendering a list what is a key and what is it's purpose? mat-icon list

Browse Other Code Languages

CodeProZone