I am facing error for both that cases with the linkParam & without too. I have recently updated my app from v1.13.15 to v3.20.2. And errors are occurring only for search route links, detail pages links are rendering fine. Please help.
"Error: Assertion Failed: You attempted to generate a link for the "clients.owners.search" route, but did not pass the models required for generating its dynamic segments. Cannot convert undefined or null to object
at assert (http://localhost:4200/assets/vendor.js:43478:15)
at Class.computeLinkToComponentHref (http://localhost:4200/assets/vendor.js:12284:50)
at http://localhost:4200/assets/vendor.js:22437:25
at untrack (http://localhost:4200/assets/vendor.js:62608:7)
at ComputedProperty.get (http://localhost:4200/assets/vendor.js:22436:32)
at Class.CPGETTER_FUNCTION [as href] (http://localhost:4200/assets/vendor.js:21544:25)
at getPossibleMandatoryProxyValue (http://localhost:4200/assets/vendor.js:21837:19)
at _getProp (http://localhost:4200/assets/vendor.js:21902:17)
at get (http://localhost:4200/assets/vendor.js:21888:55)
at http://localhost:4200/assets/vendor.js:54096:34"
Template.hbs
{{#if quickLink.linkParam}}
<LinkTo @route={{quickLink.linkUrl}} @model={{quickLink.linkParam}}>
{{t quickLink.nameLocalizedKey}}
</LinkTo>
{{else}}
<LinkTo @route={{quickLink.linkUrl}}>
{{t quickLink.nameLocalizedKey}}
</LinkTo>
{{/if}}
Initializer-app-settings.js
OwnerSearch: {
linkUrl: 'clients.owners.search',
nameLocalizedKey: 'dashboard.button.ownerSearch',
linkType: 'default'
},
ActiveRandomPrograms: {
linkUrl: 'drug-tests.programs.search',
linkParam: 'randomProgram',
nameLocalizedKey: 'dashboard.button.randomProgram',
linkType: 'default'
},
Router.js
this.route('clients', function () {
this.route('owners', function () {
this.route('search');
});
})
this.route('drug-tests', function () {
this.route('programs', function () {
this.route('search', {
path: '/search/:searchType'
});
});
})