Questions tagged [angular-ng-if]

'ngIf' is an Angular core directive that toggles the presence of the targeted element in the DOM. Do not use this tag for the 'ng-if' directive in the older AngularJS version.

ngIf is an Angular directive that alters the targeted element.

From the documentation:

Conditionally includes a template based on the value of an expression.

1223 questions
-1
votes
2 answers

Angular ngIF: take variable value as condition

I'm trying to bind inputs from the back side to the front and got a question: to avoid crazy parsing exercise, can I use an income variable as a condition for *ngIf instruction? Like this:
Eugene
  • 301
  • 2
  • 12
-1
votes
1 answer

check with ngIf an array component angular

When you check just for variable then this code is enough
But how can I use a specific component of array instead of variable? for example I want to check for array component someArray[] using idVar…
David
  • 4,332
  • 13
  • 54
  • 93
-1
votes
1 answer

How to select all checkboxes in Angular with ngFor and ngIf?

I would like to select all the checkboxes in Angular, where I have ngFor and ngIf when activating "Seleccionar todo (Select all)" and all the checkboxes of months are activated. The months are stored in an array. HTML representation
-1
votes
1 answer

How to activate component in loop angular?

I have a template:
When user clicks over…
user13406409
-1
votes
3 answers

how to use negative ngIf?

Im trying to show a div if "avenant" does not exist but its not working ! *ngIf="avenant" is working it shows the avenants if they exist, but *ngIf="!avenant" doesn't show the message in the div !
Lamyae Lac
  • 43
  • 11
-1
votes
5 answers

How can I avoid using *ngIf in an Angular template?

I tried using async/await to avoid *ngIf in the component template. I'm getting an error in the Chrome console when I remove *ngIf in component template. Can anyone help to get a solution. I do not want to use *ngIf in the component template as a…
-1
votes
4 answers

Angular ngIf with multiple statements in else

How do you write ngIf with multiple statements under else ? I have a feeling I am doing something silly but surprised to not find anyone else in this situation other than me. *ngIf=col !='actions'; else…
WhatsInAName
  • 9
  • 1
  • 5
-1
votes
1 answer

show and hide between 2 different component Angular

I have Parent component with 2 different child, inquiryForm and inquiryResponse, I got situation when I need to hide and show this 2 component based on condition: If user had click submit on inquiryForm, it will hide inquiryForm component and show…
hafizi hamid
  • 405
  • 2
  • 20
  • 41
-1
votes
1 answer

Angular simple ngIf inverted?

Homemade NavBar. environment contains lists with the dropdown elements defined like this: { title: 'Overview', isDropped: false, Links: [ {linkTitle: 'What is Hunter', linkRoute: '/whatishunter'}, {linkTitle: 'What is a…
Yogi Bear
  • 943
  • 2
  • 16
  • 32
-1
votes
2 answers

Closing HTML Tag with Angular ng-if directive

i have a conditional table with a td that i want to close before or after some events. With NG-IF directive i can't do it because of i close the TD tag into NG-CONTAINER. Is possible to do this? I cut here only a part of code. One solution can be to…
-1
votes
2 answers

Angular Simple Directive ngIf

I do not know how to write my condition in angular and I can not find an equate example. How i can listen to my material selection ? How I write a ngIf condition ? {{referentielToDisplay.speSS}} have a equal value of one of my toppingList, i want…
Newbiiiie
  • 1,401
  • 3
  • 14
  • 33
-1
votes
1 answer

Angular 4 ngFor & ngIf

I'm looking to count the number of quizzes that have been completed in my array, that are equal to "level 1". Whenever I try to display the count of items that are equal to level 1 in the progressList, it will display the number for all of the items…
cdh429
  • 337
  • 3
  • 11
  • 20
-1
votes
1 answer

how to show a table tr `` with double click? | angular js

Status: I have a view where user double click a certain row to edit the table data. VIEW:
Ali
  • 1,633
  • 7
  • 35
  • 58
-1
votes
3 answers

Can't use ngIf and ngFor in same template correctly. Angular2

[playersTEST]="playerEL" (playerWasSelected)="onPlayerSelected(playerEL)">
-1
votes
1 answer

Thumbs Up / Thumbs Down *ngIf

So I have an *ngFor list of songs. I would like for the user to click on a thumb, and then for that thumb to be higlighted, then set a propety whether the song is thumbs up, or thumbs down based off that click event. I would like for the thumb to…
Eddie Taliaferro
  • 268
  • 1
  • 5
  • 11