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

Не понятно использование поля defaults #15

Open
belozer opened this issue Aug 18, 2016 · 2 comments
Open

Не понятно использование поля defaults #15

belozer opened this issue Aug 18, 2016 · 2 comments

Comments

@belozer
Copy link

belozer commented Aug 18, 2016

var myRoutes = [{
    id: 'route_with_parameter_in_path',
    path: '/some/path/{parameter}',
    defaults: {parameter: 1}
}];

myRouter.generate('route_with_parameter_in_path'); 
// returns '/some/path'

при такой декларации ожидаемое поведение:
/some/path/1

А описанный способ генерации "пустого пути" больше ожидаем от такой декларации

var myRoutes = [{
    id: 'route_with_parameter_in_path',
    path: '/some/path/{parameter?}'
}];

@apsavin сможешь разъяснить?

@jifeon
Copy link
Contributor

jifeon commented Aug 18, 2016

duplicates #6

@apsavin
Copy link
Owner

apsavin commented Aug 18, 2016

Thanks @jifeon
It seems that I need to write in README.md about it.

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