You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

click-edit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

click-edit

In Angular application, Lets user click on text to edit the contents

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
64
77.78%
Maintainers
1
Weekly downloads
 
Created
Source

click-edit

Let's user click on text to edit the contents only if there is a difference and thus reduce the number of unnecessary API calls.

Installation

npm

npm install click-edit --save

Usage

Import ClickEditModule

You need to Import and add the ClickEditModule in the module of your app where you want to use it.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { ClickEditModule} from 'click-edit';

// ..

@NgModule({
  // ..

  imports: [
    BrowserModule,
    ClickEditModule
  ],

  // ...
})

Uses in component's view

Add the clickEdit directive to the element.

<p clickEdit (onContentChange)="onChange($event)">
    Some text which will be edited.
</p>

API

Attributes

AttributeTypeDefaultDescription
canEditbooleantrueWhether the text should be editable or not.
multilinebooleanfalseWhether pressing enter key should create a newline
true: Enter key will not emit edited value (It will be emitted on blur).
contentIdnumberWhether need to reference the identifier of the change.
contentLabelstringWhether need to indicate what field is being changed.
contentClassstringeditingStyle the element during editing using this class.

Events

You can listen in on when the text field contents have changed.

EventTypeDescription
onContentChangecustomEventFired only when the content has been successfully changed to a new value.




This project was generated with Angular CLI version 8.3.17.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Keywords

Angular

FAQs

Package last updated on 22 Jul 2020

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