current

  • function
can.route.current  

can.route.current( data )

Check if data represents the current route.

Parameters

  1. data {Object}

    Data to check agains the current route.

Returns

{Boolean}

Whether the data matches the current URL.

Checks the page's current URL to see if the route represents the options passed into the function.

Returns true if the options respresent the current URL.

can.route.attr('id', 5) // location.hash -> "#!id=5"
can.route.current({ id: 5 }) // -> true
can.route.current({ id: 5, type: 'videos' }) // -> false

can.route.attr('type', 'videos')
       // location.hash -> #!id=5&type=videos
can.route.current({ id: 5, type: 'videos' }) // -> true