Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2021-210
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-210
2021-210
Commits
5fe2d444
Commit
5fe2d444
authored
Nov 25, 2021
by
salukbawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create add pet page module
parent
0850204a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
171 additions
and
0 deletions
+171
-0
ClientApp/src/app/add-pet/add-pet-routing.module.ts
ClientApp/src/app/add-pet/add-pet-routing.module.ts
+17
-0
ClientApp/src/app/add-pet/add-pet.module.ts
ClientApp/src/app/add-pet/add-pet.module.ts
+20
-0
ClientApp/src/app/add-pet/add-pet.page.html
ClientApp/src/app/add-pet/add-pet.page.html
+61
-0
ClientApp/src/app/add-pet/add-pet.page.scss
ClientApp/src/app/add-pet/add-pet.page.scss
+0
-0
ClientApp/src/app/add-pet/add-pet.page.spec.ts
ClientApp/src/app/add-pet/add-pet.page.spec.ts
+24
-0
ClientApp/src/app/add-pet/add-pet.page.ts
ClientApp/src/app/add-pet/add-pet.page.ts
+49
-0
No files found.
ClientApp/src/app/add-pet/add-pet-routing.module.ts
0 → 100644
View file @
5fe2d444
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
Routes
,
RouterModule
}
from
'
@angular/router
'
;
import
{
AddPetPage
}
from
'
./add-pet.page
'
;
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
AddPetPage
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
routes
)],
exports
:
[
RouterModule
],
})
export
class
AddPetPageRoutingModule
{}
ClientApp/src/app/add-pet/add-pet.module.ts
0 → 100644
View file @
5fe2d444
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
FormsModule
}
from
'
@angular/forms
'
;
import
{
IonicModule
}
from
'
@ionic/angular
'
;
import
{
AddPetPageRoutingModule
}
from
'
./add-pet-routing.module
'
;
import
{
AddPetPage
}
from
'
./add-pet.page
'
;
@
NgModule
({
imports
:
[
CommonModule
,
FormsModule
,
IonicModule
,
AddPetPageRoutingModule
],
declarations
:
[
AddPetPage
]
})
export
class
AddPetPageModule
{}
ClientApp/src/app/add-pet/add-pet.page.html
0 → 100644
View file @
5fe2d444
<ion-header>
<ion-toolbar>
<ion-buttons
slot=
"start"
>
<ion-back-button></ion-back-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<div
class=
"container-fluid"
style=
"background-color: #E9F0FB"
>
<div
class=
"row ion-justify-content-center ion-align-items-center"
style=
"height: 100vh"
>
<div
class=
"col-11"
>
<div
class=
"row ion-justify-content-center"
>
<div
class=
"col"
>
<h1
class=
"fw-bolder"
>
Add new pet
</h1>
</div>
</div>
<div
class=
"row mt-4"
>
<div
class=
"col"
>
<div
class=
"form-floating mb-2 shadow-lg"
>
<input
type=
"text"
class=
"form-control"
id=
"floatingInput"
placeholder=
"Max"
[(ngModel)]=
"name"
>
<label
for=
"floatingInput"
>
Pet's name
</label>
</div>
<div
class=
"form-floating mb-2 shadow-lg"
>
<input
type=
"text"
class=
"form-control"
id=
"floatingInput2"
placeholder=
"Max"
[(ngModel)]=
"breed"
>
<label
for=
"floatingInput2"
>
Pet's breed
</label>
</div>
<div
class=
"form-floating mb-2 shadow-lg"
>
<input
type=
"text"
class=
"form-control"
id=
"floatingPassword"
placeholder=
"2"
[(ngModel)]=
"age"
>
<label
for=
"floatingPassword"
>
Pet's age (years)
</label>
</div>
<div
class=
"form-floating mb-2 shadow-lg"
>
<input
type=
"text"
class=
"form-control"
id=
"months"
placeholder=
"2"
[(ngModel)]=
"ageMonths"
>
<label
for=
"months"
>
Pet's age (months)
</label>
</div>
<div
class=
"form-floating mb-2 shadow-lg"
>
<input
type=
"text"
class=
"form-control"
id=
"floatingPasswordConfirm"
placeholder=
"12"
[(ngModel)]=
"weight"
>
<label
for=
"floatingPasswordConfirm"
>
Pet's weight (kg)
</label>
</div>
<div
class=
"form-floating mb-2 shadow-lg"
>
<select
class=
"form-select"
aria-label=
"Default select example"
[(ngModel)]=
"gender"
>
<option
selected
>
Select Gender
</option>
<option
value=
"0"
>
Male
</option>
<option
value=
"1"
>
Female
</option>
</select>
</div>
<!-- <div class="mb-3">-->
<!-- <input class="form-control" type="file" id="formFile">-->
<!-- </div>-->
<div
class=
"d-grid gap-2 mt-2"
>
<button
class=
"btn btn-lg btn-secondary"
type=
"button"
style=
"background-color: #5b628f"
(click)=
"submit()"
>
Submit
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</ion-content>
ClientApp/src/app/add-pet/add-pet.page.scss
0 → 100644
View file @
5fe2d444
ClientApp/src/app/add-pet/add-pet.page.spec.ts
0 → 100644
View file @
5fe2d444
import
{
ComponentFixture
,
TestBed
,
waitForAsync
}
from
'
@angular/core/testing
'
;
import
{
IonicModule
}
from
'
@ionic/angular
'
;
import
{
AddPetPage
}
from
'
./add-pet.page
'
;
describe
(
'
AddPetPage
'
,
()
=>
{
let
component
:
AddPetPage
;
let
fixture
:
ComponentFixture
<
AddPetPage
>
;
beforeEach
(
waitForAsync
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
AddPetPage
],
imports
:
[
IonicModule
.
forRoot
()]
}).
compileComponents
();
fixture
=
TestBed
.
createComponent
(
AddPetPage
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
}));
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
ClientApp/src/app/add-pet/add-pet.page.ts
0 → 100644
View file @
5fe2d444
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
PythonBackendService
}
from
'
../core/python-backend.service
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
SpringBackendServiceService
}
from
"
../spring-backend-service.service
"
;
@
Component
({
selector
:
'
app-add-pet
'
,
templateUrl
:
'
./add-pet.page.html
'
,
styleUrls
:
[
'
./add-pet.page.scss
'
],
})
export
class
AddPetPage
implements
OnInit
{
name
:
string
;
breed
:
string
;
age
=
0
;
ageMonths
=
0
;
weight
=
1
;
gender
=
1
;
private
errorMessage
:
string
;
constructor
(
private
pythonBackendService
:
PythonBackendService
,
private
router
:
Router
,
private
springBackendServiceService
:
SpringBackendServiceService
)
{
}
ngOnInit
()
{
}
submit
()
{
if
(
this
.
name
&&
this
.
weight
)
{
this
.
springBackendServiceService
.
newDog
({
ageMonths
:
this
.
ageMonths
,
ageYears
:
this
.
age
,
breed
:
this
.
breed
,
gender
:
this
.
gender
,
id
:
null
,
imageUrl
:
''
,
name
:
this
.
name
,
weight
:
this
.
weight
})
.
subscribe
(
res
=>
{
console
.
log
(
res
);
this
.
router
.
navigate
([
'
/home
'
]);
},
error
=>
{
console
.
log
(
error
);
});
}
}
}
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