Skip to content

Commit

Permalink
Update user-edit.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Oktawian-L committed Nov 3, 2019
1 parent c45906e commit 58e7b99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Subiton/src/app/users/user-edit/user-edit.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild } from '@angular/core';
import { User } from 'src/app/_models/user';
import { ActivatedRoute } from '@angular/router';
import { NgxGalleryImage, NgxGalleryOptions, NgxGalleryAnimation } from 'ngx-gallery';
import { AlertifyService } from 'src/app/_services/alertify.service';
import { NgForm } from '@angular/forms';

@Component({
selector: 'app-user-edit',
Expand All @@ -12,9 +13,12 @@ import { AlertifyService } from 'src/app/_services/alertify.service';
export class UserEditComponent implements OnInit {

user: User;

galleryOptions: NgxGalleryOptions[];
galleryImages: NgxGalleryImage[];

@ViewChild('editForm') editForm: NgForm;

constructor(private route: ActivatedRoute,
private alertify: AlertifyService) { }

Expand Down Expand Up @@ -80,5 +84,6 @@ export class UserEditComponent implements OnInit {
// save chnages - edit profile
updateUser() {
this.alertify.success('Succesfully saved changes.');
this.editForm.reset(this.user);
}
}

0 comments on commit 58e7b99

Please sign in to comment.