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);









share|improve this question
























  • What type is this.caseData?
    – ShamPooSham
    yesterday










  • it is caseData: any;
    – skydev
    yesterday

















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);









share|improve this question
























  • What type is this.caseData?
    – ShamPooSham
    yesterday










  • it is caseData: any;
    – skydev
    yesterday















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);









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Amit Chigadani

7,71852147




7,71852147










asked yesterday









skydev

166112




166112












  • What type is this.caseData?
    – ShamPooSham
    yesterday










  • it is caseData: any;
    – skydev
    yesterday




















  • What type is this.caseData?
    – ShamPooSham
    yesterday










  • it is caseData: 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














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.






share|improve this answer





















  • Yes this seems to giver back a cleaner data set and I can now filter through it
    – skydev
    yesterday











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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
































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.






share|improve this answer





















  • Yes this seems to giver back a cleaner data set and I can now filter through it
    – skydev
    yesterday















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.






share|improve this answer





















  • Yes this seems to giver back a cleaner data set and I can now filter through it
    – skydev
    yesterday













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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









RoadEx

257110




257110












  • 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




Yes this seems to giver back a cleaner data set and I can now filter through it
– skydev
yesterday


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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




















































































Popular posts from this blog

Landwehr

Reims

Schenkenzell