You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
myApp.filter('_',function(){returnfunction(){varargs=Array.prototype.slice.call(arguments,0);varmethod=args.splice(1,1)[0];return_[method].apply(this,args);}});angular.forEach(_,function(method,name){// prefix all filters with '_' to prevent clobbering (such as $filter('filter') )myApp..filter('_'+name,function(){returnmethod;});});
Thank you for your advice, but not every underscore's method would be a proper filter, and some angular filter's use conventions could be merged with underscore, you could read the usage of filter in both angular and underscore, I have merged them together.
You could just do:
Demo: http://plnkr.co/edit/Jq1Lg5v1GquxnqHe5hj2?p=preview
The text was updated successfully, but these errors were encountered: