Skip to content

Commit

Permalink
chore(core): correct initialize spell
Browse files Browse the repository at this point in the history
  • Loading branch information
pubuzhixing8 committed Aug 19, 2021
1 parent 38b6692 commit 7aeb851
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/src/components/text/void-text.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SlateVoidTextComponent extends BaseTextComponent implements OnInit,
}

ngOnChanges() {
if (!this.initailzed) {
if (!this.initialized) {
return;
}
this.isLeafBlock = AngularEditor.isLeafBlock(this.viewContext.editor, this.context.parent);
Expand Down
18 changes: 9 additions & 9 deletions packages/src/view/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export abstract class BaseComponent<T = SlateTextContext | SlateLeafContext | Sl
* base class for custom leaf component
*/
export class BaseLeafComponent extends BaseComponent<SlateLeafContext> implements OnInit {
initailzed = false;
initialized = false;

@HostBinding('attr.data-slate-leaf') isSlateLeaf = true

Expand All @@ -66,11 +66,11 @@ export class BaseLeafComponent extends BaseComponent<SlateLeafContext> implement
}

ngOnInit() {
this.initailzed = true;
this.initialized = true;
}

onContextChange() {
if (!this.initailzed) {
if (!this.initialized) {
return;
}
this.cdr.markForCheck();
Expand All @@ -81,7 +81,7 @@ export class BaseLeafComponent extends BaseComponent<SlateLeafContext> implement
* base class for custom element component
*/
export class BaseElementComponent<T extends Element = Element, K extends AngularEditor = AngularEditor> extends BaseComponent<SlateElementContext<T>, K> implements OnInit, OnDestroy {
initailzed = false;
initialized = false;

childrenContext: SlateChildrenContext;

Expand Down Expand Up @@ -114,7 +114,7 @@ export class BaseElementComponent<T extends Element = Element, K extends Angular
for (const key in this._context.attributes) {
this.nativeElement.setAttribute(key, this._context.attributes[key]);
}
this.initailzed = true;
this.initialized = true;
}

updateWeakMap() {
Expand All @@ -134,7 +134,7 @@ export class BaseElementComponent<T extends Element = Element, K extends Angular

onContextChange() {
this.childrenContext = this.getChildrenContext();
if (!this.initailzed) {
if (!this.initialized) {
return;
}
this.cdr.markForCheck();
Expand All @@ -156,15 +156,15 @@ export class BaseElementComponent<T extends Element = Element, K extends Angular
* base class for custom text component
*/
export class BaseTextComponent extends BaseComponent<SlateTextContext> implements OnInit, OnDestroy {
initailzed = false;
initialized = false;

get text(): Text {
return this._context.text;
}

ngOnInit() {
this.updateWeakMap();
this.initailzed = true;
this.initialized = true;
}

updateWeakMap() {
Expand All @@ -179,7 +179,7 @@ export class BaseTextComponent extends BaseComponent<SlateTextContext> implement
}

onContextChange() {
if (!this.initailzed) {
if (!this.initialized) {
return;
}

Expand Down

0 comments on commit 7aeb851

Please sign in to comment.