zgo/src/app/pmtservice/pmtservice.component.ts

37 lines
913 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from "@angular/router";
import { PmtData } from "./pmtservice.model"
@Component({
selector: 'app-pmtservice',
templateUrl: './pmtservice.component.html',
styleUrls: ['./pmtservice.component.css']
})
export class PmtserviceComponent implements OnInit {
public pmtData : PmtData = {
ownerId :'',
invoice: '',
amount: 0,
currency: '',
shortcode: ''
};
constructor(private activatedRoute: ActivatedRoute) {}
ngOnInit() {
this.activatedRoute.queryParams.subscribe((params) => {
this.pmtData.ownerId = params["ownerid"];
this.pmtData.invoice = params["invoice"];
this.pmtData.amount = params["amount"];
this.pmtData.currency = params["currency"];
this.pmtData.shortcode = params["shortcode"];
console.log(this.pmtData);
});
}
}