2.0.1 • Published 5 years ago
ng-cemodel v2.0.1
ng-cemodel
Angular directive allowing you to bind ngmodel to contenteditable, complete with placeholder support
Installation
- install the directive
npm install --save ng-cemodel
or if you're using yarn:
yarn add ng-cemodel
- import it in your module file along with @angular/forms' FormModule
import { NgCemodelModule } from 'ng-cemodel';
import { FormsModule } from '@angular/forms';
@NgModule({
...
imports: [
...
FormsModule,
NgCemodelModule,
...
],
...
})
- you can now use this directive wherever you want!
<h1 name="title"
contenteditable
[(ngModel)]="title"
placeholder="it has a placeholder too!">
</h1>
features
This directive allows for both ngModel as well as formcontrol, on top of that it supports placeholder and has custom stylings when a contenteditable element with this directive is hovered