import {Component} from "@angular/core"; import {WpAjaxPost} from "../sharedmodules/wp-elements/Services/WpAjaxPost"; import {ToastService} from "../sharedmodules/wp-elements/Services/ToastService"; import {WpJsonApi} from "../sharedmodules/wp-elements/Services/WpJsonApi"; @Component({ selector:'app-root', template:`
Save
` }) export class SettingsComponent{ public Options:Settings=rnparams.settings; public Loading:boolean=false; public OriginalInvoiceNumber; constructor(private ajax:WpJsonApi, private toast:ToastService){ } async SaveOptions() { this.Loading=true; let result=await this.ajax.Post('settings/save',{settings:this.Options,originalInvoiceNumber:rnparams.originalInvoiceNumber}); this.Loading=false; if(result==null) return; this.toast.SendSuccess("Information saved successfully"); } } declare let rnparams:any;