Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >

All Questions

Filter by
Sorted by
Tagged with
2 votes
2 answers
87 views

The below [ngClass] expression doesn't insert the class name into DOM when Angular starts hydrating (only after it's finished). <div class="document-pane" [ngClass]="{'single-view-...
Desperado's user avatar
  • 322
1 vote
1 answer
532 views

I have found some behaviour that I can't understand. If I've got a bunch of styles applied like this: .monkey-ion-item{ // Country Variant XXXX Not working after upgrade! &.monkey-variant-...
monkey's user avatar
  • 1,733
1 vote
2 answers
70 views

I'm using ng-class to add a disabled class to a CTA in certain scenarios, but there is a split second delay before it gets applied, which means if the user is quick enough they can click the CTA. See ...
CodBoy's user avatar
  • 21
1 vote
1 answer
105 views

I use Angular 18 and TailwindCSS. I wanted to create a cool typing animation with different colors per word. However, when currentColor updates to the next tailwind color, it does not show the proper ...
Daniel12's user avatar
1 vote
1 answer
112 views

Angular directive css class selector is not working when class added by ngClass directive. This is my code example and I will also add playground at link @Directive({ selector: '.test', standalone:...
Luca Q's user avatar
  • 11
0 votes
1 answer
112 views

I am encountering an issue with my Angular application where I'm dynamically changing the required attribute of a select field in a form after it has been submitted. evaluations.component.html <...
Adora González's user avatar
0 votes
3 answers
847 views

When I use the following code to switch the class everything works fine <p [ngClass]="idPresent ? 'alert alert-success' : 'alert alert-danger'"> Working </p> On changing the ...
Bagira's user avatar
  • 2,263
0 votes
3 answers
100 views

<mat-dialog-content class="mat-typography"> <div *ngFor="let form of addEmpForm; let i = index" class="example-container" [ngClass]="{ 'example-...
GettingStarted's user avatar
1 vote
0 answers
93 views

I am using angular material and in that using mat-table. Now I want to change background color of cell based on value of variable. So if value is >50 then it should show yellow color OR show green ...
Sami In's user avatar
  • 326
1 vote
1 answer
124 views

Currently I have my codes working. However, my [ngClass] conditions are very bulky. Having it repeated in many components in the html makes it difficult to maintain if any change is needed and makes ...
Minim's user avatar
  • 13
0 votes
3 answers
968 views

I have the following table where the ESTADO field is a drop-down list that shows the possible statuses. I want the text of the td element of the ESTADO field to display a different color when entering ...
Root93's user avatar
  • 137
1 vote
1 answer
709 views

I'm currently stuck with an issue on the Ternary operator, so I have this code: [ngClass]="am.hasAssignmentRequiredData(bal) && am.isDirty(bal) ? '':'disable'" so what this does is ...
Azrael's user avatar
  • 21
1 vote
1 answer
485 views

I'm trying to style a mat-autocomplete element with ngClass and I can't get it to work! In my CSS I wrote: ::ng-deep .default .mat-autocomplete-panel { background-color: white !important; border:...
WIMA's user avatar
  • 63
0 votes
0 answers
59 views

Can't bind to 'ngClass' since it isn't a known property of 'input'. I have migrated the angular project from version 8 to 9 and facing this type of errors. src/app/components/header/header.component....
Mukhtar Hussain's user avatar
0 votes
1 answer
2k views

I have a generic table component and I want to make the row hoverable by binding class using ngClass to a ng-container. However I an error. The code: <ng-container *ngFor="let row of manager....
Franco's user avatar
  • 952
0 votes
1 answer
45 views

I want to make a filter. I have a title field and a count field. In the title field, I select the product, then I select the parameter for the filter in the checkbox. The count field should contain ...
Itra's user avatar
  • 306
0 votes
1 answer
42 views

I have the following codes for my [ngClass]. What I want is consultant-rating-selected-1 + iconLanguage where by the iconLanguage was pass from the component itself. Eg. consultant-rating-selected-1_A....
Chee Mun's user avatar
0 votes
4 answers
817 views

I want to create a pipe using enum values to show me text colors depending on the status. this is my enum class : export enum Status { Active = 'Active', None = 'None', Processing = 'Processing'...
Hamza Marwani's user avatar
0 votes
1 answer
370 views

I have a table that I fill with data . I am trying to color data for the first year column. I am trying to achieve: +--------+------------+------+------+ | YEAR | 2022 | 2021 | 2020 | +--------...
Lebrom James's user avatar
-1 votes
2 answers
59 views

I have an icon "fa-duotone fa-rotate-right", and I want when changing "loading = true", the class "fa-spin" is added, everything works ok, but when it becomes "false&...
Artur's user avatar
  • 35
0 votes
2 answers
107 views

In my table, I'm attempting to add a read more button to each row that has a paragraph. The button is displayed for each row, and when I click one, it operates concurrently for each row. Here is my ...
Fedy Belaid's user avatar
1 vote
0 answers
181 views

HTML enter code here <div>[ngClass] = "{'red-color' : colorChanged() === true, 'green-color': colorChanged() === false, 'black-color': colorChanged() === null }&...
Asha's user avatar
  • 11
2 votes
1 answer
64 views

I have an article-map component. In it, with the help of the ngFor directive, I display brief information about the articles. I call the "article-map" component in the "feed" ...
Artur Haiduk's user avatar
0 votes
0 answers
1k views

I'm looking for the best way to pass ngClass or ngStyle to a subcomponent but without apply to the main component. For example: I have a component "button" that I call in app.component.html &...
Mike5's user avatar
  • 91
0 votes
1 answer
974 views

How to control the icon direction when click outside (empty space)? -fa-angle-up when the user open the dropdown -fa-angle-down when the user close/default the dropdown here is stackblitz
cng's user avatar
  • 67
1 vote
2 answers
223 views

Is there a way to simplify this ngClass? edit ? - This one works fine value === - This is a child component. Each of the two parent components pass the value property down as an @Input. Child ...
user avatar
1 vote
3 answers
1k views

This is my code: TS: selRow: boolean = false; HTML: <tr *ngFor="let user of users" [ngClass]="selRow ? 'selRow' : ''"> <td class="checkbox-field"><...
manjiro sano's user avatar
0 votes
1 answer
739 views

good day developers...is possible to apply ngClass with the use of bootstrap class related to detection of screen sizes responsivnes. Lets say i would like to apply an specific class to my template ...
Enrique GF's user avatar
  • 1,295
0 votes
1 answer
103 views

this is my code in controller $scope.status = false; $scope.clickOn = function () { if ($scope.status == false) { this.status = true; } else { this.status=false; } }; here ...
Hiếu Lê Quang's user avatar
0 votes
1 answer
236 views

In Angular application I am using dropdown filters for user selection. I have add logic in ngClass <div [ngClass]="i > 2 && 'array-design'"> How can I move the ...
Tejas Mehta's user avatar
-1 votes
2 answers
649 views

Can we add two ng-class in one div? If so then how to write it. How can we write this together? Thank you in advance. <div [ngClass]={'white-background': policy number.length <=0} [ngClass]=&...
aria08's user avatar
  • 21
0 votes
1 answer
194 views

I have this chat in which I'm trying to apply styles to the "chat-container". The messages are displayed with Angular's *ngFor as follows: <p *ngFor="let m of messageArray" [...
user avatar
0 votes
1 answer
101 views

I've got some code in AngularJS here working half percent (I will explain) : <button ng-class="{'svgMinus-dark': isDarkTheme, 'svgMinus': !isDarkTheme}"></button> I also tried ...
user9417455's user avatar
0 votes
0 answers
553 views

I have a little problem with the mat table especially with the mat row. What i want to do: Add class "is-marked" if the row has an date. <mat-row [class.is-marked]="row.date &&...
Manuel K.'s user avatar
0 votes
1 answer
961 views

I have an array of colors, colors = ['red', 'green', 'blue', 'yellow', 'black'] Also, I have an array like this demo = ['de1', 'de2', 'de3', 'de4', 'de5', 'de6', 'de7', 'de8', 'de9', 'de10', 'de11', '...
arv's user avatar
  • 5
0 votes
0 answers
41 views

should get same result from parent component to child component in angular. ngclass giving not exact result in child component. Need correct format of it. [ngClass]="{ 'card-color'...
Manthan Ankolekar's user avatar
0 votes
1 answer
88 views

I would like to combine multiple ngClass if else statement together, I have tried but not able to resolve it. <div [ngClass]="[tabItem === 'unavailable' ? 'background-grey' : selected ? '...
user7046311's user avatar
-1 votes
1 answer
269 views

I have 8 icons and I have to change the color to black from white when we click on the icon(It has to be toggle). Note: At a time only one icon should be active (change the color). .component.ts <...
user93's user avatar
  • 39
-1 votes
1 answer
667 views

In my angular application I have 10 icons and my requirement is to change the color from white to red when we click on the one icon among the 10 icons. And if we click on another icon it will turned ...
user93's user avatar
  • 39
-1 votes
2 answers
234 views

How can achive it that the class name will be forexample "table1-RED" According to color property.It has color property.(I use not the base material table and this has color property of ...
GergelyKarl's user avatar
0 votes
1 answer
29 views

I made a reusable input in the form of a component, I used ngClass to set different backgrounds. and it works well in 4 out of 5 scenarios. There's a case where the evaluated variable named "...
Julio Rodriguez's user avatar
0 votes
2 answers
1k views

I have a button which is inside an ngFor loop. I am styling it like this. <div *ngFor="let component of componentList;let index =index"> <button type="button" id='...
santubangalore's user avatar
4 votes
2 answers
6k views

I'm trying to use TailwindCSS in function inside ngClass. TailwindCSS classes were generated in function to maintain my template but it doesn't work. Please check my code below *.component.html ... &...
Ren's user avatar
  • 109
0 votes
3 answers
764 views

Inside an ngFor I have a tabs component. To add a CSS class I use the property show which is a boolean false. If I click the component the show property toggles to true. If I click a second component ...
Ricardo Castañeda's user avatar
0 votes
3 answers
8k views

I have this floating button in my Angular Application, <button [ngClass]="{ 'mdc-fab--extended': extendedClass, 'mdc-fab--mini': miniClass }" class="mdc-fab mdc-fab--touch &...
julz oh's user avatar
  • 345
0 votes
3 answers
649 views

How do I combine multiple conditions in Angular? im using angular 12 at the moment. example: [ngClass]="condition1 ? 'className1': 'classname2'" this works if condition 1 is true or false. ...
SNT's user avatar
  • 313
0 votes
2 answers
782 views

I need to display dynamic color for a div based on some condition. I am getting console error. I have tried <div [ngClass]="{'clr-{{students.rollNo+1}}': students.active}"></div> ...
mevr's user avatar
  • 1,145
-1 votes
1 answer
1k views

Im wondering what is best practice when observables for authentication. I havesections of my code where different code needs to be rendered if the user is logged in og not. Currently im using "*...
Glacierdk's user avatar
-1 votes
1 answer
468 views

I have the JSON like below but I have a lot of data: items: [ { itemId: "22222", category: 'A', total: 100, price: 20 }, { itemId: "666666", category: 'A', total: 80, price:10 }, { ...
lona bin's user avatar

1
2 3 4 5
19