Skip to content

Commit 2c9a381

Browse files
committed
Merged from upstream
2 parents 942caee + 3e06565 commit 2c9a381

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+33988
-1242
lines changed

.npmignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Any hidden files
2+
**/.*
3+
4+
# Build related stuff
5+
/config
6+
/lib
7+
/ngdoc_assets
8+
/sample
9+
/test
10+
Gruntfile.js
11+
files.js
12+
13+
# Package managers
14+
bower.json
15+
component.json

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ before_script:
1111

1212
script:
1313
- grunt integrate
14+
15+
git:
16+
depth: 10

CHANGELOG.md

+147-1
Large diffs are not rendered by default.

CONTRIBUTING.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
# Report an Issue
3+
4+
Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure
5+
it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues)
6+
to see if someone's reported one similar to yours.
7+
8+
If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code
9+
as possible: the more minimalist, the faster we can debug it).
10+
11+
Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem,
12+
and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to
13+
that plunkr you created!
14+
15+
**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure
16+
is a bug, it's best to talk it out on
17+
[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This
18+
keeps development streamlined, and helps us focus on building great software.
19+
20+
21+
Issues only! |
22+
-------------|
23+
Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). |
24+
25+
####Purple Labels
26+
A purple label means that **you** need to take some further action.
27+
- ![Not Actionable - Need Info](http://angular-ui.github.io/ui-router/images/notactionable.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue.
28+
- ![Plunkr Please](http://angular-ui.github.io/ui-router/images/plunkrplease.png): Please [create a plunkr](http://bit.ly/UIR-Plunk)
29+
- ![StackOverflow](http://angular-ui.github.io/ui-router/images/stackoverflow.png): We suspect your issue is really a help request, or could be answered by the community. Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router). If you determine that is an actual issue, please explain why.
30+
31+
If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately.
32+
33+
# Contribute
34+
35+
**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine.
36+
37+
**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed.
38+
39+
**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea.
40+
41+
**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules:
42+
43+
- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests
44+
- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one
45+
- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release.
46+
- Changes should always respect the coding style of the project
47+
48+
49+
50+
# Developing
51+
52+
UI-Router uses <code>grunt >= 0.4.x</code>. Make sure to upgrade your environment and read the
53+
[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4).
54+
55+
Dependencies for building from source and running tests:
56+
57+
* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli`
58+
* Then, install the development dependencies by running `$ npm install` from the project directory
59+
60+
There are a number of targets in the gruntfile that are used to generating different builds:
61+
62+
* `grunt`: Perform a normal build, runs jshint and karma tests
63+
* `grunt build`: Perform a normal build
64+
* `grunt dist`: Perform a clean build and generate documentation
65+
* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes.

Gruntfile.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,18 @@ module.exports = function (grunt) {
9494
unstable: {
9595
configFile: 'config/karma-1.1.5.js'
9696
},
97+
future: {
98+
configFile: 'config/karma-1.3.0.js'
99+
},
97100
background: {
98101
background: true,
99102
browsers: [ grunt.option('browser') || 'PhantomJS' ]
103+
},
104+
watch: {
105+
configFile: 'config/karma.js',
106+
singleRun: false,
107+
autoWatch: true,
108+
autoWatchInterval: 1
100109
}
101110
},
102111
changelog: {
@@ -107,6 +116,7 @@ module.exports = function (grunt) {
107116
ngdocs: {
108117
options: {
109118
dest: 'site',
119+
styles: [ 'ngdoc_assets/uirouter-docs.css' ],
110120
html5Mode: false,
111121
title: 'UI Router',
112122
startPage: '/api/ui.router',
@@ -123,20 +133,29 @@ module.exports = function (grunt) {
123133
grunt.registerTask('default', ['build', 'jshint', 'karma:unit']);
124134
grunt.registerTask('build', 'Perform a normal build', ['concat', 'uglify']);
125135
grunt.registerTask('dist', 'Perform a clean build', ['clean', 'build']);
126-
grunt.registerTask('dist-docs', 'Perform a clean build and generate documentation', ['dist', 'ngdocs']);
136+
grunt.registerTask('dist-docs', 'Perform a clean build and generate documentation', ['dist', 'ngdocs', 'widedocs']);
127137
grunt.registerTask('release', 'Tag and perform a release', ['prepare-release', 'dist', 'perform-release']);
128138
grunt.registerTask('dev', 'Run dev server and watch for changes', ['build', 'connect:server', 'karma:background', 'watch']);
129139
grunt.registerTask('sample', 'Run connect server with keepalive:true for sample app development', ['connect:sample']);
130140

141+
grunt.registerTask('widedocs', 'Convert to bootstrap container-fluid', function () {
142+
promising(this,
143+
system(
144+
'sed -i.bak ' +
145+
'-e \'s/class="row"/class="row-fluid"/\' ' +
146+
'-e \'s/icon-cog"><\\/i>/icon-cog"><\\/i>Provider/\' ' +
147+
'-e \'s/role="main" class="container"/role="main" class="container-fluid"/\' site/index.html')
148+
);
149+
});
150+
151+
131152
grunt.registerTask('publish-pages', 'Publish a clean build, docs, and sample to github.io', function () {
132153
promising(this,
133154
ensureCleanMaster().then(function () {
134155
shjs.rm('-rf', 'build');
135156
return system('git checkout gh-pages');
136157
}).then(function () {
137-
return system('git rebase master');
138-
}).then(function () {
139-
return system('git pull');
158+
return system('git merge master');
140159
}).then(function () {
141160
return system('grunt dist-docs');
142161
}).then(function () {

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2014 The AngularUI Team, Karsten Sperling
3+
Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+14-63
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# AngularUI Router &nbsp;[![Build Status](https://travis-ci.org/angular-ui/ui-router.png?branch=master)](https://travis-ci.org/angular-ui/ui-router)
1+
# AngularUI Router &nbsp;[![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router)
22

33
#### The de-facto solution to flexible routing with nested views
44
---
5-
**[Download 0.2.10](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|**
5+
**[Download 0.2.13](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|**
66
**[Guide](https://github.com/angular-ui/ui-router/wiki) |**
77
**[API](http://angular-ui.github.io/ui-router/site) |**
88
**[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |**
99
**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |**
1010
**[Resources](#resources) |**
11-
**[Report an Issue](#report-an-issue) |**
12-
**[Contribute](#contribute) |**
11+
**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |**
12+
**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |**
1313
**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |**
1414
**[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)**
1515

@@ -31,8 +31,8 @@ Check out the sample app: http://angular-ui.github.io/ui-router/sample/
3131

3232
## Get Started
3333

34-
**(1)** Get UI-Router in one of 4 ways:
35-
- clone & [build](#developing) this repository
34+
**(1)** Get UI-Router in one of the following ways:
35+
- clone & [build](CONTRIBUTING.md#developing) this repository
3636
- [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js))
3737
- via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console
3838
- or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console
@@ -150,12 +150,12 @@ myApp.config(function($stateProvider, $urlRouterProvider) {
150150
})
151151
.state('state2.list', {
152152
url: "/list",
153-
templateUrl: "partials/state2.list.html",
154-
controller: function($scope) {
155-
$scope.things = ["A", "Set", "Of", "Things"];
156-
}
157-
})
153+
templateUrl: "partials/state2.list.html",
154+
controller: function($scope) {
155+
$scope.things = ["A", "Set", "Of", "Things"];
156+
}
158157
});
158+
});
159159
```
160160

161161
**(6)** See this quick start example in action.
@@ -234,59 +234,10 @@ myApp.config(function($stateProvider) {
234234
* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io)
235235
* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg)
236236
* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io)
237+
* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy)
237238

238-
## Report an Issue
239-
240-
Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure
241-
it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues)
242-
to see if someone's reported one similar to yours.
243-
244-
If not, then [create a plunkr](http://plnkr.co/edit/u18KQc?p=preview) that demonstrates the problem (try to use as little code
245-
as possible: the more minimalist, the faster we can debug it).
246-
247-
Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem,
248-
and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to
249-
that plunkr you created!
250-
251-
**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure
252-
is a bug, it's best to talk it out in the
253-
[Google Group](https://groups.google.com/forum/#!categories/angular-ui/router) or on
254-
[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This
255-
keeps development streamlined, and helps us focus on building great software.
256-
257-
Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs).
258-
259-
260-
## Contribute
261-
262-
**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine.
263-
264-
**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/issues/milestones) to see where the project is headed, and if your feature idea fits with where we're headed.
265-
266-
**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea.
267-
268-
**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules:
269-
270-
- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests
271-
- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one
272-
- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release.
273-
- Changes should always respect the coding style of the project
274-
275-
276-
277-
## Developing
278-
279-
UI-Router uses <code>grunt >= 0.4.x</code>. Make sure to upgrade your environment and read the
280-
[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4).
281-
282-
Dependencies for building from source and running tests:
283239

