Angular Authentication: Custom Structural Directive

preview_player
Показать описание
We use the *ngIf angular structural directive to show/hide content in the template. In this video, we will create an Angular Custom Structural Directive to serve our needs.

******************************************************
Let's connect
******************************************************

#angular #structuraldirective #customStructuralDirective #angularCustomStructuralDirective #directive #angularDirective #angulartutorial
Рекомендации по теме
Комментарии
Автор

Really awesome video, Profanis. I think it's worth mentioning that the role string could be made a little safer if it were a type string literal or enum value.

markgoho
Автор

Thank you for this useful playlist, you deserve more views

salmalakhlifi
Автор

Awesome video!
If someone is beginner and looks at this video and gets the error "Type 'boolean | undefined' is not assignable to type 'boolean'.
Type 'undefined' is not assignable to type 'boolean'." for the hasRole() method just use '|| false' after it, like this:

hasRole(role: string): boolean {
return || false;
}

MikeyCoree
Автор

Lovely. Please make video on unit testing and state management.

triloksingh
Автор

Thank you very much for this great series!
Is it possible to modify this code so that the DOM element automatically updates (shows/hides) once the underlying roles have changed? Right now I always have to manually refresh the page to reflect changes in the underlying roles.

AgeCreationTutorials
Автор

Clearly and easy explained. Good one. Do you plan to make video about handling errors?

henio
Автор

How safe is this approach, or: how easy/difficult it'd be for someone to fiddle with the logic in devtools and see parts of the template they are not entitled to see?

aram