mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
fix: run prettier on all file to avoid prettier issue inside PR
This commit is contained in:
@@ -11,14 +11,14 @@ import { RouterModule } from '@angular/router';
|
||||
path: '',
|
||||
loadChildren: () =>
|
||||
import('./dashboard/dashboard.component').then(
|
||||
(m) => m.DashboardModule
|
||||
(m) => m.DashboardModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'create-user',
|
||||
loadChildren: () =>
|
||||
import('./create-user/create-user.component').then(
|
||||
(m) => m.CreateUserModule
|
||||
(m) => m.CreateUserModule,
|
||||
),
|
||||
},
|
||||
]),
|
||||
|
||||
@@ -3,13 +3,15 @@ import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-create-user',
|
||||
template: `Create User Form
|
||||
template: `
|
||||
Create User Form
|
||||
|
||||
<button
|
||||
routerLink=".."
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-5">
|
||||
class="ml-5 rounded-lg border bg-gray-700 p-2 text-white">
|
||||
Back
|
||||
</button> `,
|
||||
</button>
|
||||
`,
|
||||
})
|
||||
export class CreateUserComponent {}
|
||||
|
||||
|
||||
@@ -3,13 +3,15 @@ import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-dashboard',
|
||||
template: `Dashboard
|
||||
template: `
|
||||
Dashboard
|
||||
|
||||
<button
|
||||
routerLink="create-user"
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-10">
|
||||
class="ml-10 rounded-lg border bg-gray-700 p-2 text-white">
|
||||
Create User
|
||||
</button> `,
|
||||
</button>
|
||||
`,
|
||||
})
|
||||
export class DashboardComponent {}
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@ import { Observable, map } from 'rxjs';
|
||||
export class IsAuthorizedGuard implements CanActivate {
|
||||
constructor(
|
||||
private authorizationService: AuthorizationService,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
) {}
|
||||
|
||||
canActivate(): Observable<boolean | UrlTree> {
|
||||
return this.authorizationService.isAuthorized$.pipe(
|
||||
map((isAuthorized) =>
|
||||
isAuthorized ? true : this.router.createUrlTree(['forbidden'])
|
||||
)
|
||||
isAuthorized ? true : this.router.createUrlTree(['forbidden']),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-home',
|
||||
template: `Forbidden component`,
|
||||
template: `
|
||||
Forbidden component
|
||||
`,
|
||||
})
|
||||
export class ForbiddenComponent {}
|
||||
|
||||
@@ -4,9 +4,10 @@ import { Component, Inject } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-home',
|
||||
template: `Home component
|
||||
template: `
|
||||
Home component
|
||||
|
||||
<section class="flex gap-5 items-center">
|
||||
<section class="flex items-center gap-5">
|
||||
Authorization :
|
||||
<button class="border p-2 " (click)="authorizeService.authorize()">
|
||||
Authorize
|
||||
@@ -17,11 +18,12 @@ import { Component, Inject } from '@angular/core';
|
||||
(isAuthorized: {{ authorizeService.isAuthorized$ | async }})
|
||||
</section>
|
||||
|
||||
<section>LoadedToken {{ token }}</section> `,
|
||||
<section>LoadedToken {{ token }}</section>
|
||||
`,
|
||||
})
|
||||
export class HomeComponent {
|
||||
constructor(
|
||||
public authorizeService: AuthorizationService,
|
||||
@Inject(TOKEN) public token: string
|
||||
@Inject(TOKEN) public token: string,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export const appRoutes: Route[] = [
|
||||
path: 'home',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/home').then(
|
||||
(m) => m.ModuleToStandaloneHomeModule
|
||||
(m) => m.ModuleToStandaloneHomeModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -15,14 +15,14 @@ export const appRoutes: Route[] = [
|
||||
canActivate: [IsAuthorizedGuard],
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/admin/feature').then(
|
||||
(m) => m.AdminFeatureModule
|
||||
(m) => m.AdminFeatureModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/user/shell').then(
|
||||
(m) => m.UserShellModule
|
||||
(m) => m.UserShellModule,
|
||||
),
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export const appRoutes: Route[] = [
|
||||
path: 'forbidden',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/forbidden').then(
|
||||
(m) => m.ForbiddenModule
|
||||
(m) => m.ForbiddenModule,
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -11,14 +11,14 @@ import { RouterModule } from '@angular/router';
|
||||
path: '',
|
||||
loadChildren: () =>
|
||||
import('./dashboard/dashboard.component').then(
|
||||
(m) => m.ContactDashboardModule
|
||||
(m) => m.ContactDashboardModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'create-contact',
|
||||
loadChildren: () =>
|
||||
import('./create-contact/create-contact.component').then(
|
||||
(m) => m.CreateContactModule
|
||||
(m) => m.CreateContactModule,
|
||||
),
|
||||
},
|
||||
]),
|
||||
|
||||
@@ -3,13 +3,15 @@ import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-create-contact',
|
||||
template: `Create Contact Form
|
||||
template: `
|
||||
Create Contact Form
|
||||
|
||||
<button
|
||||
routerLink=".."
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-5">
|
||||
class="ml-5 rounded-lg border bg-gray-700 p-2 text-white">
|
||||
Back
|
||||
</button> `,
|
||||
</button>
|
||||
`,
|
||||
})
|
||||
export class CreateContactComponent {}
|
||||
|
||||
|
||||
@@ -3,13 +3,15 @@ import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-contact-dashboard',
|
||||
template: `Contact Dashboard
|
||||
template: `
|
||||
Contact Dashboard
|
||||
|
||||
<button
|
||||
routerLink="create-contact"
|
||||
class="border bg-gray-700 rounded-lg p-2 text-white ml-10">
|
||||
class="ml-10 rounded-lg border bg-gray-700 p-2 text-white">
|
||||
Create contact
|
||||
</button> `,
|
||||
</button>
|
||||
`,
|
||||
})
|
||||
export class ContactDashboardComponent {}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'lib-user-home',
|
||||
template: `User Home component`,
|
||||
template: `
|
||||
User Home component
|
||||
`,
|
||||
})
|
||||
export class UserHomeComponent {}
|
||||
|
||||
@@ -5,15 +5,15 @@ import { Component, Inject } from '@angular/core';
|
||||
selector: 'lib-user-shell',
|
||||
template: `
|
||||
-- User Panel --
|
||||
<div class="flex gap-2 items-center">
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
routerLink="home"
|
||||
class="border px-4 py-2 border-blue-400 rounded-md">
|
||||
class="rounded-md border border-blue-400 px-4 py-2">
|
||||
Home
|
||||
</button>
|
||||
<button
|
||||
routerLink="contact"
|
||||
class="border px-4 py-2 border-blue-400 rounded-md">
|
||||
class="rounded-md border border-blue-400 px-4 py-2">
|
||||
Contact
|
||||
</button>
|
||||
More buttons ...
|
||||
|
||||
@@ -11,14 +11,14 @@ export const userShellRoutes: Route[] = [
|
||||
path: 'home',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/user/home').then(
|
||||
(m) => m.UserHomeModule
|
||||
(m) => m.UserHomeModule,
|
||||
),
|
||||
},
|
||||
{
|
||||
path: 'contact',
|
||||
loadChildren: () =>
|
||||
import('@angular-challenges/module-to-standalone/user/contact').then(
|
||||
(m) => m.ContactFeatureModule
|
||||
(m) => m.ContactFeatureModule,
|
||||
),
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user