'Organize your Meteor application' after add import folder
Opened this issue · 2 comments
Hi every body,
I would like add import
folder in my Meteor APP.
But, after import my routes and layout, i've Organize your Meteor application
rendered.
My imports/statup/client/routes.js
:
` import { IronRouter } from 'meteor/iron:router';
import '../../../ui/layout/layout.js';
// Configuration
Router.configure({
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
layoutTemplate: 'layout',
waitOn: function () {
return [
Meteor.subscribe('posts'),
Meteor.subscribe('skills'),
Meteor.subscribe('tasks'),
Meteor.subscribe('profil'),
Meteor.subscribe('messages')
];
},
onAfterAction: function () {
profil = Profil.findOne({},{
sort: {
createdAt: 1
}, limit: 1
});
}
});
// Home page
Router.route('/', {
name: 'home',
itemName: 'Yeah'
});`
And my imports/ui/layout/layout.js :
` import './layout.html';
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';`
Do you have any idea why Iron Router have error ?
Thank you !
Are you calling the /imports/statup/client/routes.js from your main client file?
Like: /client/main.js:
import 'imports/statup/client/routes.js';
PS.
I would advice you to use absolute paths in your files, instead of import '../../../ui/layout/layout.js';, it will save you a lot of pain if you do some refactoring ;-)
what error is Iron Router coming up with?
One thing I see is that
import { IronRouter } from 'meteor/iron:router'
should be
import { Router } from 'meteor/iron:router'
also I dont see itemName listed in the section on route specific options in the documentation:
http://iron-meteor.github.io/iron-router/