You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Component, OnInit } from '@angular/core';
import {MerchantBlockEntity} from './MerchantBlockEntity';
import {MerchantControlService} from './merchant-control-service';
import {deserialize} from 'json-typescript-mapper';
I am facing this issue:
Here is my entity:
import { JsonProperty } from 'json-typescript-mapper';
Component.Ts:
import { Component, OnInit } from '@angular/core';
import {MerchantBlockEntity} from './MerchantBlockEntity';
import {MerchantControlService} from './merchant-control-service';
import {deserialize} from 'json-typescript-mapper';
@component({
selector: 'my-app',
templateUrl:
./merchantcontrol.html
,styleUrls: ['./app.Component.css']
})
export class AppComponent implements OnInit{
constructor (private merchantControlService: MerchantControlService) {}
name = 'Angular';
users : Users[];
errorMessage: string;
blockedMerchants : MerchantBlockEntity;
filteredBlockedMerchant : MerchantBlockEntity;
jsonData:any;
ngOnInit():void {
this.users = accountUsers;
this.merchantControlService.getBlockedMerchants()
.subscribe(
blockedMerchants => this.jsonData = blockedMerchants,
error => this.errorMessage = error);;
this.blockedMerchants = deserialize(MerchantBlockEntity,this.jsonData);
this.filteredBlockedMerchant = this.blockedMerchants;
console.log('block merchant is',this.blockedMerchants);
console.log('Error message is ', this.errorMessage);
};
selectedUserChange(selectedUser:Users) :void
{
if(selectedUser.name != 'All')
{
this.filteredBlockedMerchant =new MerchantBlockEntity;
this.filteredBlockedMerchant.creditCardsList = this.blockedMerchants.creditCardsList.filter(
book => book.cardReferenceId === selectedUser.cardRefId);
}
else
{
this.filteredBlockedMerchant = this.blockedMerchants;
}
}
}
export class Users
{
name: string;
cardRefId:string;
}
const accountUsers: Users[] = [
{ name: 'All' , cardRefId: ''},
{ name: 'Mr. Nice' , cardRefId: 'hfffhghgg'},
{ name: 'Mr. Tony' , cardRefId: 'iyuyuyy'},
{ name: 'Mr. Watson' , cardRefId: 'bhghgj'},
];
The text was updated successfully, but these errors were encountered: