Questions tagged [angular-ng-class]

60 questions
1
vote
1 answer

Changing class in the ng-repeat using the index value

Here I have a div in the ng-repeat
Now here result.subscribed is a boolean…
0
votes
0 answers

bug situation with Angular_Ng0303 *ngFor

I,ve been some days I started learning Angular, and now I'm having some troubles (here's the problem) when calling to the *ngForOf directive in a li, can someone help me? pd: In the trouble picture, you can see the console bug alert, the others show…
0
votes
0 answers

Facing issue in adding style to ng-container for only inside a div

I am trying to mimic the behavior of mat-form-field for required validation on ng-select In order to mimic the behaviour I need to add border and color as red when mat-error trigeered. Here is my HTML
0
votes
2 answers

How can I apply pseudo class by condition in Angular?

I have the following css #auction-history div:after { content: ""; width: 100%; height: 8px; position: absolute; bottom: -8px; background: #bad3e0; left: 0; } this css will be applied always on my div. I need to have…
0
votes
0 answers

Angular ngClass conditional class working correctly but app fails on build

I want to add an "active" class when I click on a certain tab using the pug code a.nav-link([class.active]="view === 'profile'", (click)="changeView('profile')") Profile a.nav-link([class.active]="view === 'products'",…
Tim Chosen
  • 41
  • 8
0
votes
2 answers

Angular6 Can't use ternary operator in ngClass with multiple entries

I'm trying to add multiple classes by ngClass, and I'm confused as to why I can't use ternary operator here.
0
votes
1 answer

angular - how to combine few ngclass together in one div

I would like to combine multiple ngClass if else statement together, I have tried but not able to resolve it.
0
votes
3 answers

How to use a function and expression in a ngClass using Angular?

I'm currently trying to show a list of Pokemons that have a different background color depending on their type. I would like to implement a feature where the border of the selected pokemon also shows with a gold border color. If I use them one at a…
Jens Panis
  • 99
  • 8
0
votes
1 answer

Angular 11 - text-decoration: line-through does not work properly with class binding

So I am making a todo app and I want to add stroke to the done tasks but the problem is that it is not working properly. my .css file .stroke{ text-decoration: line-through } and the element in the .html file
Ahmed
  • 595
  • 4
  • 25
0
votes
0 answers

Angular Material Table Apply Class based on [dataSource]

I have built an Angular Material Table and would like to use class error-text if the [dataSource] returns isActive=false. I'm trying to do this with no luck:
Janey
  • 1,260
  • 3
  • 17
  • 39
0
votes
1 answer

How can I assign different colors to disabled columns in Mat-Table?

i have disabled several columns in my table and want to display them in different colors. Therefore I wrote a function in Typescript where CSS is changed via the class .disabledRange. I have read that you can solve it with [ngClass]... I have an…
user10114552
0
votes
1 answer

how to show spinner for selected table row in angular 8

I have a list of videos coming from api. when play icon of a particular video from table is clicked a modal box opens. I want that when we submit this modal box a spinner starts rotating until it get response from server. my component.html …
0
votes
2 answers

Regex to split a long expressions string into an array of individual expressions

I have an expression string from Angular [ngClass] directive containing multiple expressions with their corresponding key separated by a comma. 'background_orange':row.columnname.split(',')[4] ==…
0
votes
2 answers

How to highlight only one expansion panel onclick and reset if choose other

Firstly, I am very new to Angular world. Trying to achieve a task. I really appreciate all inputs. Coming to the issue. I am creating multiple expansion panel using a "ngFor". I want to highlight or change style sheet for only the panel that user…
0
votes
1 answer

Using Angular ngClass dynamically not working

I am trying to dynamically set the class of my image in my template depending on which image is clicked. I have used this precisely as shown in the past and it worked then but is not working in this case. Template code to choose image:
koque
  • 1,830
  • 5
  • 28
  • 49