Skip to content

Commit a2ae389

Browse files
committed
Merge pull request #314 from angular-ui/issue-254
Rename all modules to include ui.state in the name.
2 parents 7a6135f + f45a95e commit a2ae389

18 files changed

+86
-61
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ To evolve the concept of an [angularjs](http://angularjs.org/) [***route***](htt
6464
<script src="angular-ui-router.min.js"></script> <!-- Insert after main angular.js file -->
6565
```
6666

67-
2. Set `ui.state` as a dependency in your module
67+
2. Set `ui.router` as a dependency in your module
6868
>
6969
```javascript
70-
var myapp = angular.module('myapp', ['ui.state'])
70+
var myapp = angular.module('myapp', ['ui.router'])
7171
```
7272

7373
### Nested States & Views

sample/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
}
4646
}
4747

48-
angular.module('sample', ['ui.compat'])
48+
angular.module('sample', ['ui.router.compat'])
4949
.config(
5050
[ '$stateProvider', '$routeProvider', '$urlRouterProvider',
5151
function ($stateProvider, $routeProvider, $urlRouterProvider) {

src/common.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ function inheritParams(currentParams, newParams, $current, $to) {
7878
return extend({}, inherited, newParams);
7979
}
8080

81-
angular.module('ui.util', ['ng']);
82-
angular.module('ui.router', ['ui.util']);
83-
angular.module('ui.state', ['ui.router', 'ui.util']);
84-
angular.module('ui.compat', ['ui.state']);
81+
angular.module('ui.router.util', ['ng']);
82+
angular.module('ui.router.router', ['ui.router.util']);
83+
angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);
84+
angular.module('ui.router', ['ui.router.state']);
85+
angular.module('ui.router.compat', ['ui.router']);
86+

src/compat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ function $RouteProvider( $stateProvider, $urlRouterProvider) {
7979
}
8080
}
8181

82-
angular.module('ui.compat')
82+
angular.module('ui.router.compat')
8383
.provider('$route', $RouteProvider)
8484
.directive('ngView', $ViewDirective);

src/state.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
321321
};
322322

323323
$state.href = function href(stateOrName, params, options) {
324-
options = extend({ lossy: true }, options || {});
325-
var state = findState(stateOrName);
324+
options = extend({ lossy: true, inherit: false, relative: $state.$current }, options || {});
325+
var state = findState(stateOrName, options.relative);
326+
327+
params = inheritParams($stateParams, params || {}, $state.$current, state);
326328
var nav = (state && options.lossy) ? state.navigable : state;
327329
var url = (nav && nav.url) ? nav.url.format(normalize(state.params, params || {})) : null;
328330
return !$locationProvider.html5Mode() && url ? "#" + url : url;
@@ -436,6 +438,6 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
436438
}
437439
}
438440

439-
angular.module('ui.state')
441+
angular.module('ui.router.state')
440442
.value('$stateParams', {})
441443
.provider('$state', $StateProvider);

src/stateDirectives.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function $StateRefDirective($state) {
3939

4040
element.bind("click", function(e) {
4141
if ((e.which == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
42-
$state.transitionTo(ref.state, params);
42+
$state.go(ref.state, params);
4343
scope.$apply();
4444
e.preventDefault();
4545
}
@@ -48,4 +48,4 @@ function $StateRefDirective($state) {
4848
};
4949
}
5050

51-
angular.module('ui.state').directive('uiSref', $StateRefDirective);
51+
angular.module('ui.router.state').directive('uiSref', $StateRefDirective);

src/templateFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ function $TemplateFactory( $http, $templateCache, $injector) {
8484
};
8585
}
8686

87-
angular.module('ui.util').service('$templateFactory', $TemplateFactory);
87+
angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);

src/urlMatcherFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,4 @@ function $UrlMatcherFactory() {
253253
}
254254

255255
// Register as a provider so it's available to other providers
256-
angular.module('ui.util').provider('$urlMatcherFactory', $UrlMatcherFactory);
256+
angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);

src/urlRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ function $UrlRouterProvider( $urlMatcherFactory) {
114114
}];
115115
}
116116

117-
angular.module('ui.router').provider('$urlRouter', $UrlRouterProvider);
117+
angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);

src/view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ function $ViewProvider() {
2525
}
2626
}
2727

28-
angular.module('ui.state').provider('$view', $ViewProvider);
28+
angular.module('ui.router.state').provider('$view', $ViewProvider);

0 commit comments

Comments
 (0)