New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

frontal

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frontal

An Angular select/dropdown component

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
22
100%
Maintainers
1
Weekly downloads
 
Created
Source

Frontal

An Angular select/dropdown component

Installation

Install frontal from npm:

npm install frontal

Usage

Import the FrontalModule:

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    FrontalModule,
  ],
})
export class AppModule {}

Use the frontal component and directives:

<frontal [itemToString]="heroToString">
  <ng-template let-value="inputValue" let-isOpen="isOpen" let-highlightedIndex="highlightedIndex"
   let-selectedItem="selectedItem">
    <label frontalLabel>Select your hero:</label>
    <input type="text" frontalInput/>

    <ul *ngIf="isOpen" frontalList>
      <li *ngFor="let hero of filteredHeroes(value); let index=index;" frontalItem [value]="hero"
       [class.highlight]="highlightedIndex === index">
        {{hero.name}}
      </li>
    </ul>

    <div *ngIf="isOpen && filteredHeroes(value).length === 0">
      No heroes found...
    </div>

    <h4>Selected hero:</h4>
    <pre>{{selectedItem | json}}</pre>
  </ng-template>
</frontal>

Example

A couple of implementations can be found on StackBlitz.

Inspiration

By taking in all this information, I wondered how this would look like in Angular.

Keywords

Angular

FAQs

Package last updated on 15 Apr 2018

Did you know?

Socket

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.

Install

Related posts