Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Meu-Template-Angular-CSR
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Trần Anh Phú
Meu-Template-Angular-CSR
Commits
1b3c45b2
Commit
1b3c45b2
authored
Dec 04, 2024
by
vtduong0912
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: job detail
parent
7595efc7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
7 deletions
+78
-7
job.service.ts
src/app/+job/data-access/service/job.service.ts
+4
-0
job-detail.component.ts
src/app/+job/feature/+job_detail/job-detail.component.ts
+56
-0
job.component.html
src/app/+job/feature/job.component.html
+3
-3
job.component.ts
src/app/+job/feature/job.component.ts
+3
-1
job.routes.ts
src/app/+job/job.routes.ts
+12
-2
layout.component.ts
src/app/+shell/ui/layout.component.ts
+0
-1
No files found.
src/app/+job/data-access/service/job.service.ts
View file @
1b3c45b2
...
...
@@ -21,4 +21,8 @@ export class JobService {
}
});
}
jobsGetOne
(
id
:
string
)
{
return
this
.
_http
.
get
<
ResponseResult
<
Jobs
.
Job
>>
(
`jobs/
${
id
}
`
);
}
}
\ No newline at end of file
src/app/+job/feature/+job_detail/job-detail.component.ts
0 → 100644
View file @
1b3c45b2
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
OnInit
}
from
'@angular/core'
;
import
{
JobApi
}
from
'../../../+admin/management/job/data-access/model/job-manager.model'
;
import
{
JobService
}
from
'../../data-access/service/job.service'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
catchError
,
of
,
tap
}
from
'rxjs'
;
import
{
Jobs
}
from
'../../data-access/model/job.model'
;
@
Component
({
selector
:
'job-detail'
,
standalone
:
true
,
template
:
`
<div class="tw-max-w-3xl tw-mx-auto">
<p> {{ job?.company }} </p>
<p> {{ job?.company_logo }} </p>
<p> {{ job?.id }} </p>
<p> {{ job?.company }} </p>
<p> {{ job?.company }} </p>
<p> {{ job?.company }} </p>
<p> {{ job?.company }} </p>
<p> {{ job?.company }} </p>
</div>
`
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
JobDetailComponent
implements
OnInit
{
id
:
string
|
null
=
''
;
job
:
Jobs
.
Job
|
null
=
null
;
constructor
(
private
_jobService
:
JobService
,
private
_activatedRoute
:
ActivatedRoute
,
private
_cdr
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
this
.
id
=
this
.
_activatedRoute
.
snapshot
.
paramMap
.
get
(
'id'
);
this
.
getJob
();
}
getJob
()
{
this
.
_jobService
.
jobsGetOne
(
this
.
id
!
)
.
pipe
(
tap
((
response
)
=>
{
this
.
job
=
response
?.
responseData
;
this
.
_cdr
.
markForCheck
();
}),
catchError
((
err
)
=>
{
return
of
(
null
);
})
)
.
subscribe
();
}
}
\ No newline at end of file
src/app/+job/feature/job.component.html
View file @
1b3c45b2
...
...
@@ -22,9 +22,9 @@
<p>
Location: {{ job.location }}
</p>
</div>
<div
class=
"tw-flex-grow tw-grid tw-justify-end "
>
<button
class=
"tw-h-10 tw-px-2 tw-border tw-rounded-lg hover:tw-bg-black hover:tw-text-white tw-transition"
>
Apply
</button>
<button
routerLink=
"/jobs/detail/{{job.id}}"
class=
"tw-h-10 tw-px-2 tw-border tw-rounded-lg hover:tw-bg-black hover:tw-text-white tw-transition"
>
See detail
</button>
</div>
</div>
</nz-card>
...
...
src/app/+job/feature/job.component.ts
View file @
1b3c45b2
...
...
@@ -8,6 +8,7 @@ import { catchError, of, tap } from 'rxjs';
import
{
NzCardModule
}
from
'ng-zorro-antd/card'
;
import
{
NzAvatarModule
}
from
'ng-zorro-antd/avatar'
;
import
{
NzPaginationModule
}
from
'ng-zorro-antd/pagination'
;
import
{
RouterLink
}
from
'@angular/router'
;
@
Component
({
selector
:
'meu-job-list-page'
,
...
...
@@ -20,7 +21,8 @@ import { NzPaginationModule } from 'ng-zorro-antd/pagination';
NzCardModule
,
NzAvatarModule
,
NzPaginationModule
,
DatePipe
DatePipe
,
RouterLink
],
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
...
...
src/app/+job/job.routes.ts
View file @
1b3c45b2
...
...
@@ -3,8 +3,18 @@ import { Route } from '@angular/router';
const
JOB_ROUTES
:
Route
[]
=
[
{
path
:
''
,
loadComponent
:
()
=>
import
(
'./feature/job.component'
).
then
((
m
)
=>
m
.
JobComponent
),
children
:
[
{
path
:
''
,
loadComponent
:
()
=>
import
(
'./feature/job.component'
).
then
((
m
)
=>
m
.
JobComponent
),
},
{
path
:
'detail/:id'
,
loadComponent
:
()
=>
import
(
'./feature/+job_detail/job-detail.component'
).
then
((
m
)
=>
m
.
JobDetailComponent
),
}
],
},
];
export
default
JOB_ROUTES
;
src/app/+shell/ui/layout.component.ts
View file @
1b3c45b2
...
...
@@ -20,7 +20,6 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout';
standalone
:
true
,
imports
:
[
RouterModule
,
DatePipe
,
HeaderComponent
,
FooterComponent
,
NzButtonModule
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment