Skip to content
Advertisement

Tag: angular

Could not import js file into component.ts

Hello I developped an angular 12 app. I imported js to each component in the previous app on angular 9 like this : js file: component.ts file: and it worked very well but in the angular 12 app it doesn’t anymore and returns me this error: Could not find a declaration file for module ‘src/assets/js/file.js’. ‘c:/Users/…/src/assets/js/file.js’ implicitly has an ‘any’

I must avoid entering letters on my digipas

I have a small problem. When I enter a new transfert of 269 euros with the account bank number BE072750044-35066. I have to introduce a code of confirmation. The code is 350269. The figures 350 are the last 5 figures of the bank account number -> BE072750044-35066. And the 269 represents the amount for the new transfert. Another example, if

Listen when a Dom element appears in Angular

I have a search bar icon 🔍 when you click it the search bar appears ▭ The code responsable for showning the search bar ▭ : The Function: But I have this problem: 1- I need to wrap this.searchBarEl.setFocus(); inside setTimeout because the search bar is wrapped inside *ngIf=”shouldShowSearchBar” which is not rendered so fast so if I don’t wrap

Calling JavaScript from component template

I’m working on integrating payment forms from a third party, by using the Link to Javascript they provide. when I place the code in the index.html page its works just fine, but when I move the code to the component template is not working, below is part of the code: this is the script code to initialize the payment form:

Angular directive not working with ng-container

The given below code ng-if is not working as expected if displayGroup value is D then it will print the first and Second block, did I made any mistake Answer If you want to check bookTravelInfo.displayGroup is either ‘A’ or ‘B’ or ‘C’, Use || Logical OR operator from your *ngIf will never return false. As the boolean result returned

how to make a loop on a json file?

I have to handle a JSON file. In JSON BLOCAGES -> BLOCAGE > I have to retrieve QTE and DTE. Here is my file JSON here My problem is that, I display QTE and DTE one time. For now, I have this => enter image description here I want to get this result => enter image description here I’m missing

How to get current row HTML Table cell element?

I have a angular material table. If I click one row, i wanted to fetch the HTMLTableCellElement of the selected row . I tried using viewChild but the problem is i am getting whole table html element. Expected output Below is my code. Please Help me to acheive this scenario ! https://stackblitz.com/edit/angular-material-table-data-source-nym2vx?file=app/app.component.html Answer There are two changes you can make

Advertisement