Argument of type 'Params' is not assignable to parameter of type 'string'
up vote
-1
down vote
favorite
I have passed data via snapshot and am now trying to receive it but am getting the following error
"[ts] Argument of type 'Params' is not assignable to parameter of type
'string'."
When I sent the data I done a JSON.stringify and the data looked like this.
[
{
"caseData": "{"getAllInfo":{"ticket":{"internalNum":"2500024035","comp":"29","reportedDate":"2018-07-20","reportedTime":"00:00","forceNumCharge":"7035551","offenceSequence":"1","aggrievedParty":"1"}}}"
}
]
Now when I try to retrieve the data and do a JSON.parse I get the error mentioned above.
this.caseData = JSON.parse(this.activatedRoute.snapshot.params);
angular typescript
add a comment |
up vote
-1
down vote
favorite
I have passed data via snapshot and am now trying to receive it but am getting the following error
"[ts] Argument of type 'Params' is not assignable to parameter of type
'string'."
When I sent the data I done a JSON.stringify and the data looked like this.
[
{
"caseData": "{"getAllInfo":{"ticket":{"internalNum":"2500024035","comp":"29","reportedDate":"2018-07-20","reportedTime":"00:00","forceNumCharge":"7035551","offenceSequence":"1","aggrievedParty":"1"}}}"
}
]
Now when I try to retrieve the data and do a JSON.parse I get the error mentioned above.
this.caseData = JSON.parse(this.activatedRoute.snapshot.params);
angular typescript
What type isthis.caseData?
– ShamPooSham
yesterday
it iscaseData: any;
– skydev
yesterday
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have passed data via snapshot and am now trying to receive it but am getting the following error
"[ts] Argument of type 'Params' is not assignable to parameter of type
'string'."
When I sent the data I done a JSON.stringify and the data looked like this.
[
{
"caseData": "{"getAllInfo":{"ticket":{"internalNum":"2500024035","comp":"29","reportedDate":"2018-07-20","reportedTime":"00:00","forceNumCharge":"7035551","offenceSequence":"1","aggrievedParty":"1"}}}"
}
]
Now when I try to retrieve the data and do a JSON.parse I get the error mentioned above.
this.caseData = JSON.parse(this.activatedRoute.snapshot.params);
angular typescript
I have passed data via snapshot and am now trying to receive it but am getting the following error
"[ts] Argument of type 'Params' is not assignable to parameter of type
'string'."
When I sent the data I done a JSON.stringify and the data looked like this.
[
{
"caseData": "{"getAllInfo":{"ticket":{"internalNum":"2500024035","comp":"29","reportedDate":"2018-07-20","reportedTime":"00:00","forceNumCharge":"7035551","offenceSequence":"1","aggrievedParty":"1"}}}"
}
]
Now when I try to retrieve the data and do a JSON.parse I get the error mentioned above.
this.caseData = JSON.parse(this.activatedRoute.snapshot.params);
angular typescript
angular typescript
edited yesterday
Amit Chigadani
7,71852147
7,71852147
asked yesterday
skydev
166112
166112
What type isthis.caseData?
– ShamPooSham
yesterday
it iscaseData: any;
– skydev
yesterday
add a comment |
What type isthis.caseData?
– ShamPooSham
yesterday
it iscaseData: any;
– skydev
yesterday
What type is
this.caseData?– ShamPooSham
yesterday
What type is
this.caseData?– ShamPooSham
yesterday
it is
caseData: any;– skydev
yesterday
it is
caseData: any;– skydev
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
I may be wrong, but try with this.activatedRoute.snapshot.params['caseData']. In this case, you should probably put a debugger or a console.log(this.activatedRoute.snapshot.params) if you're doubting the way it's returned.
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I may be wrong, but try with this.activatedRoute.snapshot.params['caseData']. In this case, you should probably put a debugger or a console.log(this.activatedRoute.snapshot.params) if you're doubting the way it's returned.
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
add a comment |
up vote
2
down vote
accepted
I may be wrong, but try with this.activatedRoute.snapshot.params['caseData']. In this case, you should probably put a debugger or a console.log(this.activatedRoute.snapshot.params) if you're doubting the way it's returned.
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I may be wrong, but try with this.activatedRoute.snapshot.params['caseData']. In this case, you should probably put a debugger or a console.log(this.activatedRoute.snapshot.params) if you're doubting the way it's returned.
I may be wrong, but try with this.activatedRoute.snapshot.params['caseData']. In this case, you should probably put a debugger or a console.log(this.activatedRoute.snapshot.params) if you're doubting the way it's returned.
answered yesterday
RoadEx
257110
257110
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
add a comment |
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203397%2fargument-of-type-params-is-not-assignable-to-parameter-of-type-string%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What type is
this.caseData?– ShamPooSham
yesterday
it is
caseData: any;– skydev
yesterday