currently, i am practiced angular 4. when a normal user view this then show public content When A Registered user enter the web page then show edit or some content>
NgIf is a structural directive. That means your component would be destroyed when the expression becomes false.
So if your component is often destroyed and created again than this can be an issue. In this case the [hidden] directive should be considered. It only sets display:none. In this case your component would not be destroyed.
{{val}}