|
1 | 1 | /**
|
2 | 2 | * State-based routing for AngularJS
|
3 |
| - * @version v0.0.1 - 2013-02-17 |
| 3 | + * @version v0.0.1 - 2013-02-25 |
4 | 4 | * @link
|
5 | 5 | * @license MIT License, http://www.opensource.org/licenses/MIT
|
6 | 6 | */
|
@@ -366,14 +366,14 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
|
366 | 366 | var locals = { $stateParams: $stateParams };
|
367 | 367 | forEach(state.params, function (name) {
|
368 | 368 | var value = params[name];
|
369 |
| - $stateParams[name] = (params[name] != null) ? String(value) : null; |
| 369 | + $stateParams[name] = (value != null) ? String(value) : null; |
370 | 370 | });
|
371 | 371 |
|
372 | 372 | // Resolves the values from an individual 'resolve' dependency spec
|
373 | 373 | function resolve(deps, dst) {
|
374 | 374 | forEach(deps, function (value, key) {
|
375 | 375 | promises.push($q
|
376 |
| - .when(isString(value) ? $injector.get(value) : $injector.invoke(value, locals)) |
| 376 | + .when(isString(value) ? $injector.get(value) : $injector.invoke(value, state.self, locals)) |
377 | 377 | .then(function (result) {
|
378 | 378 | dst[key] = result;
|
379 | 379 | }));
|
@@ -600,7 +600,7 @@ function UrlMatcher(pattern) {
|
600 | 600 | // The number of segments is always 1 more than the number of parameters.
|
601 | 601 | var id, regexp, segment;
|
602 | 602 | while ((m = placeholder.exec(pattern))) {
|
603 |
| - id = m[1] || m[2]; |
| 603 | + id = m[1] || m[2]; // IE[78] returns '' for unmatched groups instead of null |
604 | 604 | regexp = m[3] || '[^/]*';
|
605 | 605 | segment = pattern.substring(last, m.index);
|
606 | 606 | if (segment.indexOf('?') >= 0) break; // we're into the search part
|
|
0 commit comments