Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
angular-component-paths-exercise
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
Shaphen Pangburn
angular-component-paths-exercise
Commits
f96df123
Commit
f96df123
authored
Apr 21, 2021
by
Shaphen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wildcard path and PageNotFound Component
parent
4b799357
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
6 deletions
+74
-6
app-routing.module.ts
src/app/app-routing.module.ts
+3
-1
app.module.ts
src/app/app.module.ts
+4
-2
contact-us.component.css
src/app/contact-us/contact-us.component.css
+12
-1
contact-us.component.html
src/app/contact-us/contact-us.component.html
+1
-1
contact-us.component.ts
src/app/contact-us/contact-us.component.ts
+0
-1
page-not-found.component.css
src/app/page-not-found/page-not-found.component.css
+10
-0
page-not-found.component.html
src/app/page-not-found/page-not-found.component.html
+5
-0
page-not-found.component.spec.ts
src/app/page-not-found/page-not-found.component.spec.ts
+28
-0
page-not-found.component.ts
src/app/page-not-found/page-not-found.component.ts
+11
-0
No files found.
src/app/app-routing.module.ts
View file @
f96df123
...
@@ -6,6 +6,7 @@ import { GreeceComponent } from './greece/greece.component';
...
@@ -6,6 +6,7 @@ import { GreeceComponent } from './greece/greece.component';
import
{
SpainComponent
}
from
'./spain/spain.component'
;
import
{
SpainComponent
}
from
'./spain/spain.component'
;
import
{
AccountComponent
}
from
'./account/account.component'
;
import
{
AccountComponent
}
from
'./account/account.component'
;
import
{
ContactUsComponent
}
from
'./contact-us/contact-us.component'
;
import
{
ContactUsComponent
}
from
'./contact-us/contact-us.component'
;
import
{
PageNotFoundComponent
}
from
'./page-not-found/page-not-found.component'
;
const
routes
:
Routes
=
[
const
routes
:
Routes
=
[
{
path
:
'england'
,
component
:
EnglandComponent
},
{
path
:
'england'
,
component
:
EnglandComponent
},
...
@@ -13,7 +14,8 @@ const routes: Routes = [
...
@@ -13,7 +14,8 @@ const routes: Routes = [
{
path
:
'greece'
,
component
:
GreeceComponent
},
{
path
:
'greece'
,
component
:
GreeceComponent
},
{
path
:
'spain'
,
component
:
SpainComponent
},
{
path
:
'spain'
,
component
:
SpainComponent
},
{
path
:
'account'
,
component
:
AccountComponent
},
{
path
:
'account'
,
component
:
AccountComponent
},
{
path
:
'contact-us'
,
component
:
ContactUsComponent
}
{
path
:
'contact-us'
,
component
:
ContactUsComponent
},
{
path
:
'**'
,
component
:
PageNotFoundComponent
},
];
];
@
NgModule
({
@
NgModule
({
...
...
src/app/app.module.ts
View file @
f96df123
...
@@ -14,10 +14,11 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
...
@@ -14,10 +14,11 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import
{
IvyCarouselModule
}
from
'angular-responsive-carousel'
;
import
{
IvyCarouselModule
}
from
'angular-responsive-carousel'
;
import
{
AccountComponent
}
from
'./account/account.component'
;
import
{
AccountComponent
}
from
'./account/account.component'
;
import
{
ContactUsComponent
}
from
'./contact-us/contact-us.component'
;
import
{
ContactUsComponent
}
from
'./contact-us/contact-us.component'
;
import
{
PageNotFoundComponent
}
from
'./page-not-found/page-not-found.component'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
AppComponent
,
AppComponent
,
HeaderComponent
,
HeaderComponent
,
FooterComponent
,
FooterComponent
,
...
@@ -26,7 +27,8 @@ import { ContactUsComponent } from './contact-us/contact-us.component';
...
@@ -26,7 +27,8 @@ import { ContactUsComponent } from './contact-us/contact-us.component';
GreeceComponent
,
GreeceComponent
,
SpainComponent
,
SpainComponent
,
AccountComponent
,
AccountComponent
,
ContactUsComponent
ContactUsComponent
,
PageNotFoundComponent
],
],
imports
:
[
imports
:
[
BrowserModule
,
BrowserModule
,
...
...
src/app/contact-us/contact-us.component.css
View file @
f96df123
...
@@ -17,6 +17,11 @@
...
@@ -17,6 +17,11 @@
padding
:
5px
;
padding
:
5px
;
outline
:
none
;
outline
:
none
;
margin-top
:
10px
;
margin-top
:
10px
;
transition
:
all
0.1s
;
}
.message-form-input
:focus
{
border
:
2px
solid
#6fb7f1
;
}
}
.textarea
{
.textarea
{
...
@@ -28,6 +33,11 @@
...
@@ -28,6 +33,11 @@
border-radius
:
5px
;
border-radius
:
5px
;
padding
:
10px
274px
;
padding
:
10px
274px
;
margin-top
:
5px
;
margin-top
:
5px
;
transition
:
all
0.2s
;
}
.submit-button
:hover
{
transform
:
scale
(
1.03
);
}
}
.ng-invalid.ng-touched
:not
(
form
)
{
.ng-invalid.ng-touched
:not
(
form
)
{
...
@@ -37,4 +47,5 @@
...
@@ -37,4 +47,5 @@
.contact-error-message
{
.contact-error-message
{
margin
:
0px
2px
0px
;
margin
:
0px
2px
0px
;
color
:
red
;
color
:
red
;
}
text-align
:
left
;
\ No newline at end of file
}
src/app/contact-us/contact-us.component.html
View file @
f96df123
<div
class=
"contact-us-container"
>
<div
class=
"contact-us-container"
>
<form
[
formGroup
]="
contactForm
"
(
ngSubmit
)="
onSubmit
()"
>
<form
class=
"message-form"
[
formGroup
]="
contactForm
"
(
ngSubmit
)="
onSubmit
()"
>
<h1>
Contact Us
</h1>
<h1>
Contact Us
</h1>
<div
class=
"message-input-container"
>
<div
class=
"message-input-container"
>
<div>
<div>
...
...
src/app/contact-us/contact-us.component.ts
View file @
f96df123
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormBuilder
,
Validators
}
from
'@angular/forms'
;
import
{
FormBuilder
,
Validators
}
from
'@angular/forms'
;
import
{
NgForm
}
from
'@angular/forms'
;
@
Component
({
@
Component
({
selector
:
'app-contact-us'
,
selector
:
'app-contact-us'
,
...
...
src/app/page-not-found/page-not-found.component.css
0 → 100644
View file @
f96df123
.page-not-exist-container
{
width
:
100%
;
margin-top
:
50px
;
}
.page-not-exist-text
{
text-align
:
center
;
margin
:
3px
;
width
:
100%
;
}
\ No newline at end of file
src/app/page-not-found/page-not-found.component.html
0 → 100644
View file @
f96df123
<div
class=
"page-not-exist-container"
>
<h3
class=
"page-not-exist-text"
>
Sorry...
</h3>
<p
class=
"page-not-exist-text"
>
This page doesn't exist
</p>
<p
class=
"page-not-exist-text"
>
go somewhere else
</p>
</div>
\ No newline at end of file
src/app/page-not-found/page-not-found.component.spec.ts
0 → 100644
View file @
f96df123
/* tslint:disable:no-unused-variable */
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
By
}
from
'@angular/platform-browser'
;
import
{
DebugElement
}
from
'@angular/core'
;
import
{
PageNotFoundComponent
}
from
'./page-not-found.component'
;
describe
(
'PageNotFoundComponent'
,
()
=>
{
let
component
:
PageNotFoundComponent
;
let
fixture
:
ComponentFixture
<
PageNotFoundComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
PageNotFoundComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
PageNotFoundComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/page-not-found/page-not-found.component.ts
0 → 100644
View file @
f96df123
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-page-not-found'
,
templateUrl
:
'./page-not-found.component.html'
,
styleUrls
:
[
'./page-not-found.component.css'
]
})
export
class
PageNotFoundComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
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