
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
angular-custom-selector
Advanced tools
```bash NOTE*** This library was generated using Angular CLI version 9.0.0. Therefore, it is recommended that you use a compatible version of Angular to ensure proper functionality ```
NOTE*** This library was generated using Angular CLI version 9.0.0. Therefore, it is recommended that you use a compatible version of Angular to ensure proper functionality

This package offers an intuitive interface that enables users to select multiple options from a dropdown list. It includes various customization options to allow developers to tailor the selector according to their specific needs, such as customizing labels, styling, and available options. It features a search and filter functionality that enables users to quickly locate the desired value from a vast list of options. Additionally, this package supports the selection of nested options, which is useful when dealing with complex data hierarchies.
Install angular-custom-selector with npm
npm i angular-custom-selector
Finally, you need to import the related styles into your project's angular.json file. To do so, simply add the following path to your styles property under architect.
'node_modules/angular-custom-selector/src/lib/assets/styles/styles.scss'
"architect": {
"build": {
...,
"styles": [
...,
"node_modules/angular-custom-selector/src/lib/assets/styles/styles.scss"
],
...,
}
After completing all of these steps, if you still run into a problem, you have to make sure to check the following things as well.
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
declarations: [
AppComponent
],
imports: [
...,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
ng add @angular/localize
As an example, you can use the module import in your corresponding Module class.
import { AngularCustomSelectorModule } from 'angular-custom-selector';
@NgModule({
imports: [
...
AngularCustomSelectorModule
]
})
export class AppModule { }
The angular-custom-selector package is a convenient wrapper that allows you to use the HTML selector component in any part of your Angular application. By importing the module and using the selector in your HTML templates, you can quickly and easily create custom selector components that can be customized to suit your needs.
<angular-custom-selector type="multi" labelText="Items" [data]="dataHierachy" selectedName="Select"
(onChange)="updateState($event)" hoverText="Select Location" [enableAllNodes]="true"
(onFetchedData)="onFetched($event)" displayName="name" [disabled]="false" searchKey="name" >
</angular-custom-selector>
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
selectedName: string = 'Country_1';
public selectorDisabled: boolean = false;
// Need to initialize with your data hierarchy.
public dataHierarchy: Array<any> = data;
public updateState(dataItem:any){
console.log(dataItem);
}
onFetched(data:any){
console.log(data);
}
}
| Inputs | Type | Description |
|---|---|---|
type | string | type can be single or multi. Default value of type is 'single' so that is single value selector. (Ex:- type="multi" or type="single") |
labelText | string | Label for the selection field. |
hoverText | string | Text that shows when hovering the component. |
[data] | Array<any> | Input data hierarchy for the component should include elements with unique IDs, names, items field that describes child elements, and isSelectable fields that describe the selectable status of each element. Other fields may vary depending on your requirements. |
selectedName | string | Default selected name of the component. |
[enableAllNodes] | boolean | This can be used to enable all nodes, regardless of the isSelectable field of each element. |
[disabled] | boolean | That can be used for disable the component. |
displayName | string | That will be the display name of each elements in dropdown. This value must be a property of each element in the hierarchy (usually it can be used as the name, but it depends on your requirements). |
searchKey | string | Key that we are used for search items our dropdown. This value must be a property of each element in the hierarchy (usually it can be used as the name, but it depends on your requirements). |
| Outputs | Type | Description |
|---|---|---|
(onFetchedData) | EventEmitter | The event triggers when all the data hierarchies have been fetched into the component. |
(onChange) | EventEmitter | The event is triggered when the user's selection has changed. |
| Class Name | Description |
|---|---|
.k-treeview | For customize styles of treeview. |
.k-input | For customize the search field in treeview. |
.k-in | For customize each field in treeview. |
.d-flex | For customize styles of selected text of the dropdown. |
***NOTE: you have to use [:host ::ng-deep] with your class name for overwrite default styles. As below example,
:host ::ng-deep .k-treeview{
font-family: 'Courier New', Courier, monospace;
}
export const data = [
{
id: 1,
name: "Country_1",
isSelectable: false,
items: [
{
id: 45,
name: "Region_1",
isSelectable: false,
items: [
{
id: 48,
name: "Area_1",
isSelectable: true,
items: [],
itemCode: "10102"
},
{
id: 60,
name: "Area_2",
isSelectable: true,
items: [],
itemCode: "10103"
}
],
itemCode: "10234"
},
{
id: 38,
name: "Region_2",
isSelectable: false,
items: [
{
id: 56,
name: "Area_1",
isSelectable: true,
items: [],
itemCode: "10564"
}
],
itemCode: "10765"
},
{
id: 61,
name: "Region_3",
isSelectable: false,
items: [
{
id: 62,
name: "Area_1",
isSelectable: false,
items: [
{
id: 63,
name: "Semi-Area_1",
isSelectable: true,
items: [],
itemCode: "10878"
},
{
id: 129,
name: "Semi-Area_2",
isSelectable: true,
items: [],
itemCode: "10986"
},
{
id: 125,
name: "Semi-Area_3",
isSelectable: true,
items: [],
itemCode: "10743"
}
],
itemCode: "12467",
},
{
id: 76,
name: "Area_2",
isSelectable: true,
items: [],
itemCode: "12477",
},
{
id: 15,
name: "Area_3",
isSelectable: true,
items: [],
itemCode: "10632"
},
{
id: 21,
name: "Area_4",
isSelectable: true,
items: [],
itemCode: "13487"
}
],
itemCode: "12346"
}
],
itemCode: "12343"
}]
FAQs
```bash NOTE*** This library was generated using Angular CLI version 9.0.0. Therefore, it is recommended that you use a compatible version of Angular to ensure proper functionality ```
We found that angular-custom-selector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.