├── .eslintrc.json
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── angular-ui-router-uib-modal.js
├── bower.json
├── build.txt
├── files.conf.js
├── gulpfile.js
├── index.d.ts
├── karma.conf.js
├── package.json
├── sample
├── app
│ ├── app.js
│ └── contacts
│ │ ├── contacts-service.js
│ │ ├── contacts.detail.html
│ │ ├── contacts.detail.item.edit.html
│ │ ├── contacts.detail.item.html
│ │ ├── contacts.html
│ │ ├── contacts.js
│ │ └── contacts.list.html
├── assets
│ └── contacts.json
├── common
│ └── utils
│ │ └── utils-service.js
├── css
│ └── styles.css
└── index.html
├── src
└── angular-ui-router-uib-modal.ts
├── test
└── angular-ui-router-modal.spec.ts
├── tsconfig.json
└── tslint.json
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint:recommended",
3 | "env": {
4 | "browser": true
5 | },
6 | "rules": {
7 | "no-console": "error",
8 | "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
9 | "semi": ["error", "always"],
10 | "block-scoped-var": "error",
11 | "eqeqeq": "error",
12 | "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
13 | "space-before-function-paren": ["error", "never"],
14 | "space-in-parens": ["error", "never"],
15 | "comma-spacing": ["error", { "before": false, "after": true }]
16 | }
17 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18 | .grunt
19 |
20 | # node-waf configuration
21 | .lock-wscript
22 |
23 | # Compiled binary addons (http://nodejs.org/api/addons.html)
24 | build/Release
25 |
26 | # Dependency directory
27 | node_modules
28 |
29 | # Optional npm cache directory
30 | .npm
31 |
32 | # Optional REPL history
33 | .node_repl_history
34 | src/**/*.js
35 | test/**/*.js
36 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "iojs"
4 | before_script:
5 | - export DISPLAY=:99.0
6 | - sh -e /etc/init.d/xvfb start
7 | - npm install
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Stepan Riha
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | angular-ui-router-uib-modal
2 | ===========================
3 |
4 | [](https://travis-ci.org/nonplus/angular-ui-router-uib-modal)
5 |
6 | AngularJS module that adds support for ui-bootstrap modal states when using ui-router.
7 |
8 | Motivation
9 | ----------
10 |
11 | Some RIAs using UI-Router use modal dialogs for certain application states.
12 | The [UI-Router's FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-open-a-dialogmodal-at-a-certain-state),
13 | shows how to implement modal dialogs using [ui.bootstrap.modal](http://angular-ui.github.io/bootstrap/#/modal) service.
14 | While it works well, it requires a lot of boiler-plate code, complicates the state definition, and requires the state
15 | controller to be aware that its inside a `$uibModalInstance` to automatically close the dialog on a state change.
16 |
17 | This module gets rid of the boilerplate by adding support for a `modal: true` option in state definitions.
18 | This causes the state to be displayed via `$uibModal.open(...)` instead of within a `
Welcome to the UI-Router Demo
' + 73 | 'Use the menu above to navigate. ' +
74 | 'Pay attention to the $state
and $stateParams
values below.
Click these links—Alice or ' + 76 | 'Bob—to see a url redirect in action.
' 77 | 78 | }) 79 | 80 | /////////// 81 | // About // 82 | /////////// 83 | 84 | .state('about', { 85 | url: '/about', 86 | 87 | resolve: { 88 | // Static $title 89 | $title: function() { return "About"; } 90 | }, 91 | 92 | // Showing off how you could return a promise from templateProvider 93 | templateProvider: ['$timeout', 94 | function ( $timeout) { 95 | return $timeout(function () { 96 | return 'UI-Router Resources