284-
* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli`
285-
* Then, install the development dependencies by running `$ npm install` from the project directory
286240

287-
There are a number of targets in the gruntfile that are used to generating different builds:
241+
## Reporting issues and Contributing
288242

289-
* `grunt`: Perform a normal build, runs jshint and karma tests
290-
* `grunt build`: Perform a normal build
291-
* `grunt dist`: Perform a clean build and generate documentation
292-
* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes.
243+
Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request.

api/angular-ui-router.d.ts

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
// Type definitions for Angular JS 1.1.5+ (ui.router module)
2+
// Project: https://github.com/angular-ui/ui-router
3+
// Definitions by: Michel Salib <https://github.com/michelsalib>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare module ng.ui {
7+
8+
interface IState {
9+
name?: string;
10+
template?: string;
11+
templateUrl?: any; // string || () => string
12+
templateProvider?: any; // () => string || IPromise<string>
13+
controller?: any;
14+
controllerAs?: string;
15+
controllerProvider?: any;
16+
resolve?: {};
17+
url?: string;
18+
params?: any;
19+
views?: {};
20+
abstract?: boolean;
21+
onEnter?: (...args: any[]) => void;
22+
onExit?: (...args: any[]) => void;
23+
data?: any;
24+
reloadOnSearch?: boolean;
25+
}
26+
27+
interface ITypedState<T> extends IState {
28+
data?: T;
29+
}
30+
31+
interface IStateProvider extends IServiceProvider {
32+
state(name: string, config: IState): IStateProvider;
33+
state(config: IState): IStateProvider;
34+
decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
35+
}
36+
37+
interface IUrlMatcher {
38+
concat(pattern: string): IUrlMatcher;
39+
exec(path: string, searchParams: {}): {};
40+
parameters(): string[];
41+
format(values: {}): string;
42+
}
43+
44+
interface IUrlMatcherFactory {
45+
compile(pattern: string): IUrlMatcher;
46+
isMatcher(o: any): boolean;
47+
}
48+
49+
interface IUrlRouterProvider extends IServiceProvider {
50+
when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
51+
when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
52+
when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
53+
when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider;
54+
when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider;
55+
when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider;
56+
when(whenPath: string, handler: Function): IUrlRouterProvider;
57+
when(whenPath: string, handler: any[]): IUrlRouterProvider;
58+
when(whenPath: string, toPath: string): IUrlRouterProvider;
59+
otherwise(handler: Function): IUrlRouterProvider;
60+
otherwise(handler: any[]): IUrlRouterProvider;
61+
otherwise(path: string): IUrlRouterProvider;
62+
rule(handler: Function): IUrlRouterProvider;
63+
rule(handler: any[]): IUrlRouterProvider;
64+
}
65+
66+
interface IStateOptions {
67+
location?: any;
68+
inherit?: boolean;
69+
relative?: IState;
70+
notify?: boolean;
71+
reload?: boolean;
72+
}
73+
74+
interface IHrefOptions {
75+
lossy?: boolean;
76+
inherit?: boolean;
77+
relative?: IState;
78+
absolute?: boolean;
79+
}
80+
81+
interface IStateService {
82+
go(to: string, params?: {}, options?: IStateOptions): IPromise<any>;
83+
transitionTo(state: string, params?: {}, updateLocation?: boolean): void;
84+
transitionTo(state: string, params?: {}, options?: IStateOptions): void;
85+
includes(state: string, params?: {}): boolean;
86+
is(state:string, params?: {}): boolean;
87+
is(state: IState, params?: {}): boolean;
88+
href(state: IState, params?: {}, options?: IHrefOptions): string;
89+
href(state: string, params?: {}, options?: IHrefOptions): string;
90+
get(state: string): IState;
91+
get(): IState[];
92+
current: IState;
93+
params: any;
94+
reload(): void;
95+
}
96+
97+
interface IStateParamsService {
98+
[key: string]: any;
99+
}
100+
101+
interface IStateParams {
102+
[key: string]: any;
103+
}
104+
105+
interface IUrlRouterService {
106+
/*
107+
* Triggers an update; the same update that happens when the address bar
108+
* url changes, aka $locationChangeSuccess.
109+
*
110+
* This method is useful when you need to use preventDefault() on the
111+
* $locationChangeSuccess event, perform some custom logic (route protection,
112+
* auth, config, redirection, etc) and then finally proceed with the transition
113+
* by calling $urlRouter.sync().
114+
*
115+
*/
116+
sync(): void;
117+
}
118+
119+
interface IUiViewScrollProvider {
120+
/*
121+
* Reverts back to using the core $anchorScroll service for scrolling
122+
* based on the url anchor.
123+
*/
124+
useAnchorScroll(): void;
125+
}
126+
}

0 commit comments

Comments
 (0)