Blacked and isorted the python files
Prettied and eslinted the typescript/html files
This commit is contained in:
5
bookie/src/app/roles/permission.ts
Normal file
5
bookie/src/app/roles/permission.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export class Permission {
|
||||
id: string;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
@ -5,19 +5,31 @@
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div fxLayout="row" fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Name</mat-label>
|
||||
<input matInput #nameElement placeholder="Name" formControlName="name">
|
||||
<input matInput #nameElement placeholder="Name" formControlName="name" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
<div formArrayName="permissions">
|
||||
<div fxLayout="row" *ngFor="let p of item.permissions; index as i" [formGroupName]="i" fxLayout="row"
|
||||
fxLayoutAlign="space-around start" fxLayout.lt-md="column" fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px">
|
||||
<mat-checkbox formControlName="permission" fxFlex>{{p.name}}</mat-checkbox>
|
||||
<div
|
||||
fxLayout="row"
|
||||
*ngFor="let p of item.permissions; index as i"
|
||||
[formGroupName]="i"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-checkbox formControlName="permission" fxFlex>{{ p.name }}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {RoleDetailComponent} from './role-detail.component';
|
||||
import { RoleDetailComponent } from './role-detail.component';
|
||||
|
||||
describe('RoleDetailComponent', () => {
|
||||
let component: RoleDetailComponent;
|
||||
@ -8,9 +8,8 @@ describe('RoleDetailComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [RoleDetailComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RoleDetailComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { RoleService } from '../role.service';
|
||||
import { Role } from '../role';
|
||||
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { Role } from '../role';
|
||||
import { RoleService } from '../role.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-role-detail',
|
||||
templateUrl: './role-detail.component.html',
|
||||
styleUrls: ['./role-detail.component.css']
|
||||
styleUrls: ['./role-detail.component.css'],
|
||||
})
|
||||
export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement: ElementRef;
|
||||
@ -23,7 +24,7 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
private fb: FormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: RoleService
|
||||
private ser: RoleService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
@ -31,23 +32,25 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
name: '',
|
||||
permissions: this.fb.array([])
|
||||
permissions: this.fb.array([]),
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { item: Role }) => {
|
||||
this.item = data.item;
|
||||
this.form.get('name').setValue(this.item.name);
|
||||
this.form.setControl('permissions', this.fb.array(
|
||||
this.item.permissions.map(
|
||||
x => this.fb.group({
|
||||
permission: x.enabled
|
||||
})
|
||||
)
|
||||
));
|
||||
});
|
||||
this.route.data.subscribe((data: { item: Role }) => {
|
||||
this.item = data.item;
|
||||
this.form.get('name').setValue(this.item.name);
|
||||
this.form.setControl(
|
||||
'permissions',
|
||||
this.fb.array(
|
||||
this.item.permissions.map((x) =>
|
||||
this.fb.group({
|
||||
permission: x.enabled,
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@ -57,35 +60,33 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem())
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/roles');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
}
|
||||
);
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/roles');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
delete() {
|
||||
this.ser.delete(this.item.id)
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/roles');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
}
|
||||
);
|
||||
this.ser.delete(this.item.id).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/roles');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error.error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
confirmDelete(): void {
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
width: '250px',
|
||||
data: {title: 'Delete Role?', content: 'Are you sure? This cannot be undone.'}
|
||||
data: { title: 'Delete Role?', content: 'Are you sure? This cannot be undone.' },
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result: boolean) => {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {RoleListResolver} from './role-list-resolver.service';
|
||||
import { RoleListResolver } from './role-list-resolver.service';
|
||||
|
||||
describe('RoleListResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [RoleListResolver]
|
||||
providers: [RoleListResolver],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';
|
||||
import {Role} from './role';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {RoleService} from './role.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Role } from './role';
|
||||
import { RoleService } from './role.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleListResolver implements Resolve<Role[]> {
|
||||
constructor(private ser: RoleService, private router: Router) {}
|
||||
|
||||
constructor(private ser: RoleService, private router: Router) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Role[]> {
|
||||
resolve(): Observable<Role[]> {
|
||||
return this.ser.list();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
|
||||
import { Role } from '../role';
|
||||
|
||||
export class RoleListDataSource extends DataSource<Role> {
|
||||
|
||||
constructor(public data: Role[]) {
|
||||
super();
|
||||
}
|
||||
@ -12,6 +12,5 @@ export class RoleListDataSource extends DataSource<Role> {
|
||||
return observableOf(this.data);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
}
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -8,11 +8,12 @@
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="['/roles', row.id]">{{row.name}}</a></mat-cell>
|
||||
<mat-cell *matCellDef="let row"
|
||||
><a [routerLink]="['/roles', row.id]">{{ row.name }}</a></mat-cell
|
||||
>
|
||||
</ng-container>
|
||||
|
||||
<!-- Permissions Column -->
|
||||
@ -20,13 +21,13 @@
|
||||
<mat-header-cell *matHeaderCellDef>Permissions</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<ul>
|
||||
<li *ngFor="let permission of row.permissions">{{permission}}</li>
|
||||
<li *ngFor="let permission of row.permissions">{{ permission }}</li>
|
||||
</ul>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing';
|
||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {RoleListComponent} from './role-list.component';
|
||||
import { RoleListComponent } from './role-list.component';
|
||||
|
||||
describe('RoleListComponent', () => {
|
||||
let component: RoleListComponent;
|
||||
@ -8,9 +8,8 @@ describe('RoleListComponent', () => {
|
||||
|
||||
beforeEach(fakeAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [RoleListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RoleListComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(RoleListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { RoleListDataSource } from './role-list-datasource';
|
||||
import { Role } from '../role';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Role } from '../role';
|
||||
|
||||
import { RoleListDataSource } from './role-list-datasource';
|
||||
|
||||
@Component({
|
||||
selector: 'app-role-list',
|
||||
templateUrl: './role-list.component.html',
|
||||
styleUrls: ['./role-list.component.css']
|
||||
styleUrls: ['./role-list.component.css'],
|
||||
})
|
||||
export class RoleListComponent implements OnInit {
|
||||
dataSource: RoleListDataSource;
|
||||
@ -14,14 +16,12 @@ export class RoleListComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'permissions'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { list: Role[] }) => {
|
||||
this.list = data.list;
|
||||
});
|
||||
this.route.data.subscribe((data: { list: Role[] }) => {
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new RoleListDataSource(this.list);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {RoleResolver} from './role-resolver.service';
|
||||
import { RoleResolver } from './role-resolver.service';
|
||||
|
||||
describe('RoleResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [RoleResolver]
|
||||
providers: [RoleResolver],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';
|
||||
import {Role} from './role';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {RoleService} from './role.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
import { Role } from './role';
|
||||
import { RoleService } from './role.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleResolver implements Resolve<Role> {
|
||||
constructor(private ser: RoleService) {}
|
||||
|
||||
constructor(private ser: RoleService, private router: Router) {
|
||||
}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Role> {
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Role> {
|
||||
const id = route.paramMap.get('id');
|
||||
return this.ser.get(id);
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {RoleService} from './role.service';
|
||||
import { RoleService } from './role.service';
|
||||
|
||||
describe('RoleService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [RoleService]
|
||||
providers: [RoleService],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,64 +1,69 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { Role } from './role';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
const url = '/api/roles';
|
||||
const serviceName = 'RoleService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class RoleService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
||||
}
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(id: string): Observable<Role> {
|
||||
const getUrl: string = (id === null) ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<Role>>this.http.get<Role>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`))
|
||||
);
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return <Observable<Role>>(
|
||||
this.http
|
||||
.get<Role>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
}
|
||||
|
||||
list(): Observable<Role[]> {
|
||||
return <Observable<Role[]>>this.http.get<Role[]>(`${url}/list`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
return <Observable<Role[]>>(
|
||||
this.http
|
||||
.get<Role[]>(`${url}/list`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
}
|
||||
|
||||
save(role: Role): Observable<Role> {
|
||||
return <Observable<Role>>this.http.post<Role>(`${url}`, role, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save'))
|
||||
);
|
||||
return <Observable<Role>>(
|
||||
this.http
|
||||
.post<Role>(`${url}`, role, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
}
|
||||
|
||||
update(role: Role): Observable<Role> {
|
||||
return <Observable<Role>>this.http.put<Role>(`${url}/${role.id}`, role, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'update'))
|
||||
);
|
||||
return <Observable<Role>>(
|
||||
this.http
|
||||
.put<Role>(`${url}/${role.id}`, role, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
}
|
||||
|
||||
saveOrUpdate(role: Role): Observable<Role> {
|
||||
if (!role.id) {
|
||||
return this.save(role);
|
||||
} else {
|
||||
return this.update(role);
|
||||
}
|
||||
return this.update(role);
|
||||
}
|
||||
|
||||
delete(id: string): Observable<Role> {
|
||||
return <Observable<Role>>this.http.delete<Role>(`${url}/${id}`, httpOptions)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'delete'))
|
||||
);
|
||||
return <Observable<Role>>(
|
||||
this.http
|
||||
.delete<Role>(`${url}/${id}`, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'delete')))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
import { Permission } from './permission';
|
||||
|
||||
export class Role {
|
||||
id: string;
|
||||
name: string;
|
||||
permissions: Permission[];
|
||||
}
|
||||
|
||||
export class Permission {
|
||||
id: string;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {RoleListResolver} from './role-list-resolver.service';
|
||||
import {RoleResolver} from './role-resolver.service';
|
||||
import {RoleListComponent} from './role-list/role-list.component';
|
||||
import {RoleDetailComponent} from './role-detail/role-detail.component';
|
||||
import {AuthGuard} from '../auth/auth-guard.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
|
||||
import { RoleDetailComponent } from './role-detail/role-detail.component';
|
||||
import { RoleListResolver } from './role-list-resolver.service';
|
||||
import { RoleListComponent } from './role-list/role-list.component';
|
||||
import { RoleResolver } from './role-resolver.service';
|
||||
|
||||
const rolesRoutes: Routes = [
|
||||
{
|
||||
@ -13,49 +15,39 @@ const rolesRoutes: Routes = [
|
||||
component: RoleListComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Users'
|
||||
permission: 'Users',
|
||||
},
|
||||
resolve: {
|
||||
list: RoleListResolver
|
||||
}
|
||||
list: RoleListResolver,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: RoleDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Users'
|
||||
permission: 'Users',
|
||||
},
|
||||
resolve: {
|
||||
item: RoleResolver,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: RoleDetailComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Users'
|
||||
permission: 'Users',
|
||||
},
|
||||
resolve: {
|
||||
item: RoleResolver
|
||||
}
|
||||
}
|
||||
item: RoleResolver,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(rolesRoutes)
|
||||
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
RoleListResolver,
|
||||
RoleResolver
|
||||
]
|
||||
imports: [CommonModule, RouterModule.forChild(rolesRoutes)],
|
||||
exports: [RouterModule],
|
||||
providers: [RoleListResolver, RoleResolver],
|
||||
})
|
||||
export class RolesRoutingModule {
|
||||
}
|
||||
export class RolesRoutingModule {}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
import {RoleListComponent} from './role-list/role-list.component';
|
||||
import {RoleDetailComponent} from './role-detail/role-detail.component';
|
||||
import {RolesRoutingModule} from './roles-routing.module';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
@ -12,10 +11,12 @@ import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import {CdkTableModule} from '@angular/cdk/table';
|
||||
import {ReactiveFormsModule} from '@angular/forms';
|
||||
import {SharedModule} from '../shared/shared.module';
|
||||
import {FlexLayoutModule} from '@angular/flex-layout';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
|
||||
import { RoleDetailComponent } from './role-detail/role-detail.component';
|
||||
import { RoleListComponent } from './role-list/role-list.component';
|
||||
import { RolesRoutingModule } from './roles-routing.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@ -32,12 +33,8 @@ import {FlexLayoutModule} from '@angular/flex-layout';
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
SharedModule,
|
||||
RolesRoutingModule
|
||||
RolesRoutingModule,
|
||||
],
|
||||
declarations: [
|
||||
RoleListComponent,
|
||||
RoleDetailComponent
|
||||
]
|
||||
declarations: [RoleListComponent, RoleDetailComponent],
|
||||
})
|
||||
export class RolesModule {
|
||||
}
|
||||
export class RolesModule {}
|
||||
|
||||
Reference in New Issue
Block a user