title: ckeditor5 text-alignment plugin not working
body: <ul>
  <li><p>I followed the installation steps for text alignment plugin as mentioned in the <a href="https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/features/text-alignment.html#installation" rel="nofollow noreferrer">docs</a> of ckeditor5.</p></li>
  <li><p>Added the alignment plugin as below</p></li>
  </ul>
  
  <blockquote>
    <p>import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
        ClassicEditor
          .create(this.element.nativeElement,  {
            plugins: [ Alignment ],
            toolbar: [ 'alignment' ]
        })</p>
  </blockquote>
  
  <p>I am getting the below error:</p>
  
  <pre><code>TypeError: Cannot read property 'getAttribute' of null
      at IconView._updateXMLContent (iconview.js:100)
      at IconView.render (iconview.js:76)
      at IconView.on (observablemixin.js:241)
      at IconView.fire (emittermixin.js:196)
      at IconView.(anonymous function) [as render] (webpack-internal:///./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js:249:16)
      at ViewCollection.on (viewcollection.js:68)
      at ViewCollection.fire (emittermixin.js:196)
      at ViewCollection.add (collection.js:182)
      at ButtonView.render (buttonview.js:160)
      at ButtonView.on (observablemixin.js:241)
  </code></pre>
  
  <p>Can someone help me how to tackle this? Followed the steps as mentioned in the docs but still having this issue.</p>
  
  <p>Here is the complete angular5 component code for ckeditor:</p>
  
  <pre><code>import { Component, OnInit, OnDestroy, NgZone, ElementRef, ChangeDetectionStrategy, forwardRef } from '@angular/core';
  import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
  import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
  
  @Component({
    selector: 'ck-editor',
    template: '&lt;textarea&gt;&lt;/textarea&gt;',
    styleUrls: ['./ck-editor.component.scss'],
    providers: [{
      provide: NG_VALUE_ACCESSOR,
      useExisting: forwardRef(() =&gt; CkEditorComponent),
      multi: true
    }],
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class CkEditorComponent implements ControlValueAccessor, OnInit, OnDestroy {
  
    onChange: Function;
    onTouched: Function;
    model: string;
    editor;
  
    constructor(private ngZone: NgZone,
      private element: ElementRef) {
    }
  
    ngOnInit() {
      ClassicEditor
        .create(this.element.nativeElement,  {
        plugins: [Alignment],
        toolbar: [
            'heading', '|', 'bulletedList', 'numberedList', 'alignment', 'undo', 'redo'
        ]
      })
        .then(editor =&gt; {
          this.editor = editor;
          editor.model.document.on('change', () =&gt; {
            if (editor.model.document.differ.getChanges().length &gt; 0) {
              this.ngZone.run(() =&gt; this.onChange(editor.getData()));
            }
          });
          editor.model.document.on('blur', () =&gt; {
            this.ngZone.run(() =&gt; this.onTouched());
          });
          this.editor.setData(this.model ? this.model : '');
        })
        .catch(error =&gt; {
          console.error(error);
        });
    }
  
    ngOnDestroy() {
      if (this.editor) {
        return this.editor.destroy();
      }
    }
  
    writeValue(value) {
      this.model = value;
    }
  
    registerOnChange(fn) {
      this.onChange = fn;
    }
  
    registerOnTouched(fn) {
      this.onTouched = fn;
    }
  
  }
  </code></pre>