NgIf else: Property X does not exist on type Y.

578 views
Skip to first unread message

Mihamina Rakotomandimby

unread,
Aug 28, 2019, 10:50:50 PM8/28/19
to Angular and AngularJS discussion
Hi all, 

I'm following this tutorial:

The component:

...
@Component({
    templateUrl
: './list-ligne.component.html',
   
...
})
...
export class ListLigneComponent { ... }

The template:
<div *ngIf="isLoggedIn; else loggedOut"> Welcome back, friend. </div>
<ng-template #loggedOut> Please friend, login. </ng-template>

When "ng build --prod":

Property 'loggedOut' does not exist on type 'ListLigneComponent'.

How to tell "ng build" that "loggedOut" should not be seen as a property?

Thank you
.

Sander Elias

unread,
Aug 31, 2019, 2:07:58 AM8/31/19
to Angular and AngularJS discussion
Hi Mihamina,

That should not happen. I' using things like this all over the place, and do not have that problem.
Do you have a repo I can check out to see what is going on?

Regards
Sander
Reply all
Reply to author
Forward
0 new messages