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
6aec78ad
Commit
6aec78ad
authored
Dec 04, 2024
by
tinhbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d382ce2b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
117 additions
and
23 deletions
+117
-23
Job.component.ts
src/app/+admin/Management/Job/Job.component.ts
+0
-1
JobService.service.ts
src/app/+admin/data-access/services/JobService.service.ts
+0
-4
JobCard.component.html
src/app/+home/component/JobCard/JobCard.component.html
+9
-4
JobCard.component.ts
src/app/+home/component/JobCard/JobCard.component.ts
+8
-4
JobDetail.component.html
src/app/+home/component/JobDetail/JobDetail.component.html
+8
-0
JobDetail.component.ts
src/app/+home/component/JobDetail/JobDetail.component.ts
+14
-0
JobListCard.component.html
...pp/+home/component/JobListCard/JobListCard.component.html
+22
-4
JobListCard.component.ts
src/app/+home/component/JobListCard/JobListCard.component.ts
+23
-5
Job.model.ts
src/app/+home/data-access/model/Job.model.ts
+12
-0
Job.service.ts
src/app/+home/data-access/service/Job.service.ts
+17
-0
home.component.html
src/app/+home/feature/home.component.html
+1
-0
home.component.ts
src/app/+home/feature/home.component.ts
+3
-1
No files found.
src/app/+admin/Management/Job/Job.component.ts
View file @
6aec78ad
...
@@ -60,7 +60,6 @@ export class JobComponent implements OnInit {
...
@@ -60,7 +60,6 @@ export class JobComponent implements OnInit {
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
jobService
.
jobsGet
().
pipe
(
this
.
jobService
.
jobsGet
().
pipe
(
tap
((
res
)
=>
{
tap
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
responseData
)
if
(
res
.
responseData
)
this
.
listOfJob
=
res
.
responseData
.
rows
;
this
.
listOfJob
=
res
.
responseData
.
rows
;
}),
}),
...
...
src/app/+admin/data-access/services/JobService.service.ts
View file @
6aec78ad
...
@@ -14,11 +14,7 @@ export class JobService {
...
@@ -14,11 +14,7 @@ export class JobService {
apiUrlById
=
environment
.
API_DOMAIN
+
'/jobById'
;
apiUrlById
=
environment
.
API_DOMAIN
+
'/jobById'
;
constructor
(
private
http
:
HttpClient
)
{}
constructor
(
private
http
:
HttpClient
)
{}
// jobsGet(): Observable<ResponseResult<JobModel[]>> {
// return this.http.get<ResponseResult<JobModel[]>>(this.apiUrl);
// }
jobsGet
():
Observable
<
ResponseResult
<
Rows
<
JobModel
>>>
{
jobsGet
():
Observable
<
ResponseResult
<
Rows
<
JobModel
>>>
{
const
params
=
new
HttpParams
()
return
this
.
http
.
get
<
ResponseResult
<
Rows
<
JobModel
>>>
(
this
.
apiUrl
);
return
this
.
http
.
get
<
ResponseResult
<
Rows
<
JobModel
>>>
(
this
.
apiUrl
);
}
}
...
...
src/app/+home/component/JobCard/JobCard.component.html
View file @
6aec78ad
<nz-card
nzHoverable
style=
"width:240px"
[
nzCover
]="
coverTemplate
"
>
<nz-card
*
ngIf=
"job"
[
nzTitle
]="
job
.
title
"
[
nzExtra
]="
extraTemplate
"
>
<nz-card-meta
nzTitle=
"Europe Street beat"
nzDescription=
"www.instagram.com"
></nz-card-meta>
<p>
loại công việc: {{job.type}}
</p>
<p>
Công ty: {{job.company}}
</p>
<p>
Địa chỉ làm việc: {{job.location}}
</p>
</nz-card>
</nz-card>
<ng-template
#
coverTemplate
>
<img
alt=
"example"
src=
"https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png"
/>
<ng-template
#
extraTemplate
>
<button
class=
"tw-mr-2"
nz-button
nzType=
"primary"
nzSize=
"small"
>
more
</button>
</ng-template>
</ng-template>
src/app/+home/component/JobCard/JobCard.component.ts
View file @
6aec78ad
import
{
ChangeDetectionStrategy
,
Component
}
from
"@angular/core"
;
import
{
ChangeDetectionStrategy
,
Component
,
Input
}
from
"@angular/core"
;
import
{
NzCardModule
}
from
"ng-zorro-antd/card"
;
import
{
NzCardModule
}
from
"ng-zorro-antd/card"
;
import
{
Job
}
from
"../../data-access/model/Job.model"
;
import
{
CommonModule
}
from
"@angular/common"
;
@
Component
({
@
Component
({
selector
:
'job-card'
,
selector
:
'job-card'
,
templateUrl
:
'./JobCard.component.html'
,
templateUrl
:
'./JobCard.component.html'
,
imports
:
[
NzCardModule
],
imports
:
[
NzCardModule
,
CommonModule
],
standalone
:
true
,
standalone
:
true
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
})
export
class
JobCardComponent
{
export
class
JobCardComponent
{
@
Input
()
job
?:
Job
;
}
}
src/app/+home/component/JobDetail/JobDetail.component.html
0 → 100644
View file @
6aec78ad
<nz-card
style=
"width:300px;"
nzTitle=
{{job?.title}}
[
nzExtra
]="
extraTemplate
"
>
<p>
{{job?.type}}
</p>
<p>
{{job?.company}}
</p>
<p>
{{job?.location}}
</p>
</nz-card>
<ng-template
#
extraTemplate
>
<a>
More
</a>
</ng-template>
src/app/+home/component/JobDetail/JobDetail.component.ts
0 → 100644
View file @
6aec78ad
import
{
ChangeDetectionStrategy
,
Component
,
Input
}
from
"@angular/core"
;
import
{
NzCardModule
}
from
"ng-zorro-antd/card"
;
import
{
JobModel
}
from
"../../data-access/model/Job.model"
;
@
Component
({
selector
:
'job-detail'
,
templateUrl
:
'./JobDetail.component.html'
,
imports
:
[
NzCardModule
],
standalone
:
true
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
export
class
JobDetailComponent
{
@
Input
()
job
?:
JobModel
}
src/app/+home/component/JobListCard/JobListCard.component.html
View file @
6aec78ad
<nz-divider
nzOrientation=
"left"
nzText=
"Vertical"
></nz-divider>
<!-- <nz-card nzTitle="Jobs List" style="width:100%">
<div
nz-row
[
nzGutter
]="[
16
,
24
]"
ngFor=
"let index of listOfJob"
>
<ng-container *ngIf="listOfJob?.length; else noJobsTemplate">
<job-card></job-card>
<job-card *ngFor="let job of listOfJob" [job]="job"></job-card>
</div>
</ng-container>
<ng-template #noJobsTemplate>
<p>No jobs available</p>
</ng-template>
</nz-card>
<p>{{ listOfJob }}</p> Hiển thị dữ liệu của listOfJob -->
<nz-list
nzGrid
>
<div
nz-row
[
nzGutter
]="
16
"
>
@for (item of listOfJob; track item) {
<div
nz-col
[
nzSpan
]="
6
"
>
<nz-list-item>
<job-card
[
job
]
=
"
item
"
>
Card content
</job-card>
</nz-list-item>
</div>
}
</div>
</nz-list>
src/app/+home/component/JobListCard/JobListCard.component.ts
View file @
6aec78ad
import
{
ChangeDetectionStrategy
,
C
omponen
t
}
from
"@angular/core"
;
import
{
ChangeDetectionStrategy
,
C
hangeDetectorRef
,
Component
,
OnIni
t
}
from
"@angular/core"
;
import
{
JobCardComponent
}
from
"../JobCard/JobCard.component"
;
import
{
JobCardComponent
}
from
"../JobCard/JobCard.component"
;
import
{
NzDividerModule
}
from
"ng-zorro-antd/divider"
;
import
{
NzDividerModule
}
from
"ng-zorro-antd/divider"
;
import
{
NzGridModule
}
from
"ng-zorro-antd/grid"
;
import
{
NzGridModule
}
from
"ng-zorro-antd/grid"
;
import
{
JobModel
}
from
"../../../+admin/data-access/model/jobModel.model"
;
import
{
JobModel
}
from
"../../../+admin/data-access/model/jobModel.model"
;
import
{
JobService
}
from
"../../data-access/service/Job.service"
;
import
{
tap
}
from
"rxjs"
;
import
{
CommonModule
}
from
"@angular/common"
;
import
{
NzListModule
}
from
'ng-zorro-antd/list'
;
import
{
NzCardModule
}
from
"ng-zorro-antd/card"
;
@
Component
({
@
Component
({
selector
:
'app-
job-card
'
,
selector
:
'app-
home-list-job
'
,
templateUrl
:
'./JobListCard.component.html'
,
templateUrl
:
'./JobListCard.component.html'
,
imports
:
[
imports
:
[
CommonModule
,
NzDividerModule
,
NzDividerModule
,
NzGridModule
,
NzGridModule
,
JobCardComponent
,
JobCardComponent
,
NzGridModule
,
NzListModule
,
NzCardModule
],
],
standalone
:
true
,
standalone
:
true
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
,
})
})
export
class
JobListCardComponent
{
export
class
JobListCardComponent
implements
OnInit
{
listOfJob
:
JobModel
[]
=
[];
listOfJob
?:
JobModel
[]
;
constructor
(
private
jobService
:
JobService
,
private
_changeDetectorRef
:
ChangeDetectorRef
,)
{}
ngOnInit
()
{
this
.
jobService
.
jobsGet
().
pipe
(
tap
((
res
)
=>
{
this
.
listOfJob
=
res
.
responseData
?.
rows
as
JobModel
[];
this
.
_changeDetectorRef
.
markForCheck
();
console
.
log
(
this
.
listOfJob
);
}),
).
subscribe
();
}
}
}
src/app/+home/data-access/model/Job.model.ts
0 → 100644
View file @
6aec78ad
export
interface
Job
{
id
:
string
;
type
?:
string
;
created_at
:
string
;
company
?:
string
;
company_url
?:
string
;
location
?:
string
;
title
?:
string
;
description
?:
string
;
how_to_apply
?:
string
;
company_logo
?:
string
;
}
src/app/+home/data-access/service/Job.service.ts
0 → 100644
View file @
6aec78ad
import
{
Injectable
}
from
"@angular/core"
;
import
{
environment
}
from
"../../../../environments/environment.development"
;
import
{
Observable
}
from
"rxjs"
;
import
{
ResponseResult
,
Rows
}
from
"../../../shared/data-access/interface/response.type"
;
import
{
Job
}
from
"../model/Job.model"
;
import
{
HttpClient
}
from
"@angular/common/http"
;
@
Injectable
({
providedIn
:
'root'
,
})
export
class
JobService
{
apiUrl
=
environment
.
API_DOMAIN
+
'/jobs'
;
constructor
(
private
http
:
HttpClient
)
{}
jobsGet
():
Observable
<
ResponseResult
<
Rows
<
Job
>>>
{
return
this
.
http
.
get
<
ResponseResult
<
Rows
<
Job
>>>
(
this
.
apiUrl
);
}
}
src/app/+home/feature/home.component.html
View file @
6aec78ad
<meu-home-header></meu-home-header>
<meu-home-header></meu-home-header>
<app-home-list-job></app-home-list-job>
<meu-home-footer></meu-home-footer>
<meu-home-footer></meu-home-footer>
src/app/+home/feature/home.component.ts
View file @
6aec78ad
...
@@ -9,6 +9,7 @@ import { HeaderComponent } from '../../+shell/ui/components/header/feature/heade
...
@@ -9,6 +9,7 @@ import { HeaderComponent } from '../../+shell/ui/components/header/feature/heade
import
{
FooterComponent
}
from
"../../+shell/ui/components/footer/feature/footer.component"
;
import
{
FooterComponent
}
from
"../../+shell/ui/components/footer/feature/footer.component"
;
import
{
HeaderHomeComponent
}
from
'../layout/feature/Components/header/header.component'
;
import
{
HeaderHomeComponent
}
from
'../layout/feature/Components/header/header.component'
;
import
{
FooterHomeComponent
}
from
'../layout/feature/Components/footer/footer.component'
;
import
{
FooterHomeComponent
}
from
'../layout/feature/Components/footer/footer.component'
;
import
{
JobListCardComponent
}
from
'../component/JobListCard/JobListCard.component'
;
@
Component
({
@
Component
({
...
@@ -22,7 +23,8 @@ import { FooterHomeComponent } from '../layout/feature/Components/footer/footer.
...
@@ -22,7 +23,8 @@ import { FooterHomeComponent } from '../layout/feature/Components/footer/footer.
NzMenuModule
,
NzMenuModule
,
NzIconModule
,
NzIconModule
,
HeaderHomeComponent
,
HeaderHomeComponent
,
FooterHomeComponent
FooterHomeComponent
,
JobListCardComponent
],
],
templateUrl
:
'./home.component.html'
,
templateUrl
:
'./home.component.html'
,
styleUrls
:
[
'./home.component.scss'
],
styleUrls
:
[
'./home.component.scss'
],
...
...
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