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’
Tag: angular
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
Selected text appearing after mouseup disappears with any click
I have written code in my Angular app to get the text snippet selected/highlighted by the user into a text area: In my component, I have: This works; meaning the text I select appears in the text box, but as soon as I click in that box (or click anywhere on the page) the text disappears. What am I doing
Angular, resetting input field back to a default value
In the following example i want to be able to reset input field to default value, (after user might have changed the input value manually) the main problem is, that default value never changes, so re-setting it does nothing Template Component Answer You could use Template variable: See StackBlitz example.
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
How to set html body max width 650px with responsive content with javascript or jquery
Hello I am working on one website that website basically for all like desktop, iPad and phone and this website is fully responsive and I have used bootstrap and some other @media rule so currently when I resize the window then automatically adjust this website so now my expectation is that. Expectation : I have a html body and I
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