admin.component.ts
angular/comprehensive-demo/src/app/features/dashboard/admin/admin.component.ts
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-admin',
standalone: true,
imports: [CommonModule],
template: `
<div class="admin-container">
<h1>Admin Panel</h1>
<p>This page is only accessible to users with admin role.</p>
<p>Protected by roleGuard with data: {{ '{' }} roles: ['admin'] {{ '}' }}</p>
</div>
`,
styles: [`
.admin-container {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
`]
})
export class AdminComponent {}
관련 글
server.js
server.js — javascript source code from the angular learning materials (angular/comprehensive-demo/server/server.js).
글 읽기 →app.component.ts
app.component.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.component.ts).
글 읽기 →app.config.ts
app.config.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.config.ts).
글 읽기 →app.routes.ts
app.routes.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/app.routes.ts).
글 읽기 →auth.guard.ts
auth.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/auth.guard.ts).
글 읽기 →role.guard.ts
role.guard.ts — typescript source code from the angular learning materials (angular/comprehensive-demo/src/app/core/guards/role.guard.ts).
글 읽기 →