<commit_before>import { Component, ComponentRef, ViewContainerRef, ViewChild } from '@angular/core';
import { ComponentFactoryResolver } from '@angular/core/src/linker/component_factory_resolver';
import { RuntimeCompiler } from '@angular/compiler';

declare var System: any;

@Component({
    selector: 'app-placeholder',
    template: `<span #content></span>`,
    inputs: ['initialConfig', 'componentPath', 'componentName'],
})
export class AppPlaceHolderComponent {
    initialConfig: any;

    _componentPath: string;
    _componentName: string;
    _currentComponent: ComponentRef<any>;

    get componentPath() {
        return this._componentPath;
    }

    set componentPath(value) {
        this.reloadComponentIfNeeded(value, this.componentName);
        this._componentPath = value;
    }

    get componentName() {
        return this._componentName;
    }

    set componentName(value) {
        this.reloadComponentIfNeeded(this.componentPath, value);
        this._componentName = value;
    }

    constructor(
        private viewContainerRef: ViewContainerRef,
        private compiler: RuntimeCompiler) {
    }

    private reloadComponentIfNeeded(componentPath: string, componentName: string) {
        if (componentPath && componentName && (this.componentPath != componentPath || this.componentName != componentName))
            this.reloadComponent();
    }
<commit_msg>Make sure initialConfig is propagated to active plugin<commit_after>import { Component, ComponentRef, ViewContainerRef, ViewChild } from '@angular/core';
import { ComponentFactoryResolver } from '@angular/core/src/linker/component_factory_resolver';
import { RuntimeCompiler } from '@angular/compiler';

declare var System: any;

@Component({
    selector: 'app-placeholder',
    template: `<span #content></span>`,
    inputs: ['initialConfig', 'componentPath', 'componentName'],
})
export class AppPlaceHolderComponent {
    _initialConfig: any;
    _componentPath: string;
    _componentName: string;
    _currentComponent: ComponentRef<any>;

    get componentPath() {
        return this._componentPath;
    }

    set componentPath(value) {
        this.reloadComponentIfNeeded(value, this.componentName);
        this._componentPath = value;
    }

    get componentName() {
        return this._componentName;
    }

    set componentName(value) {
        this.reloadComponentIfNeeded(this.componentPath, value);
        this._componentName = value;
    }
    
    get initialConfig() {
        return this._initialConfig;
    }
    
    set initialConfig(value) {
        this._initialConfig = value;
        if (this._currentComponent)
            this._currentComponent.instance.initialConfig = value;
    }

    constructor(
        private viewContainerRef: ViewContainerRef,
        private compiler: RuntimeCompiler) {
    }

    private reloadComponentIfNeeded(componentPath: string, componentName: string) {
        if (componentPath && componentName && (this.componentPath != componentPath || this.componentName != componentName))
            this.reloadComponent();
    }

{'fraction_non_alphanumeric': 0.10207388204795852, 'fraction_numerical': 0.0, 'mean_word_length': 3.519765739385066, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5110833', 'n_tokens_mistral': 808, 'n_tokens_neox': 789, 'n_words': 179}