angular2-bootstrap-confirm
Advanced tools
Comparing version 0.3.3 to 0.4.0
@@ -185,3 +185,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
if (!this.popover && !this.isDisabled) { | ||
var options_1 = new confirmOptions_provider_1.PopoverConfirmOptions(Object.assign({}, this.defaultOptions, { | ||
var options_1 = new confirmOptions_provider_1.PopoverConfirmOptions(); | ||
Object.assign(options_1, this.defaultOptions, { | ||
title: this.title, | ||
@@ -196,3 +197,3 @@ message: this.message, | ||
hostElement: this.elm | ||
})); | ||
}); | ||
var optionalParams = [ | ||
@@ -499,6 +500,5 @@ 'confirmText', | ||
* useFactory: (): ConfirmOptions => { | ||
* return new ConfirmOptions({ | ||
* // focus the confirm button by default. See below for an explanation of all options. | ||
* focusButton: 'confirm' | ||
* }); | ||
* const options = new ConfirmOptions(); | ||
* options.focusButton = 'confirm'; // focus the confirm button by default. See below for an explanation of all options. | ||
* return options; | ||
* } | ||
@@ -510,7 +510,3 @@ * }) | ||
var ConfirmOptions = (function () { | ||
/** | ||
* @param options the options object to set on the instance of the confirm options | ||
*/ | ||
function ConfirmOptions(options) { | ||
if (options === void 0) { options = {}; } | ||
function ConfirmOptions() { | ||
/** | ||
@@ -544,7 +540,6 @@ * The popover confirmation button text | ||
this.hideCancelButton = false; | ||
Object.assign(this, options); | ||
} | ||
ConfirmOptions = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [Object]) | ||
__metadata('design:paramtypes', []) | ||
], ConfirmOptions); | ||
@@ -551,0 +546,0 @@ return ConfirmOptions; |
@@ -5,2 +5,35 @@ # Change Log | ||
<a name="0.4.0"></a> | ||
## [0.4.0](https://github.com/mattlewis92/angular2-bootstrap-confirm/compare/v0.3.3...v0.4.0) (2016-05-10) | ||
### Features | ||
**ConfirmOptions:** allow confirm options to be instantiated by angulars DI | ||
BREAKING CHANGE: the constructor of ConfirmOptions now no longer takes an object of values. | ||
This allows you to just pass `ConfirmOptions` directly to the providers of your app or component and angular will instantiate it for you. e.g. | ||
``` | ||
providers: [ConfirmOptions], // previously angular would throw and you'd have to instantiate it yourself with useFactory | ||
``` | ||
To migrate: | ||
Before: | ||
``` | ||
const options = new ConfirmOptions({ | ||
focusButton: 'confirm' | ||
}); | ||
``` | ||
After: | ||
``` | ||
const options = new ConfirmOptions(); | ||
Object.assign(options, { | ||
focusButton: 'confirm' | ||
}); | ||
``` | ||
<a name="0.3.3"></a> | ||
@@ -7,0 +40,0 @@ ## [0.3.3](https://github.com/mattlewis92/angular2-bootstrap-confirm/compare/v0.3.2...v0.3.3) (2016-05-09) |
{ | ||
"name": "angular2-bootstrap-confirm", | ||
"version": "0.3.3", | ||
"version": "0.4.0", | ||
"description": "An angular2 bootstrap confirmation popover", | ||
@@ -68,3 +68,3 @@ "main": "./angular2-bootstrap-confirm.js", | ||
"ts-loader": "~0.8.2", | ||
"tslint": "~3.9.0", | ||
"tslint": "~3.10.0", | ||
"tslint-loader": "~2.1.4", | ||
@@ -97,2 +97,2 @@ "typedoc": "~0.3.12", | ||
} | ||
} | ||
} |
@@ -47,7 +47,3 @@ # Angular bootstrap confirm | ||
providers: [ // you can pass both of these when bootstrapping the app to configure globally throughout your app | ||
provide(ConfirmOptions, { // can't currently just pass in ConfirmOptions directly due to this bug: https://github.com/angular/angular/issues/8519 | ||
useFactory: (): ConfirmOptions => { | ||
return new ConfirmOptions(); | ||
} | ||
}), | ||
ConfirmOptions, | ||
provide(Position, { // this is required so you can use the bundled position service rather than rely on the `ng2-bootstrap` module | ||
@@ -54,0 +50,0 @@ useClass: PositionService |
@@ -10,6 +10,5 @@ import { ElementRef } from '@angular/core'; | ||
* useFactory: (): ConfirmOptions => { | ||
* return new ConfirmOptions({ | ||
* // focus the confirm button by default. See below for an explanation of all options. | ||
* focusButton: 'confirm' | ||
* }); | ||
* const options = new ConfirmOptions(); | ||
* options.focusButton = 'confirm'; // focus the confirm button by default. See below for an explanation of all options. | ||
* return options; | ||
* } | ||
@@ -61,6 +60,2 @@ * }) | ||
hideCancelButton: boolean; | ||
/** | ||
* @param options the options object to set on the instance of the confirm options | ||
*/ | ||
constructor(options?: Object); | ||
} | ||
@@ -67,0 +62,0 @@ /** |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
81919
0
1036
116