Skip to content

Commit

Permalink
added project
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackerakiUA committed Jan 31, 2025
1 parent 0856ca6 commit cc9d63c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ const routes: Routes = [
component: UserComponent,
children: [
/* user */
{
path: 'project',
canActivate: [MetaGuard],
data: {
meta: {
title: 'Project'
}
},
loadChildren: () => import('./pages/user/project/project.module').then(m => m.ProjectModule)
},
{
path: 'mineprojects',
canActivate: [MetaGuard],
Expand Down
1 change: 1 addition & 0 deletions src/app/pages/user/project/project.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>{{project.name}}</h1>
Empty file.
19 changes: 19 additions & 0 deletions src/app/pages/user/project/project.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { TaskprojectService } from 'src/app/modules/taskproject/services/taskproject.service';

@Component({
templateUrl: './project.component.html',
styleUrls: ['./project.component.scss'],
standalone: false
})
export class ProjectComponent {
project = this._taskprojectService.doc(
this._router.url.replace('/project/', '')
);

constructor(
private _taskprojectService: TaskprojectService,
private _router: Router
) {}
}
17 changes: 17 additions & 0 deletions src/app/pages/user/project/project.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { CoreModule } from 'src/app/core/core.module';
import { ProjectComponent } from './project.component';
import { Routes, RouterModule } from '@angular/router';

const routes: Routes = [
{
path: ':project_id',
component: ProjectComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes), CoreModule],
declarations: [ProjectComponent]
})
export class ProjectModule {}
4 changes: 3 additions & 1 deletion src/app/pages/user/projects/projects.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
*ngFor="let project of projects"
class="documents-main-row"
>
<app-project [project]="project"></app-project>
<a routerLink="/project/{{project._id}}">
<app-project [project]="project"></app-project>
</a>
</div>
</div>
</div>
Expand Down

0 comments on commit cc9d63c

Please sign in to comment.