I'm trying to configure routes in Aurelia using aurelia-router, but it throws an error that it can't find the moduleId(route to file) of my route.
I configure my routes in two files router.js and app.js, router file only contains an array with all the routes. app file is the main file of my project.
Project Structure:
Router.js:
export default [
{ route: ['', '/', 'home'], name: 'home', title: 'Inicio', layoutView: 'components/common/layout/layout.html', moduleId: 'components/home/home' }
]
App.js
import routes from 'router'
import {RouterConfiguration, Router} from 'aurelia-router';
export class App {
configureRouter(config, router){
config.options.root = '/';
config.title = 'La Tatuadora';
this.router = router;
config.map(routes);
}
}
home.html
andhome.js
? – PhoenixPLATFORM.moduleName("moduleId")
to resolve modules, it comes with theaurelia-pal
package. In use it looks like this:moduleId: PLATFORM.moduleName("components/home/home")
. – SciencePLATFORM.moduleName()
– Extravagant