I added an iron router to my application to handle the routing between the home page, the page and the main page of the application, which is a map
After adding an iron router with a meteorite, I wrote a router.js file and placed it in the “My Client” folder, however I get the error message “Uncaught ReferenceError: Undefined”
I checked the error with chrome devtools and pointed to "Router.configure (..." at the beginning of router.js, which I added below
Router.configure({ layoutTemplate: 'layout', loadingTemplate: 'loading' }); Router.map( function () { //the about route this.route('about', { path: '/about', template: 'about', action: function () { console.log('now routing the about template'); } }); this.route('home', { path: '/', template: 'home', action: function () { console.log('now routing the home template'); } }); //the map route this.route('map', { path: '/map', template: 'map', action: function () { console.log('now routing the map template'); } }); });
Does anyone know why I am getting the error that the router is not defined?
meteor iron-router
wcjohnson11
source share