Closed apriyadarshi38 closed 7 years ago
This feature will be added whit #57.
You will be able to do this:
import { Component } from '@angular/core';
import { InlineEditorComponent, InlineEvent } from 'ng2-inline-editor';
@Component({
selector: 'app-root',
templateUrl: '<inline-editor #editor [(ngModel)]="title" type="text" (onBlur)="save($event, editor)"></inline-editor>',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'hi';
save(event: InlineEvent, editor: InlineEditorComponent) {
// InlineEvent is a wrapper of {event: NativeEvent, state: State of input when it was saved}
this.title = event.state.value;
editor.saveAndClose({
state: {
value: this.title,
}
});
}
}
👍
This should be fixed in the last version (0.2.0-alpha.0
). With the change of name, you should do an npm i @qontu/ngx-inline-editor
and update your imports 👍
can i get event when focus out from input field??????