Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
single-page-application
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
Christopher Cottier
single-page-application
Commits
7111c554
Commit
7111c554
authored
Apr 21, 2021
by
ccottier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added 404 not found to routing page for invalid URLs
parent
ff56f46f
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
49 additions
and
12 deletions
+49
-12
app-routing.module.ts
src/app/app-routing.module.ts
+3
-1
app.module.ts
src/app/app.module.ts
+3
-1
contact-us.component.html
src/app/contact-us/contact-us.component.html
+1
-3
england.component.html
src/app/england/england.component.html
+0
-1
france.component.html
src/app/france/france.component.html
+0
-2
greece.component.html
src/app/greece/greece.component.html
+0
-2
not-found.component.css
src/app/not-found/not-found.component.css
+0
-0
not-found.component.html
src/app/not-found/not-found.component.html
+2
-0
not-found.component.spec.ts
src/app/not-found/not-found.component.spec.ts
+25
-0
not-found.component.ts
src/app/not-found/not-found.component.ts
+15
-0
spain.component.html
src/app/spain/spain.component.html
+0
-2
No files found.
src/app/app-routing.module.ts
View file @
7111c554
import
{
NotFoundComponent
}
from
'./not-found/not-found.component'
;
import
{
SpainComponent
}
from
'./spain/spain.component'
;
import
{
GreeceComponent
}
from
'./greece/greece.component'
;
import
{
AccountComponent
}
from
'./account/account.component'
;
...
...
@@ -15,7 +16,8 @@ const routes: Routes = [
{
path
:
'account'
,
component
:
AccountComponent
},
{
path
:
'greece'
,
component
:
GreeceComponent
},
{
path
:
'spain'
,
component
:
SpainComponent
},
{
path
:
'contact-us'
,
component
:
ContactUsComponent
}
{
path
:
'contact-us'
,
component
:
ContactUsComponent
},
{
path
:
'**'
,
component
:
NotFoundComponent
}
];
@
NgModule
({
...
...
src/app/app.module.ts
View file @
7111c554
...
...
@@ -14,6 +14,7 @@ import { AccountComponent } from './account/account.component';
import
{
FormsModule
}
from
'@angular/forms'
;
import
{
ReactiveFormsModule
}
from
'@angular/forms'
;
import
{
ContactUsComponent
}
from
'./contact-us/contact-us.component'
;
import
{
NotFoundComponent
}
from
'./not-found/not-found.component'
;
@
NgModule
({
declarations
:
[
...
...
@@ -25,7 +26,8 @@ import { ContactUsComponent } from './contact-us/contact-us.component';
GreeceComponent
,
SpainComponent
,
AccountComponent
,
ContactUsComponent
ContactUsComponent
,
NotFoundComponent
],
imports
:
[
BrowserModule
,
...
...
src/app/contact-us/contact-us.component.html
View file @
7111c554
<p>
contact-us works!
</p>
<div>
<div
style=
"display:inline-block"
>
<form
[
formGroup
]="
userForm
"
(
ngSubmit
)="
onSubmit
()"
>
<div>
<p>
reactive
</p>
<p>
Contact Us Form
</p>
<div>
<input
type=
"text"
formControlName=
"firstName"
class=
"form-control input"
placeholder=
"First name"
>
</div>
...
...
src/app/england/england.component.html
View file @
7111c554
<p>
england works!
</p>
<div
class=
'imgContainer'
>
<img
class=
'img'
src=
'/assets/images/england/england-bridge.jpg'
/>
...
...
src/app/france/france.component.html
View file @
7111c554
<p>
france works!
</p>
<div
>
<div
class=
"row"
style=
"padding: 20px;"
>
<div
class=
"col-sm-10"
>
...
...
src/app/greece/greece.component.html
View file @
7111c554
<p>
greece works!
</p>
<div
class=
'imgContainer'
>
<img
class=
'img'
src=
'/assets/images/greece/greece-beach.jpg'
/>
<img
class=
'img'
src=
'/assets/images/greece/greece-steps.jpg'
/>
...
...
src/app/not-found/not-found.component.css
0 → 100644
View file @
7111c554
src/app/not-found/not-found.component.html
0 → 100644
View file @
7111c554
<h1>
404 NOT FOUND
</h1>
<h2>
URL is invalid.
</h2>
\ No newline at end of file
src/app/not-found/not-found.component.spec.ts
0 → 100644
View file @
7111c554
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
NotFoundComponent
}
from
'./not-found.component'
;
describe
(
'NotFoundComponent'
,
()
=>
{
let
component
:
NotFoundComponent
;
let
fixture
:
ComponentFixture
<
NotFoundComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
NotFoundComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
NotFoundComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/not-found/not-found.component.ts
0 → 100644
View file @
7111c554
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-not-found'
,
templateUrl
:
'./not-found.component.html'
,
styleUrls
:
[
'./not-found.component.css'
]
})
export
class
NotFoundComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
src/app/spain/spain.component.html
View file @
7111c554
<p>
spain works!
</p>
<div
class=
'imgContainer'
>
<img
class=
'img'
src=
'/assets/images/spain/spain-barcelona.jpg'
/>
<img
class=
'img'
src=
'/assets/images/spain/spain-cathedral.jpg'
/>
...
...
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