Skip to content

Commit 07f97e2

Browse files
authored
Merge pull request #1272 from alex-bu-93/admin-clean-up
Add - admin modules clean up
2 parents b39bc6a + c0951e0 commit 07f97e2

File tree

173 files changed

+525
-1034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+525
-1034
lines changed

apps/codelab/src/app/admin/admin.component.css renamed to apps/codelab/src/app/admin/admin-layout/admin-layout.component.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
margin: 0 auto;
55
}
66

7-
.wrapper {
8-
margin-top: 20px;
7+
nav {
8+
margin-bottom: 20px;
99
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<mat-card appearance="outlined">
2+
<h2>Angular Codelab 🔥 Admin</h2>
3+
<nav mat-tab-nav-bar [tabPanel]="tabPanel">
4+
<a *ngFor="let link of ['users', 'feedback', 'content',]"
5+
mat-tab-link
6+
routerLinkActive
7+
#rla="routerLinkActive"
8+
[routerLink]="link"
9+
[active]="rla.isActive">
10+
{{ link | titlecase }}
11+
</a>
12+
</nav>
13+
<mat-tab-nav-panel #tabPanel></mat-tab-nav-panel>
14+
<router-outlet></router-outlet>
15+
</mat-card>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
2+
3+
@Component({
4+
changeDetection: ChangeDetectionStrategy.OnPush,
5+
selector: 'slides-admin-layout',
6+
templateUrl: './admin-layout.component.html',
7+
styleUrls: ['./admin-layout.component.css']
8+
})
9+
export class AdminLayoutComponent {
10+
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterModule } from '@angular/router';
4+
import { MatCardModule } from '@angular/material/card';
5+
import { MatTabsModule } from '@angular/material/tabs';
6+
import { AdminLayoutComponent } from './admin-layout.component';
7+
8+
@NgModule({
9+
imports: [
10+
CommonModule,
11+
MatCardModule,
12+
MatTabsModule,
13+
RouterModule
14+
],
15+
declarations: [AdminLayoutComponent]
16+
})
17+
export class AdminLayoutModule {
18+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './admin-layout.component';
2+
export * from './admin-layout.module';

apps/codelab/src/app/admin/admin-routing.module.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

apps/codelab/src/app/admin/admin.component.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

apps/codelab/src/app/admin/admin.component.spec.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/codelab/src/app/admin/admin.component.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
import { NgModule } from '@angular/core';
2-
import { CommonModule } from '@angular/common';
3-
import { MatCardModule } from '@angular/material/card';
4-
import { MatTabsModule } from '@angular/material/tabs';
5-
import { AdminComponent } from './admin.component';
6-
import { AdminRoutingModule } from './admin-routing.module';
7-
import { FeedbackModule } from './feedback/feedback.module';
8-
import { UsersModule } from './users/users.module';
9-
import { ContentModule } from './content/presentation-editor/content.module';
10-
import { PreviewModule } from './content/presentation-editor/preview/preview.module';
11-
import { PresentationListModule } from './content/presentation-list/presentation-list.module';
2+
import { RouterModule, Routes } from '@angular/router';
3+
import { UsersComponent, UsersModule } from './pages/users';
4+
import { FeedbackComponent, FeedbackModule } from './pages/feedback';
5+
import { AdminLayoutComponent, AdminLayoutModule } from './admin-layout';
6+
7+
const routes: Routes = [
8+
{
9+
path: '',
10+
component: AdminLayoutComponent,
11+
children: [
12+
{path: 'users', component: UsersComponent},
13+
{path: 'feedback', component: FeedbackComponent},
14+
],
15+
},
16+
{
17+
path: 'content',
18+
loadChildren: () => import('./pages/content').then(m => m.ContentModule)
19+
},
20+
];
21+
1222

1323
@NgModule({
1424
imports: [
15-
AdminRoutingModule,
16-
CommonModule,
17-
ContentModule,
18-
FeedbackModule,
19-
PreviewModule,
20-
PresentationListModule,
25+
AdminLayoutModule,
2126
UsersModule,
22-
MatCardModule,
23-
MatTabsModule,
24-
],
25-
declarations: [AdminComponent],
27+
FeedbackModule,
28+
RouterModule.forChild(routes)
29+
]
2630
})
2731
export class AdminModule {
2832
}

0 commit comments

Comments
 (0)