I've created my own webcomponent based on angular elements. I made everything according to manual.
The sample code is:
const el = createCustomElement(AppComponent, { injector: this.injector });
customElements.define('my-widget', el);
I have ApplicationService as well:
@Injectable({ providedIn: 'root' })
export class ApplicationService {}
After all when I run my pretty 'my-widget' element - 1 instance works well. But if I run twice it looks like the ApplicationService always run only once (singleton instance).
Example:
<my-widget id="widget1"></my-widget>
<my-widget id="widget2"></my-widget>
I want to achieve that every will have the own instance.
I was looking for solution and I noticed that config has additional field like: strategyFactory
in createCustomElement
{ injector: Injector; strategyFactory?: NgElementStrategyFactory; }
I am not sure how to use it. Have you any ideas?