Commit d17a153c authored by Gauri Amol Pande's avatar Gauri Amol Pande
Browse files

Merge branch '14-api-integration-for-registration' into 'master'

Resolve "Api Integration for  Registration"

Closes #14

See merge request 92khra1mst/hft_awado_app!7
parents e07d35f0 1bd118df
master 15-find-the-street-name-by-geo-location-data 16-create-search-location-functionality 17-create-toast-message-service 18-design-feedback-page 18-design-feedback-page-2 19-registration-page-validation 20-ride-history 20-ride-history-2 21-reservation-history 22-hire-reserved-bike 24-routing-from-users-current-position-to-the-bike 25-current-bike-reservation-workflow 28-routing-from-bike-location-to-user-s-destination 34-navigation-menu-is-getting-displayed-on-login-page 36-cancel-hired-bike 37-display-username-on-homepage 38-display-calculated-name-of-the-street-on-reservation-and-hire-page 39-validation-on-login-page 4-reserve-a-bike 40-map-performance-improvement-map-angle-doesn-t-change-when-selected-3d 41-display-live-location-of-user-on-map 42-add-log-in-button-on-registration-page-add-extra-messages-for-email-and-password-validation 42-add-log-in-button-on-registration-page-add-extra-messages-for-email-and-password-validation-2 45-show-stepwise-navigation-instructions-on-my-ride-page 46-show-bicycle-route-between-bike-and-user-s-destination 47-show-alternate-routes-for-bike-to-destination 48-create-a-common-service-for-getting-user-s-current-location-and-live-location 49-show-loading-page 50-add-dependencies-locally-to-improve-app-performance 51-while-navigating-between-pages-map-doesn-t-load-properly 52-page-loader-is-getting-displayed-everywhere 53-scrollining-in-ride-history 53-scrollining-in-ride-history-2 55-change-password 56-create-dummy-page-or-menu-for-hotline-contact 57-registration-not-working-from-app 58-add-flow-on-navigate-button-to-route-from-user-to-bike 60-create-common-theming-styles-and-colors 61-chnage-styles-for-bike-list-and-bug-fixes 62-change-in-feedback-workflow 63-password-reset-api-integration 64-close-button-on-home-page-to-redirect-to-bike-list 66-highlight-selected-route-from-list-of-different-routes 67-deactivate-user-api-integration 68-display-no-go-areas-on-map 69-add-launcher-icon-for-application-on-android 70-add-validation-for-feedback-should-not-be-empty 71-prediction-ui-implementation-send-location-of-bike-to-backend 72-feedback-toast-message 73-removal-here-maps-api-key Show-Bike-details-when-bike-icon-is-clicked search_functionality
1 merge request!7Resolve "Api Integration for Registration"
Showing with 28 additions and 6 deletions
+28 -6
......@@ -29,7 +29,7 @@
</ion-item>
</div>
<div id="correctCredentialsmsg" padding *ngIf="correctCredentials">
<div id="correctCredentialsmsg" padding *ngIf="correctCredentials">
Wrong Credentials !
</div>
......
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
import { RestService } from 'src/app/rest.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-register',
......@@ -7,14 +10,33 @@ import { Observable } from 'rxjs';
styleUrls: ['./register.page.scss'],
})
export class RegisterPage implements OnInit {
httpClient: any;
registerApi: Observable<any>;
restService: any;
router: any;
correctCredentials: boolean;
constructor() { }
email: "";
password: "";
lastName: "";
firstName: "";
constructor(private router: Router, public httpClient: HttpClient, public restService: RestService) { }
ngOnInit() {
}
submitRegister() {
this.registerApi = this.httpClient.post('http://193.196.52.237:8081/register', {
"email": this.email,
"password": this.password,
"firstname": this.firstName,
"lastname": this.lastName
});
this.registerApi
.subscribe((data) => {
console.log('my data: ', data);
this.restService.setToken(data.token);
this.router.navigateByUrl('/login');
}, (error) => {
console.log(error);
this.correctCredentials = true;
});
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment