Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
ember-cli-auto-complete
Advanced tools
ember-cli addon that provides type-ahead selection for text inputs
ember-cli addon that provides type-ahead selection for text inputs
npm install ember-cli-auto-complete --save-dev
First add a custom component that extends the AutoComplete component. In this component you will need to declare 2 computed properties.
import AutoComplete from "ember-cli-auto-complete/components/auto-complete";
export default AutoComplete.extend({
suggestions: function() {
var inputVal = this.get("inputVal") || "";
return this.get("options").filter(function(item) {
return item.get("value").toLowerCase().indexOf(inputVal.toLowerCase()) > -1;
});
}.property("inputVal", "options.@each"),
optionsToMatch: function() {
var caseInsensitiveOptions = [];
this.get("options").forEach(function(item) {
var value = item.get("value");
caseInsensitiveOptions.push(value);
caseInsensitiveOptions.push(value.toLowerCase());
});
return caseInsensitiveOptions;
}.property("options.@each")
});
Next prepare a list of options for the component with both a value and label property
export default Ember.Route.extend({
model: function() {
var options = [];
options.pushObject(Foo.create({value: "ABC", label: "SOMETHING 1"}));
options.pushObject(Foo.create({value: "ABCD", label: "SOMETHING 2"}));
options.pushObject(Foo.create({value: "ABCDE", label: "SOMETHING 3"}));
return Ember.RSVP.hash({
model: Bar.create(),
options: options
});
},
setupController: function(controller, hash) {
controller.set("model", hash.model);
controller.set("options", hash.options);
}
});
Now add the html to your template for the custom component you declared above.
{{my-auto-complete options=options selectedValue=model.code placeHolderText="Find a thing" noMesssagePlaceHolderText="No things are found" showValue=true}}
npm install
bower install
ember test
1) npm install
2) bower install
3) ember server
4) localhost:4200
Copyright © 2015 Toran Billups http://toranbillups.com
Licensed under the MIT License
FAQs
ember-cli addon that provides type-ahead selection for text inputs
The npm package ember-cli-auto-complete receives a total of 0 weekly downloads. As such, ember-cli-auto-complete popularity was classified as not popular.
We found that ember-cli-auto-complete 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.