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…

harish kumar
- 15
- 7
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…

Alejandro Diaz
- 1
- 1
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…

someusername12
- 45
- 6
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.
I get the following error:
Parser Error: Missing…
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.

user7046311
- 49
- 9
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: