Introduction
In this article, we will learn how to add In-place Editor in the Angular application. In-Place Editor component is used to edit a value within its context (in-place).
Prerequisites
- Basic Knowledge of Angular 2 or higher
- Visual Studio Code
- Node and NPM installed
- Bootstrap
Create an Angular Project
Create an Angular project by using the following command,
ng new synDemo
Open this project in Visual Studio Code install the following Libraries, To install, use the following command,
npm install @syncfusion/ej2-angular-inplace-editor
npm install @syncfusion/ej2-angular-buttons
npm install @syncfusion/ej2-angular-dropdowns
Now install Bootstrap by using the following command,
npm install bootstrap --save
Now open the styles.css file and add Bootstrap file reference. To add a reference in the styles.css file add this line.
@import '~bootstrap/dist/css/bootstrap.min.css';
Now open app.module.ts file, add the following code to this file.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { CheckBoxModule } from '@syncfusion/ej2-angular-buttons';
import { DropDownListModule } from '@syncfusion/ej2-angular-dropdowns';
import { InPlaceEditorModule } from '@syncfusion/ej2-angular-inplace-editor';
@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
AppRoutingModule,FormsModule,
ReactiveFormsModule,CheckBoxModule,
InPlaceEditorModule, DropDownListModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Now create a new component by using the following command,
ng g c home
Now open home.component.html file and add the following code,
<div class="container" style="margin-top:10px;margin-bottom: 24px;">
<div class="col-sm-12 btn btn-info">
How To Use Syncfusion In-place Editor In Angular Application
</div>
</div>
<div class="col-lg-8 control-section inplace-control-section input-layout container">
<div class="control_wrapper">
<table>
<tr>
<td>
<label class="control-label" style="text-align: left;font-size: 14px;font-weight: 400">
User Name </label>
</td>
<td>
<ejs-inplaceeditor #inplace_editor mode="Inline" [popupSettings]="settings" [model]="overviewModel"
type="Text" [(ngModel)]="username"></ejs-inplaceeditor>
</td>
</tr>
<tr>
<td>
<label class="control-label" style="text-align: left;font-size: 14px;font-weight: 400">
City </label>
</td>
<td>
<ejs-inplaceeditor #inplace_editor mode="Inline" [popupSettings]="settings" [model]="overviewModel"
type="Text" [(ngModel)]="city"></ejs-inplaceeditor>
</td>
</tr>
</table>
</div>
</div>
Now open home.component.ts file and add the following code,




Join the conversation! Your thoughts help the community grow.