aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorAndres Ornelas2010-05-27 11:26:23 -0700
committerAndres Ornelas2010-05-27 11:26:23 -0700
commitcb5d21192787985bbff20b369e885639de253345 (patch)
tree127c401a80e03ac4f6ad657ddbc1dfe6841d0f2a /src/widgets.js
parent177873df86b6b069892184f24518959e7cef33cd (diff)
downloadangular.js-cb5d21192787985bbff20b369e885639de253345.tar.bz2
extracted switchRouteMatcher and added necessary libraries to angular-scenario
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 1c9fe605..43bed81f 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -317,26 +317,5 @@ var ngSwitch = angularWidget('NG:SWITCH', function (element){
equals: function(on, when) {
return on == when;
},
- route: function(on, when, dstName) {
- var regex = '^' + when.replace(/[\.\\\(\)\^\$]/g, "\$1") + '$',
- params = [],
- dst = {};
- foreach(when.split(/\W/), function(param){
- if (param) {
- var paramRegExp = new RegExp(":" + param + "([\\W])");
- if (regex.match(paramRegExp)) {
- regex = regex.replace(paramRegExp, "([^\/]*)$1");
- params.push(param);
- }
- }
- });
- var match = on.match(new RegExp(regex));
- if (match) {
- foreach(params, function(name, index){
- dst[name] = match[index + 1];
- });
- if (dstName) this.$set(dstName, dst);
- }
- return match ? dst : null;
- }
+ route: switchRouteMatcher
});