Questions tagged window

Explore the latest questions and answers asked by our top developers.

I am installing Angular12 and i am experiencing the below errs pls what can i do. does it have to do with the window version?

– Installing packages (npm)…npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/compiler-cli npm ERR! dev @angular/[email protected]"~12.2.0-next.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/[email protected]"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected] npm ERR! […]

How to add extra query parameter in this scenario (JS/Angular.js)

I have the following logic where it removes specified query parameter however at the same time I need to add other parameter search=’tags’ var query = $stateParams.related_items? $window.location.search.replace(/[?&]related_items=[^&]+/, ”).replace(/^&/, ‘?’): $window.location.search How can I add above mentioned search query parameter on this logic? Source: AngularJS Questions

window:afterprint not working after window.print() in Angular

I am opening window.print() on a button <button class="btn btn-primary" type="button" (click)="printDocument()"> Print </button> on that printDocument method, I opened the doc in a new window and called window.print(). printDocument() { let str = `https://beta.lottoweaver.com/WeaverDoc/commonContent/www.nationallottery.co.za/playerDocument/408466_ID_PROOF_null_1614276509176.jpg`; this.OpenWindow = window.open("","","width=900, height=600, left=200, top=100"); this.OpenWindow.document.body.innerHTML = str; this.OpenWindow.print(); } Now, after the user cancels or print the document, […]

By Nehal
Published
Categorized as angular, window Tagged ,

is there any way to call an async function before the page reload in angular project?

I need to call an async function when the user clicks on f5 or the browser reload. I already tried using 1- window:beforelolad but it doesn’t work with the browser reload button also cannot catch confirm value if it is yes or no. 2- tried navigation start and I can check the reload after the […]

By Mohamed Attia
Published
Categorized as angular, refresh, window Tagged , ,

Minimize browser window in Angular 8

I have open browser window using window.open(<MyServerURL>) and I have created my own control buttons like close(X) and minimize(-) so I want to minimize browser on minimize button click. Thank you in advance… Source: Angular Questions

By Jignesh Gothadiya
Published
Categorized as angular, javascript, jquery, minimize, window Tagged , , , ,

How can I get final response from child window in electron app

I have an electron app, I want to capture child windows network response for a specific URL. I did the below implementation but it does not work const openLoginWindow = async () => { const childWindow = new BrowserWindow({ parent: parentWindow, closable: true, titleBarStyle: "hidden", show: false, minWidth: 700, minHeight: 500, webPreferences: { nodeIntegration: false, […]

Browser back button changes URL immediately

I have a use case where a user clicks on Browser back button and angular’s URL changes immediately without considering CanDeactivate guard of a page. I have a confirmation popup which pops on clicking back button of browser which tells user that he has changed the form. When the user clicks cancel on the confirmation […]

By Jagjyot Singh
Published
Categorized as angular, browser, forms, popup, window Tagged , , , ,

How to capture anctions window:beforeunload Angular 8

I have a problem with window event beforeunload in Angular app. i wants to check if the user navigate to another page, if so i want to clean sessionStorage. I use. onBeforeUnload(event: BeforeUnloadEvent) { event.returnValue = ”; } Beforeunload event also workd as a page refresh. How to check if the user leaves the application […]

By Cylo
Published
Categorized as angular, javascript, typescript, window

Angular Routing : Need to prevent navigation when url typed in browser’s address bar is invalid

requirement is to check the browser URL if the user has typed it manually. If URL entered is invalid or if the user is not having access to it, stay on the same page with some warning popup. I have tried the following – CanDeactivate – this does not get triggered on hitting enter in […]

By T Aria
Published
Categorized as angular, navigation, routing, url, window

redirection from one url to another url without any interconnection

HTML: <button class=”btn btn-primary” ng-click=”initiatePayment();”>Proceed to pay</button> Credit Controller.Js: $scope.intitiatePayment = function(){ $scope.redirect = response.json.response.data.links; $window.location.href = $scope.redirect[i].href; } I have payment gateway integration , now when i click on proceed to pay button I open the link in given by backend after successful payment , it will redirect to JSP page configured by backend […]

By Nicoleta Wilskon
Published
Categorized as url, window Tagged

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq