balderdashy / mast

UI conventions built on top of Backbone.JS
MIT License
81 stars 14 forks source link

Shorthand to use :id params #95

Open mikermcneil opened 11 years ago

mikermcneil commented 11 years ago

e.g.


subscriptions: {
        '#'                     : '@selected="#"',
        '#getStarted'           : '@selected="#getStarted"',
        '#blog'                 : '@selected="#blog"',
        '#documentation'        : '@selected="#documentation"',

        // New shorthand:
        '#documentation/:page'  : '@selected="#documentation/"+page'
    },
mikermcneil commented 11 years ago

this is done in 2.x, right @ghernandez345? However I believe it only works for # routes, not % events

mikermcneil commented 11 years ago

@ghernandez345 do you remember if there was a reason to have it only work for # events?

ghernandez345 commented 11 years ago

not that I can remember.

ghernandez345 commented 11 years ago

works with this form.

'#home/:page': function(page) {console.log(page);}

not sure what @selected= is for.

mikermcneil commented 11 years ago

Can you try it with %?

Mike's phone

On Aug 28, 2013, at 12:42, Gabe Hernandez notifications@github.com wrote:

works with this form.

'#home/:page': function(page) {console.log(page);} not sure what @selected= is for.

— Reply to this email directly or view it on GitHub.

mikermcneil commented 11 years ago

Just for the record, there is indeed weird behavior with % + :... This must have been intentional, but in retrospect, I was being dumb.

mikermcneil commented 10 years ago

Not sure if we fixed this yet or not, but if it's still an issue I'll fix @ghernandez345 @sgress454 @particlebanana

particlebanana commented 10 years ago

You still can't use : in event names, it sees them as function arguments.