Skip to content

Commit

Permalink
move resolve in opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Goessen committed Sep 11, 2015
1 parent d388dfd commit 4ab4d25
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Usage

```dialogs.notify('Something Happened','Something happened at this point in the application that I wish to let you know about');```

```dialogs.create('url/to/a/template','ctrlrToUse',{data: topass,anotherVar: 'value'},{},{paramToResolve : function (){return 'value'}});```
```dialogs.create('url/to/a/template','ctrlrToUse',{data: topass,anotherVar: 'value'},{resolve :{paramToResolve : function (){return 'value'}}});```

TODO: Add more usage explanations.

Expand Down
5 changes: 2 additions & 3 deletions dist/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
* @param data object
* @param opts object
*/
create : function(url,ctrlr,data,opts,resolve){
create : function(url,ctrlr,data,opts){
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
var resolve = (opts.resolve)?opts.resolve:{};
opts = _setOpts(opts);
if(!resolve)
resolve = {};
resolve.data = function() {
if(copy)
return angular.copy(data);
Expand Down
2 changes: 1 addition & 1 deletion dist/dialogs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/dialogs-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
* @param data object
* @param opts object
*/
create : function(url,ctrlr,data,opts,resolve){
create : function(url,ctrlr,data,opts){
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
var resolve = (opts.resolve)?opts.resolve:{};
opts = _setOpts(opts);
if(!resolve)
resolve = {};
resolve.data = function() {
if(copy)
return angular.copy(data);
Expand Down
5 changes: 2 additions & 3 deletions src/dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
* @param data object
* @param opts object
*/
create : function(url,ctrlr,data,opts,resolve){
create : function(url,ctrlr,data,opts){
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
var resolve = (opts.resolve)?opts.resolve:{};
opts = _setOpts(opts);
if(!resolve)
resolve = {};
resolve.data = function() {
if(copy)
return angular.copy(data);
Expand Down

0 comments on commit 4ab4d25

Please sign in to comment.