unauthorized.component.ts
angular/comprehensive-demo/src/app/features/dashboard/unauthorized/unauthorized.component.ts
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink } from '@angular/router';
@Component({
selector: 'app-unauthorized',
standalone: true,
imports: [CommonModule, RouterLink],
template: `
<div class="unauthorized-container">
<h1>403 - Unauthorized</h1>
<p>You do not have permission to access this resource.</p>
<a routerLink="/dashboard" class="btn btn-primary">Go to Dashboard</a>
</div>
`,
styles: [`
.unauthorized-container {
max-width: 600px;
margin: 0 auto;
padding: 2rem;
text-align: center;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
`]
})
export class UnauthorizedComponent {}
Articles liés
server.js
server.js — javascript source code from the angular learning materials (angular/comprehensive-demo/server/server.js).
Lire l'article →app.component.ts
app.component.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.component.ts).
Lire l'article →app.config.ts
app.config.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.config.ts).
Lire l'article →app.routes.ts
app.routes.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.routes.ts).
Lire l'article →auth.guard.ts
auth.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/auth.guard.ts).
Lire l'article →role.guard.ts
role.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/role.guard.ts).
Lire l'article →