Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
aurelia-bootstrap-tagsinput
Advanced tools
An Aurelia Custom Element for the 3rd party addon [Bootstrap Tags Input]
An Aurelia Custom Element for the 3rd party addon Bootstrap Tags Input
A quick example of the code in action. Note that the value is available under the model.bind
.
<aba-tags-input element.bind="tag" model.bind="post.categories"></aba-tags-input>
Every single options that are part of Bootstrap Tags Input
are available as bindable or as regular attributes. For the complete list, please visit the official site Bootstrap Tags Input - Options.
There is 2 ways to call options (with a bind
attribute or as a regular attribute).
Example
regular attribute (View)
<aba-tags-input item-value="id" item-text="label"></aba-tags-input>
bind attribute (View + ViewModel)
<aba-tags-input confirm-keys.bind="tagConfirmKeys"></aba-tags-input>
export class Example {
tagConfirmKeys = [13, 44];
}
Again every single methods which comes with Bootstrap Tags Input
are available. For the complete list, please visit the official site Bootstrap Tags Input - Functions.
To have access to the methods/functions, you will need to expose the element itself through element.bind
to expose the methods (also note that doing so will also give you access to events
, options
and methods
).
Example
View (exposing the element)
<aba-tags-input element.bind="tag" model.bind="post.categories"></aba-tags-input>
ViewModel (calling the method)
export class Example {
tagChanged() {
this.tag.methods.add('tag1');
}
}
Every events of Bootstrap Tags Input
are, as no surprises, available as well. For the complete list, please visit the official site Bootstrap Tags Input - Events.
To have access to the events
, you will need to expose the element itself through element.bind
to expose the methods (also note that doing so will also give you access to events
, options
and methods
).
Note
The events are called with the syntax of onEvent
which differs from the original syntax. Example, for the beforeItemAdd
, we would use the onBeforeItemAdd
event.
Example
View (exposing the element)
<aba-tags-input element.bind="tag" model.bind="post.categories"></aba-tags-input>
ViewModel (calling the onEvent trigger)
export class Example {
tagChanged() {
this.tag.events.onBeforeItemAdd = (e) => console.log('onBeforeItemAdd');
this.tag.events.onBeforeItemRemove = (e) => console.log('onBeforeItemRemove');
this.tag.events.onItemAdded = (e) => console.log('onItemAdded');
this.tag.events.onItemAddedOnInit = (e) => console.log('onItemAddedOnInit');
this.tag.events.onItemRemoved = (e) => console.log('onItemRemoved');
}
}
You can run the examples or build your own by doing the following.
npm install --save aurelia-bootstrap-tagsinput
For CLI
you will need to add (aurelia-bootstrap-tagsinput
) to your aurelia.json
file. The exported class is aba-tags-input
.
{
"name": "aba-tags-input",
"path": "../node_modules/aurelia-bootstrap-tagsinput/dist/amd",
"main": "index",
"resources": ["**/*.{css,html}"]
}
Make the plugin available globally in your main.js
file. Please note the exported class is aba-tags-input
(aba
stands for Aurelia-Bootstrap-Addon
)
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aba-tags-input')
.feature('resources');
aurelia.start().then(() => aurelia.setRoot());
}
FAQs
An Aurelia Custom Element for the 3rd party addon [Bootstrap Tags Input]
The npm package aurelia-bootstrap-tagsinput receives a total of 25 weekly downloads. As such, aurelia-bootstrap-tagsinput popularity was classified as not popular.
We found that aurelia-bootstrap-tagsinput 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.