mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
31 lines
882 B
TypeScript
31 lines
882 B
TypeScript
import { TOKEN } from '@angular-challenges/module-to-standalone/core/providers';
|
|
import { AuthorizationService } from '@angular-challenges/module-to-standalone/core/service';
|
|
import { Component, Inject } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'lib-home',
|
|
template: `
|
|
Home component
|
|
|
|
<section class="flex items-center gap-5">
|
|
Authorization :
|
|
<button class="border p-2 " (click)="authorizeService.authorize()">
|
|
Authorize
|
|
</button>
|
|
<button class="border p-2 " (click)="authorizeService.forbid()">
|
|
Forbid
|
|
</button>
|
|
(isAuthorized: {{ authorizeService.isAuthorized$ | async }})
|
|
</section>
|
|
|
|
<section>LoadedToken {{ token }}</section>
|
|
`,
|
|
standalone: false,
|
|
})
|
|
export class HomeComponent {
|
|
constructor(
|
|
public authorizeService: AuthorizationService,
|
|
@Inject(TOKEN) public token: string,
|
|
) {}
|
|
}
|