Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit aa5583c

Browse files
author
Christophe Goessen
committed
move resolve in opts
1 parent d388dfd commit aa5583c

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Usage
1919

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

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

2424
TODO: Add more usage explanations.
2525

dist/dialogs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
441441
* @param data object
442442
* @param opts object
443443
*/
444-
create : function(url,ctrlr,data,opts,resolve){
444+
create : function(url,ctrlr,data,opts){
445445
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
446+
var resolve = (opts.resolve)?opts:{};
446447
opts = _setOpts(opts);
447-
if(!resolve)
448-
resolve = {};
449448
resolve.data = function() {
450449
if(copy)
451450
return angular.copy(data);

dist/dialogs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dialogs-services.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
257257
* @param data object
258258
* @param opts object
259259
*/
260-
create : function(url,ctrlr,data,opts,resolve){
260+
create : function(url,ctrlr,data,opts){
261261
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
262+
var resolve = (opts.resolve)?opts:{};
262263
opts = _setOpts(opts);
263-
if(!resolve)
264-
resolve = {};
265264
resolve.data = function() {
266265
if(copy)
267266
return angular.copy(data);

src/dialogs.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,10 @@ angular.module('dialogs.services',['ui.bootstrap.modal','dialogs.controllers'])
435435
* @param data object
436436
* @param opts object
437437
*/
438-
create : function(url,ctrlr,data,opts,resolve){
438+
create : function(url,ctrlr,data,opts){
439439
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
440+
var resolve = (opts.resolve)?opts:{};
440441
opts = _setOpts(opts);
441-
if(!resolve)
442-
resolve = {};
443442
resolve.data = function() {
444443
if(copy)
445444
return angular.copy(data);

0 commit comments

Comments
 (0)