Skip to content

Added @Output events #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"style": "kebab-case"
}
],
"@angular-eslint/no-output-on-prefix": 0
"@angular-eslint/no-output-on-prefix": 0,
"@angular-eslint/no-output-rename": 0
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AfterViewInit, Component, ElementRef, forwardRef, Inject, Input } from '@angular/core';
import {AfterViewInit, Component, ElementRef, EventEmitter, forwardRef, Inject, Input, Output} from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { EditorLocale, EditorOption } from './models';
import { GlobalEditorOptions } from './global-editor-options';
Expand Down Expand Up @@ -33,6 +33,18 @@ export class AngularMarkdownEditorComponent implements AfterViewInit {
/** Number of rows for the textarea */
@Input() rows = 10;

/** These do not actually ever emit, since bootstrap-markdown already emits the event. This is simply just for typings **/
@Output('onShow') private readonly _onShow: EventEmitter<any> = new EventEmitter<any>();
@Output('onPreview') private readonly _onPreview: EventEmitter<any> = new EventEmitter<any>();
@Output('onPreviewEnd') private readonly _onPreviewEnd: EventEmitter<any> = new EventEmitter<any>();
@Output('onSave') private readonly _onSave: EventEmitter<any> = new EventEmitter<any>();
@Output('onBlur') private readonly _onBlur: EventEmitter<any> = new EventEmitter<any>();
@Output('onFocus') private readonly _onFocus: EventEmitter<any> = new EventEmitter<any>();
@Output('onChange') private readonly _onChange: EventEmitter<any> = new EventEmitter<any>();
@Output('onFullscreen') private readonly _onFullscreen: EventEmitter<any> = new EventEmitter<any>();
@Output('onFullscreenExit') private readonly _onFullscreenExit: EventEmitter<any> = new EventEmitter<any>();
@Output('onSelect') private readonly _onSelect: EventEmitter<any> = new EventEmitter<any>();

public value: any | any[];
public onModelChange: Function = () => { };
public onModelTouched: Function = () => { };
Expand Down