Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Organize your Meteor application' after add import folder #1543

Open
stephane-r opened this issue Jul 4, 2016 · 2 comments
Open

'Organize your Meteor application' after add import folder #1543

stephane-r opened this issue Jul 4, 2016 · 2 comments

Comments

@stephane-r
Copy link

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 !

@Batistleman
Copy link

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 ;-)

@ayoung4
Copy link

ayoung4 commented Aug 23, 2016

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants