jeudi 22 juillet 2021

Ember JS - Link-to states it needs id (ERROR)

ROUTER.JS
this.route('widgets', function () {
     this.route('widget', {path: '/:widget_id' }, function () {
          this.route('files');
          this.route('agreements');
     }
});

HBS FILE:
<listGroup.link-to @route="toplevel.settings.widget.index">Widgets</listGroup.link-to>

I have a link-to in a profile settings menu that links to an hbs file that displays a list of widgets (not widgets, but it's proprietary, so for sake of example "widgets"). Each list item in the widgets hbs uses the transition-to helper to transition to a single widget. There are no issues so far. When I click on the nav with the original link-to to go back to the list of widgets I get this error:

"Uncaught (in promise) Error: While generating link to route "toplevel.settings.widgets.widget": You must provide param widget_id to generate."

Is the problem in the router.js file or in my link-to? I know the error states it's the link-to, however it does not error until trying to go back to the list, which does not need a specific id.




Aucun commentaire:

Enregistrer un commentaire