1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-08 03:23:50 +00:00

api actions on add/edit

This commit is contained in:
Kyle Spearrin
2018-01-31 12:52:12 -05:00
parent 619d3fd075
commit 1c41dfa196
12 changed files with 324 additions and 290 deletions

View File

@@ -8,21 +8,21 @@ import {
import { ValidationService } from '../services/validation.service';
@Directive({
selector: '[appApiForm]',
selector: '[appApiAction]',
})
export class ApiFormDirective implements OnChanges {
@Input() appApiForm: Promise<any>;
export class ApiActionDirective implements OnChanges {
@Input() appApiAction: Promise<any>;
constructor(private el: ElementRef, private validationService: ValidationService) { }
ngOnChanges(changes: any) {
if (this.appApiForm == null || this.appApiForm.then == null) {
if (this.appApiAction == null || this.appApiAction.then == null) {
return;
}
this.el.nativeElement.loading = true;
this.appApiForm.then((response: any) => {
this.appApiAction.then((response: any) => {
this.el.nativeElement.loading = false;
}, (e: any) => {
this.el.nativeElement.loading = false;