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
-3
votes
3 answers

Angular throws error: can't bind to "ngIf" since it isn't a known property of "ng-container"

I am making a project migration from Angular 7 to 11, and one particular module renders with this error: Can't bind to "ngIf" since it isn't a known property of "ng-container" I have CommonModule imported for the module, and previously module…
OverSteppe
  • 146
  • 1
  • 2
  • 15
-3
votes
3 answers

Angular ngIf two variables are the same (string and number)

So I have a variable sight.pin_lang_id that is loaded on the page. (Sometimes it is 1, sometimes 2). I also have a service that gets lang. Currently it has a name and id. See picture below: Now I want to display the lang.name only when the lang.id…
IkePr
  • 900
  • 4
  • 18
  • 44
-3
votes
1 answer

How to use more ngIf statements in angular5 efficiently?

I am a beginner in Angular development. Now using the *ngIf statements in my components. When searching I found articles which suggests not to use logic in *ngIf statements. Example 1:
Arron
  • 1,134
  • 2
  • 13
  • 32
-3
votes
2 answers

Angular 4+ : Why isn't ng-if working in app.componet.html?

I am currently trying to use an ng-if directive in my app.component.html file:

This should appear.

This shouldn't, but it does.

My app.component.ts file looks like this: import { Component } from…
-3
votes
1 answer

using *ngIf to display a form

how can I fix this problem Error: Uncaught (in promise): TypeError: __webpack_require__.e is not a function message: "Uncaught (in promise): TypeError: __webpack_require__.e is not a function TypeError: __webpack_require__.e is not a function
etah jet
  • 257
  • 3
  • 8
-3
votes
1 answer

Angular5 *ngIf=“afunctioncall(); let L” results in the function being called 4 times

I am working with Angular 5 and I want an element to return an object after finding from an array upon the result of a function call and then I use let L as a variable object to hold that. When I do this I've noticed that the function is called…
Umar Farooq Aslam
  • 485
  • 1
  • 8
  • 17
-3
votes
2 answers

Can't bind to 'ngIf'

Can't bind to ngIf since it isn't a known property
rajeev tejapuriya
  • 133
  • 1
  • 2
  • 12
-4
votes
1 answer

Angular confitional ngIf to hide a child component

I have a child component being called based on the boolean returned from showSidebar() If showSidebar() is false, the app-sidebar component is not displayed, but…
noclist
  • 1,659
  • 2
  • 25
  • 66
1 2 3
81
82