Skip to content

angelo0000/backbone_filters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Disclaimer: This fork has been updated to work with Backbone 0.5.3

Usage

Include backbone_filters.js after Backbone.

In your router you can now add:

before: {
	'^clerks' : function() {
		/* do stuff to all routes starting with 'clerks' */
		/* return false to halt execution */
	},
	'another reg ex' : function() { }
},

after: {
	'^clerks' : function() {
		/* do stuff */
	},
	'another reg ex' : function() { }	
}

Your filters will be called and if a filter returns false, the filter chain is halted. If a before filter chain is halted, the action in the Router will not be called. Your filters will receive the same arguments that get passed to the actions.

About

before and after filter support for backbone.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published