Skip to content
Advertisement

Tag: angular

Unable to call a JS function from Typescript in Angular 13

I’m trying to call the following function, LoadMultiSelect(), from one of my components because I am using a non-Angular library: https://ibnujakaria.github.io/multiple-select-js/ This works perfectly in the console: And loads the JS component. Later, I try adding it in Angular, but I cannot find how to. I tried to export the JS function in two ways: And like this: I created

Importing JS bundle to an Angular Library

I am trying to add a JS script bundle file to a custom Angular Library which is using features from it. I have added the types files so the linting errors are not showing, but the Project does not get built as classes from JS Bundle are not found. I have tried and failed importing the bundle to the public-api

How to make sure ngAfterViewInit runs after a certain HTML element is rendered?

In HTML, there is a <a> that redirects to another component, and after that scrolls to a certain anchor. In the target component, I have the following code However, I found that document.getElementById(fragment); is always null, because this element is displayed conditionally using ngIf = booleanVariable, and when this ngAfterViewInit life cycle hook runs, this booleanVariable is not calculated yet.

Advertisement