angular - Ensuring components are properly initialized -


i have started guarding components initializing

<my-component*ngif="someinput" [input]="someinput"><my-component>

is there better way ensure input exists before initializing component?

is there performance reason allow component initialize without input , perfom check within component?

the biggest consideration design choice , how these components interact. how child component relate parent? parent toggle input between true or false? ngif destroys component when false can performance if component heavy not necessary if lightweight.

the performance reason rendering component before data initializes , displays on screen faster. if input async , takes while load, component not display @ on page until input ready. rather might better user experience render child component first , displaying loading symbol until input arrives.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -