Question: I create an angular6 library call mapModule, and be imported into app module, now I want to do something before load mapModule, so I try to add **APP\_INITIALIZER** in this library :

```
export function StartupServiceFactory2(mapConfigService: MapConfigService) {
    const x = 2 + 2; 
    console.log(x);
    return () => mapConfigService.readConfig();
}

```

but it doesn't work

Answer: 
This is easier to achieve if you use a string prop instead of a slot, but then using the component in a template can become messy if the content is long.

If you write the render function by hand then you have more control over how the component should be rendered:

```
export default {
  render(h) {
    const slot = this.$slots.default[0]

    return /title/i.test(slot.text)
      ? h('h1', [slot])
      : /paragraph/i.test(slot.text)
        ? h('p', [slot])
        : slot
  }
}

```

The above render function only works provided that the default slot has only one text child (I don't know what your requirements are outside of what was presented in the question).
You can use `$slots`(<https://v2.vuejs.org/v2/api/#vm-slots>):

```
export default {
    methods: {
        changeSlotStructure() {
            let slot = this.$slots.default;
            slot.map((x, i) => {
                if(x.text.includes('title')) {
                    this.$slots.default[i].tag = "h1"
                } else if(x.text.includes('paragraph')) {
                    this.$slots.default[i].tag = "p"
                }
            })
        }
    },
    created() {
        this.changeSlotStructure()
    }
}

```