geokbd-angular v1.0.4
geokbd-angular
is a virtual keyboard for Georgian writing, implemented in Angular as a pipe for version 2+.
Install
npm install geokbd-angular --save
This pipe needs two way data binding, so you need to import FormsModule
with GeokbdPipe
in app.module.ts
file.
import { FormsModule } from '@angular/forms';
import { GeokbdPipe } from 'geokbd-angular';
@NgModule({
declarations: [
AppComponent,
GeokbdPipe
],
imports: [
BrowserModule,
FormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
Add geokbd
pipe to any of your input fields in your component:
<input type="text" [(ngModel)]="title" [value]="title | geokbd:true">
Note that geokbd
has one boolean parameter.
You can set it from template as shown or use a variable if you want to switch Georgian writing on or off in runtime.
If you do not provide any parameter, pipe will not do anything and you will get your original (system) language typed in the field.
You can use variable for geokbd
parameter like this:
In your component:
export class AppComponent {
title: string;
geoKbdEnabled = true; //or false
}
In your Template:
<input type="text" [(ngModel)]="title" [value]="title | geokbd:geoKbdEnabled">
In this case you can switch writing in runtime.
GeoKbd
Instead of reinventing a bicycle I just copied (thanks to ioseb) the working code from original geokbd
.
You can find original geokbd
here.