damiandennis / ng2-select-view

Group of components to enhance the functionality of a select list. Influenced largely by the select2 project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular Select View

Group of components to enhance the functionality of a select list. Influenced largely by the select2 project.

Currently select2@3.5.1 will need to be installed along side this project and css included in your html for it to work.

Installation

npm install select2@3.5.1 ng2-select-view --save

Usage

In your html page

<!doctype html>
<html>
    <head>
        ...
        <link rel="stylesheet" href="node_modules/select2/select2.css" />
        <link rel="stylesheet" href="node_modules/select2/select2-bootstrap.css" />
        ...
    </head>
    ...
</html>
import {NgModule} from "@angular/core";
import {SelectViewModule} from "ng2-select-view/lib/select-view.module";

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

Somewhere in your project

<c-list-one [options]="[{key: '1', value: 'Hello', {key: '2', value: 'Goodbye'}}]" [(ngModel)]="myValue"></c-list-one>
<c-list-many [options]="[{key: '1', value: 'Hello'}, {key: '2', value: 'Goodbye'}]" [(ngModel)]="myListValue"></c-list-many>

About

Group of components to enhance the functionality of a select list. Influenced largely by the select2 project.


Languages

Language:TypeScript 71.1%Language:HTML 26.9%Language:CSS 1.0%Language:JavaScript 1.0%