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

Cannot access params via outside functions (scoping) #69

Open
ethanpil opened this issue Dec 13, 2013 · 0 comments
Open

Cannot access params via outside functions (scoping) #69

ethanpil opened this issue Dec 13, 2013 · 0 comments

Comments

@ethanpil
Copy link

I would like to be able to organize better than stuffing all the code into the controller. But, how can I access my params from the app object?

We already have Path.routes.current

How about also Path.routes.currentparams

Here is a simplified version of my issue:

app =   {
    "feed" : function() { 
        console.log('welcome to the feed section.'); 
        //How to I get my 'url' parameter?
               // What if.... url = Path.routes.currentparams['url'];

    },
    "menu" : function() { console.log('menu'); }

}


Path.map("#feed(/:url)").to(app.feed);
Path.map("#menu").to(app.menu);
Path.root("#menu");
Path.listen();
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

1 participant