How to use ngIf with else

0 votes
With the help of code and example tell me How to use ngIf with else?
Feb 26, 2025 in Node-js by Nidhi
• 16,260 points
500 views

1 answer to this question.

0 votes

You can use *ngIf with else to display an alternative template when the condition is false.

Syntax:

<p *ngIf="isLoggedIn; else elseBlock">Welcome, User!</p>

<ng-template #elseBlock>

  <p>Please log in.</p>

</ng-template>

answered Feb 26, 2025 by Navya

Related Questions In Node-js

0 votes
1 answer

How to use MongoDB with promises in Node.js?

Hello @kartik, Try this: var MongoClient = require('mongodb').MongoClient var url ...READ MORE

answered Oct 12, 2020 in Node-js by Niroj
• 82,800 points
2,067 views
0 votes
1 answer

How to use an include with attributes with sequelize?

Hello @kartik, Something like this should work foo.findAll({ ...READ MORE

answered Oct 13, 2020 in Node-js by Niroj
• 82,800 points
16,299 views
0 votes
1 answer
0 votes
1 answer

How do I get the path to the current script with Node.js?

Hello @kartik, you can do this: fs.readFile(path.resolve(__dirname, 'settings.json'), 'UTF-8', ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,800 points
3,882 views
0 votes
1 answer

What are the vulnerability related to PHP Form?

Hii, The $_SERVER["PHP_SELF"] variable can be used by ...READ MORE

answered Feb 13, 2020 in PHP by Niroj
• 82,800 points
4,109 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28, 2020 in Java-Script by Niroj
• 82,800 points
22,235 views
0 votes
1 answer

Why it is necessary to refresh CSRF token per form request?

Hello, Generating a new CSRF token for each ...READ MORE

answered Mar 19, 2020 in Laravel by Niroj
• 82,800 points
5,545 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,800 points
4,581 views
0 votes
1 answer

How can I use React Router v4 to programmatically push to history?

You can utilize the history object's push ...READ MORE

answered Feb 21, 2025 in Node-js by Kavya
756 views
0 votes
1 answer

How to use redux-saga for handling complex async workflows?

To configure Redux DevTools to monitor state ...READ MORE

answered Mar 19, 2025 in Node-js by Avni
504 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP