rule
Get the routing rule that matches a url.
route.rule( url )
Returns a string that best matches the provided url.
import {route} from "can";
route.register( "recipes/{recipeId}" );
route.register( "tasks/{taskId}" );
console.log( route.rule( "recipes/5" ) ); //-> "recipes/{recipeId}"
Parameters
- url
{String}
:A url fragment.
Returns
{String|undefined}
:
Returns the registered routing rule
that best matches the provided url. If no rule matches, undefined
is returned.