1
결제 게이트웨이에서 양식을 제출해야합니다. 우리 백엔드 녀석은 innerHtml
을 넣고 렌더링 한 후 보내라고합니다. 나는 크롬에서 작동하도록했지만 파이어 폭스에서는 실패했다. 이제는 테스트 환경에서이 문제를 해결하기 위해 노력하고 있습니다. 백엔드에서 JSON을 반환하여 양식을 복제해야 모든 양식을 복제하여 양식을 만들 수 있습니다. 하지만 여전히 파이어 폭스에 제출하지 못했습니다.angular2 typescript에서 양식 제출
누군가 같은 경험을 했습니까? 빛 좀 비켜주세요.
내가 알아야 할 파이어 폭스 관련 수정 사항이 있습니까? 다음은
당신은 페이지 새로 고침으로 리디렉션을 피하기 위해 submit()
방법을 사용해서는 안 크롬 및 사파리
import { Component, OnInit, AfterViewInit, ViewChild, ElementRef,DoCheck, ViewChildren, QueryList } from '@angular/core';
import { BrowserModule, DomSanitizer, SafeResourceUrl, SafeUrl} from '@angular/platform-browser';
import { PaymentService } from '../../_services/payment.service';
import { Loader } from '../../_services/loader.service';
@Component({
selector: 'bdf-payment-form',
templateUrl: './payment-form.component.html',
styleUrls: ['./payment-form.component.scss']
})
export class PaymentFormComponent implements OnInit,DoCheck, AfterViewInit {
form : SafeResourceUrl;
// @ViewChild('paymentFormContainer') container: ElementRef;
@ViewChild('paymentForm') myForm: ElementRef;
loader;
constructor(private paymentService:PaymentService,
private sanitizer: DomSanitizer,
private loaderService: Loader,
private elRef:ElementRef) { }
ngDoCheck(){
}
ngOnInit() {
console.log(this.paymentService.paymentForm);
this.paymentService.paymentForm ? this.form = this.sanitizer.bypassSecurityTrustHtml(this.paymentService.paymentForm) : null
this.loader = true;
}
ngAfterViewInit() {
let test;
if(this.form){
test = this.elRef.nativeElement.querySelector('form')
console.log(test)
test.submit();
}
}
}
그러나이 작업을 수행 할 수 있습니다. 백엔드 녀석은 브라우저가 URL을 통과해야하기 때문에 html 형식으로 보내야한다고 말했습니다. 브라우저가 필드와 값이있는 URL을 방문 할 때. OTP (one time password) 페이지로 이동 한 다음 콜백이 트리거되고 확인 페이지로 다시 리디렉션됩니다. 더 좋은 방법이 있나요? @Roman에게 답장을 보내 주셔서 감사합니다. – Don