Something went wrong. Try again.
Some angular code i wrote while following: Angular - The Complete Guide (2025 Edition)
Something went wrong. Try again.
677 B · 18 lines
TypeScript
at master
12345678910111213141516171819import { Component, computed, inject } from '@angular/core';
import { AuthComponent } from './auth/auth.component';import { LearningResourcesComponent } from './learning-resources/learning-resources.component';import { AuthService } from './auth/auth.service';import { AuthDirective } from './auth/auth.directive';
@Component({ selector: 'app-root', standalone: true, templateUrl: './app.component.html', styleUrl: './app.component.css', imports: [AuthComponent, LearningResourcesComponent, AuthDirective],})export class AppComponent { private authService = inject(AuthService); isAdmin = computed(() => this.authService.activePermission() === 'admin');}