erikringsmuth/app-router

regular expression + data binding

Open

#27 aberto em 1 de out. de 2014

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)HTML (83 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (608 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

I think app-router could use regular expressions in order to match path variables. Regex with named captures would be great but Javascript doesn't support them natively (xregexp is a js library that support named captures). Even simple native capture groups (by index number) would be great.

An example:

<!-- url -->
http://www.example.com/demo/15

<!-- route, notice variables attribute  -->
<!-- first capure [word (\w+)], second capture [number (\d+)] -->
<app-route path="/^\/(\w+)\/(\d+)$/i" regex variables="word number" import="/pages/regex-page.html"></app-route>

<!-- data binding -->
<regex-page word="demo" number="15"></order-page>

It's much more powerful than actual path variable data binding (using semicollon like :pathArg1). Thank you for app-router.

Guia do colaborador