1.6.0 • Published 8 years ago
angular2-color-picker-mani v1.6.0
angular2-color-picker
Angular 2 Color Picker Directive/Component with no dependencies required. This is a Color Picker Directive/Component for Angular 2.
Installation
npm i --save angular2-color-picker-maniUsage
- Use it in your HTML elements, for example:
<input [(colorPicker)]="color" [style.background]="color" [value]="color"/>- Or:
<input [colorPicker]="color" (colorPickerChange)="color=$event" [style.background]="color" [value]="color"/>- Add ColorPickerModule in your app.module.ts:
import {ColorPickerModule} from 'angular2-color-picker';
@NgModule({
...
imports: [ColorPickerModule]
})- Set color the variable. You can use ColorPickerService in your component if you want extra functions.
import {Component} from '@angular/core';
import {ColorPickerService} from 'angular2-color-picker';
@Component({
selector: 'my-app',
templateUrl: 'app/demo.html'
})
export class AppComponent {
private color: string = "#127bdc";
constructor(private cpService: ColorPickerService) {
}
}- Configure system.config.js
var map = {
...
'angular2-color-picker': 'node_modules/angular2-color-picker'
};
var packages = {
...
'angular2-color-picker': {main:'index.js', defaultExtension: 'js'}
};#Options Default option is the first item.
[cpOutputFormat]="'hex', 'rgba', 'hsla'"
[cpPosition]="'right', 'left', 'top', 'bottom'"
[cpPositionOffset]="'0%'"
[cpPositionRelativeToArrow]="false, true"
[cpWidth]="'230px'"
[cpHeight]="'auto'"
[cpSaveClickOutside]="true, false"
[cpOKButton]="false, true"
[cpOKButtonClass]="''"
[cpOKButtonText]="'OK'"
[cpCancelButton]="false, true"
[cpCancelButtonClass]="''"
[cpCancelButtonText]="'Cancel'"
[cpFallbackColor]="'#fff'"
[cpPresetLabel]="'Preset colors'"
[cpPresetColors]="[]", e.g: "['#fff', '#000']"
[cpToggle] = "false, true"
[cpIgnoredElements]="[]"
[cpDialogDisplay]="'popup,' 'inline'"
[cpAlphaChannel]="'hex6', 'hex8', 'disabled'"#Tested in:
- Chrome
- Firefox
- Microsoft Edge
- Opera
- Safari
- Internet Explorer
1.6.0
8 years ago
1.5.6
8 years ago
1.5.5
8 years ago
1.5.4
8 years ago
1.5.3
8 years ago
1.5.2
8 years ago
1.5.1
9 years ago
1.5.0
9 years ago
1.4.9
9 years ago
1.4.8
9 years ago
1.4.7
9 years ago
1.4.6
9 years ago
1.4.5
9 years ago
1.4.4
9 years ago
1.4.3
9 years ago
1.4.2
9 years ago
1.4.1
9 years ago
1.4.0
9 years ago
1.3.15
9 years ago
1.3.14
9 years ago
1.3.13
9 years ago
1.3.12
9 years ago
1.3.11
9 years ago
1.3.10
9 years ago
1.3.9
9 years ago
1.3.8
9 years ago
1.3.7
9 years ago
1.3.6
9 years ago
1.3.5
9 years ago
1.3.4
9 years ago
1.3.3
9 years ago
1.3.2
9 years ago
1.3.1
9 years ago