diff --git a/viewloader.js b/viewloader.js index a67acfc..c8c29e0 100644 --- a/viewloader.js +++ b/viewloader.js @@ -4,11 +4,7 @@ }(this, function(viewloader,$) { "use strict"; var dasherize = function(s) { - var r = /([a-z0-9][A-Z])/g, - dash = function(m) { - return m[0] + '-' + m[1].toLowerCase(); - }; - return s.replace(r, dash); + return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); }; viewloader.execute = function(views, $scope) { for(var view in views) {