Skip to content

Commit

Permalink
Merge pull request #373 from ckeditor/i/367
Browse files Browse the repository at this point in the history
Other: Added the `getId()` method that returns the component id. Closes #367.
pomek authored Jun 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2b3c88b + e1fdc9f commit e4bf808
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ckeditor/ckeditor.component.spec.ts
Original file line number Diff line number Diff line change
@@ -204,6 +204,10 @@ describe( 'CKEditorComponent', () => {

expect( component.editorInstance!.data.get() ).toEqual( updatedText );
} );

it( 'should return component id', async () => {
expect( component.getId() ).toMatch( /e[0-9a-z]{32}/ );
} );
} );

describe( 'emitters', () => {
4 changes: 4 additions & 0 deletions src/ckeditor/ckeditor.component.ts
Original file line number Diff line number Diff line change
@@ -233,6 +233,10 @@ export class CKEditorComponent<TEditor extends Editor = Editor> implements After

private id = uid();

public getId(): string {
return this.id;
}

public constructor( elementRef: ElementRef, ngZone: NgZone ) {
this.ngZone = ngZone;
this.elementRef = elementRef;

0 comments on commit e4bf808

Please sign in to comment.