https://angular.io/guide/elements
Before asking i try to find solution by myself but i can't solve my issue.
I have a web component (for example <test-component></test-component>
)
And for initialization i need pass to it some param (for example some-string-url
).
When i try to do it like that <test-component some-string-url="https://example.com"></test-component>
everything works fine, but that param should be dynamic for each website or appliaction, so when i try to do that like that:
<test-component [some-string-url]="someVariable"></test-component>
or
<test-component some-string-url="{{ someVariable }}"></test-component>
it doesn't work. The only way what i found it's create component and append it to the div like that:
const widget = document.createElement('test-component');
widget.setAttribute('some-string-url', this.exampleUrl);
document.getElementById('widget-container').append(widget);
but is there i can use another way to pass param?
P.S. ngOnChanges() didn't see any changes and don't triggered at all.
UPDATE:__________________________________________
I need to get @Input property from variable inside my web component (https://angular.io/guide/elements), for example <test-component [some-string-url]="someVariable"></test-component>
should get me some-string-url
inside my web-component.
Currently i've got undefined
when i try to get some-string-url
inside onInit, afterviewchecked.
Similar question but without solution Angular Elements: @Input decorator not working with variables