Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular2-bootstrap-confirm
Advanced tools
https://mattlewis92.github.io/angular2-bootstrap-confirm/
A simple angular2 directive to display a bootstrap styled confirmation popover when an element is clicked.
Pull requests are welcome.
Install through npm:
npm install --save @angular/core@2.0.0-rc.1 angular2-bootstrap-confirm
Then use it in your app on a component:
import {Component, provide} from '@angular/core';
import {Confirm, ConfirmOptions, Position} from 'angular2-bootstrap-confirm';
import {PositionService} from 'angular2-bootstrap-confirm/position/position';
// Or if you're already using the ng2-bootstrap module
// import {PositionService} from 'ng2-bootstrap/components/position';
@Component({
selector: 'my-component',
providers: [ // you can pass both of these when bootstrapping the app to configure globally throughout your app
ConfirmOptions,
provide(Position, { // this is required so you can use the bundled position service rather than rely on the `ng2-bootstrap` module
useClass: PositionService
})
],
directives: [
Confirm
],
template: `
<button
class="btn btn-default"
mwl-confirm
[title]="title"
[message]="message"
placement="left"
(confirm)="confirmClicked = true"
(cancel)="cancelClicked = true"
[(isOpen)]="isOpen">
Click me!
</button>
`
})
class MyComponent {
public title: string = 'Popover title';
public message: string = 'Popover description';
public confirmClicked: boolean = false;
public cancelClicked: boolean = false;
public isOpen: boolean = false;
}
You may also find it useful to view the demo source.
<script src="node_modules/angular2-bootstrap-confirm/position/position.js"></script>
<script src="node_modules/angular2-bootstrap-confirm/angular2-bootstrap-confirm.js"></script>
<script>
// position service available as ng2BootstrapPosition.PositionService
// confirm options, directive and position token available as ng2BootstrapConfirm.ConfirmOptions, ng2BootstrapConfirm.Confirm, ng2BootstrapConfirm.Position
</script>
All documentation is auto-generated from the source via typedoc and can be viewed here: https://mattlewis92.github.io/angular2-bootstrap-confirm/docs/
The main confirm directive options can be viewed here.
npm install
while current directory is this repoRun npm start
to start a development server on port 8000 with auto reload + tests.
Run npm test
to run tests once or npm run test:watch
to continually run tests.
npm run release
MIT
0.4.0 (2016-05-10)
ConfirmOptions: allow confirm options to be instantiated by angulars DI
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>
FAQs
An angular2 bootstrap confirmation popover
The npm package angular2-bootstrap-confirm receives a total of 9 weekly downloads. As such, angular2-bootstrap-confirm popularity was classified as not popular.
We found that angular2-bootstrap-confirm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.