0
我是網絡開發新手也許我想解決的問題是一個非常基本的問題,但我已經搜索了很多解決方案無法找到一個。 我有兩個網頁one
和two
在角度閱讀文章數據2
下面是one.html
<form id="requestForm" #requestForm ngNoForm action="{{requestUrl}}" method="POST">
<div *ngIf="requestmodel">
<button class="btn-flat waves-effect waves-light transparent regNrmS2BN" type="submit" id="submitForm" style="color: transparent; background-color: transparent;">Pay</button>
<input type="hidden" name="name" [ngModel]="requestmodel.name" />
</div>
</form>
這上面的表格就會自動發佈到下一個網頁two.html
以下是這是寫在ComponentOne
ngOnInit(): void {
this.requestmodel = this.requestService.getRequest();
this.requestUrl = 'http://localhost:3000/two';
this.submitMe();
}
submitMe() {
let me = this;
if ($('#submitForm') && $('#submitForm')[0])
$('#submitForm')[0].click();
else
setTimeout(function() { me.submitMe(); }, 100);
}
的問題是我怎麼在ComponentTwo
讀取表格數據和要求是我不應該t使用Service
,否則根本沒有任何問題。 那麼,如何在沒有服務級別的情況下完成此任務?