Skip to content

Commit

Permalink
alertify save data
Browse files Browse the repository at this point in the history
  • Loading branch information
Oktawian-L committed Nov 3, 2019
1 parent 052dfe7 commit 6af6a47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Subiton/src/app/users/user-edit/user-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ <h1>
</div>
<div class="card-footer">
<div class="btn-group d-flex">
<button class="btn btn-success w-100"><i class="fa fa-save"></i> Save</button>
<button [disabled]="!editForm.dirty" form="editForm" class="btn btn-success w-100"><i class="fa fa-save"></i> Save</button>
<button class="btn btn-warning w-100"><i class="fa fa-warning"></i> Cancel</button>
</div>
</div>
</div>
</div>
<div class="col-sm-8">
<form #editForm="ngForm">
<form #editForm="ngForm" (ngSubmit)="updateUser()")>
<div class="tab-panel">
<tabset class="user-tabset">
<tab heading="Edit information" id="profile_tab1">
Expand Down
9 changes: 8 additions & 1 deletion Subiton/src/app/users/user-edit/user-edit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit } 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';

@Component({
selector: 'app-user-edit',
Expand All @@ -14,7 +15,8 @@ export class UserEditComponent implements OnInit {
galleryOptions: NgxGalleryOptions[];
galleryImages: NgxGalleryImage[];

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

ngOnInit(): void {

Expand Down Expand Up @@ -74,4 +76,9 @@ export class UserEditComponent implements OnInit {
}
return imageUrls;
}

// save chnages - edit profile
updateUser() {
this.alertify.success('Succesfully saved changes.');
}
}

0 comments on commit 6af6a47

Please sign in to comment.