Add profil edition component.
This commit is contained in:
@@ -10,29 +10,29 @@
|
|||||||
<div id="form" class="card-body">
|
<div id="form" class="card-body">
|
||||||
<form (ngSubmit)="onSubmit()" #profilEditionForm="ngForm">
|
<form (ngSubmit)="onSubmit()" #profilEditionForm="ngForm">
|
||||||
<div class="md-form">
|
<div class="md-form">
|
||||||
<input mdbActive
|
<input mdbInputDirective
|
||||||
id="name"
|
id="name"
|
||||||
name="name"
|
name="name"
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
[(ngModel)]="model.name"
|
[(ngModel)]="model.name"
|
||||||
#name="ngModel"
|
#name="ngModel"
|
||||||
data-error="Veuillez saisir votre nom d'utilisateur"
|
data-error="Veuillez saisir votre nom d'utilisateur"
|
||||||
data-sucess=""
|
[validateSuccess]="false"
|
||||||
required />
|
required />
|
||||||
<label for="name">Nom d'utilisateur</label>
|
<label for="name">Nom d'utilisateur</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="md-form">
|
<div class="md-form">
|
||||||
<input mdbActive
|
<input mdbInputDirective
|
||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
type="email"
|
type="email"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
[(ngModel)]="model.email"
|
[(ngModel)]="model.email"
|
||||||
#email="ngModel"
|
#email="ngModel"
|
||||||
data-error="Veuillez saisir votre adresse email"
|
data-error="Veuillez saisir votre adresse email"
|
||||||
data-sucess=""
|
[validateSuccess]="false"
|
||||||
required />
|
required />
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
</div>
|
</div>
|
||||||
<div id="errorMsg" class="card red lighten-2 text-center z-depth-2">
|
<div id="errorMsg" class="card red lighten-2 text-center z-depth-2">
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ export class ProfilEditionComponent implements OnInit {
|
|||||||
console.log('File ' + result.body + ' completely uploaded!');
|
console.log('File ' + result.body + ' completely uploaded!');
|
||||||
this.model.image = result.body as string;
|
this.model.image = result.body as string;
|
||||||
this.authService.setAuthenticated(this.model);
|
this.authService.setAuthenticated(this.model);
|
||||||
|
this.setMessage('Image de profil modifiée.', false);
|
||||||
}
|
}
|
||||||
this.selectedFiles = undefined;
|
this.selectedFiles = undefined;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { DisconnectionComponent } from './disconnection/disconnection.component'
|
|||||||
import { MyPostsComponent } from './posts/myPosts/my-posts.component';
|
import { MyPostsComponent } from './posts/myPosts/my-posts.component';
|
||||||
import { AccountSettingsComponent } from './account-settings/account-settings.component';
|
import { AccountSettingsComponent } from './account-settings/account-settings.component';
|
||||||
import { ChangePasswordComponent } from './account-settings/change-password/change-password.component';
|
import { ChangePasswordComponent } from './account-settings/change-password/change-password.component';
|
||||||
|
import { ProfilEditionComponent } from './account-settings/profil-edition/profil-edition.component';
|
||||||
|
|
||||||
export const appRoutes: Routes = [
|
export const appRoutes: Routes = [
|
||||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||||
@@ -18,5 +18,6 @@ export const appRoutes: Routes = [
|
|||||||
{ path: 'myPosts', component: MyPostsComponent, canActivate: [AuthGuard] },
|
{ path: 'myPosts', component: MyPostsComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'accountSettings', component: AccountSettingsComponent, canActivate: [AuthGuard] },
|
{ path: 'accountSettings', component: AccountSettingsComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'changePassword', component: ChangePasswordComponent, canActivate: [AuthGuard] },
|
{ path: 'changePassword', component: ChangePasswordComponent, canActivate: [AuthGuard] },
|
||||||
|
{ path: 'profilEdit', component: ProfilEditionComponent, canActivate: [AuthGuard] },
|
||||||
{ path: '**', redirectTo: '/home' }
|
{ path: '**', redirectTo: '/home' }
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user