Page reload issue on changing the route in Angular7 - angular7

In my application on change of every route the whole page getting reload like when we do page refresh. That should not happen on changing of routes. I worked on Angular2, 4 5 and 6. I didn't face this issue before.

I got the same issue when I started work with Angular. It might be possible in your HTML page
Home //Don't use this one
Instead of you use
<a class="" routerLink="/homePage" skipLocationChange>Home</a>

Related

ASP.NET MVC 3 shows cached session values during page load

I am working on one old ASP.NET MVC version 3 project. I am banging my head against wall for one weird issue. Issue is like in following line of code in cshtml view Session["FirmName"] is always showing old value after page refresh.
<label class='switchValue' id="switchClientName" title="#Convert.ToString(Session["FirmName"])">#Convert.ToString(Session["FirmName"])</label>
When page reloads there is code to change Session["FirmName"]. This issue is not reproduced in our local environment but is seen only in production. What is there which is making Session["FirmName"] to be cached? Is it something related with caching? Any help greatly appreciate.
To resolve caching issue, I created a parameter in querystring & passed current DateTime value to it.

Using Jquery moble with old fashioned hrefs just wont work right

Have been bashing my head against the wall for a good day and a half now. Did everyone abandon old fashioned page structures to go to jQuery Mobile?
I have a webpage, tracks legislation. Main navbar goes as such:
/bills/list, /legislators/list, /committees/list
Where each link is rewritten into
index.php?category=$1&detail=$2
so /bills/list translates to
index.php?category=bills&detail=list
But when I load a page from the navbar, using an a href tag, the pages load all nice and easy using the AJAX loader, but the newly loaded pages 1. don't run scripts, and 2. don't display any formatting. This is a problem.
All the suggestions I have seen say to .bind something or .refresh or .trigger without any context of where that goes, and everything I have tried in that vein has frustrated me to no end.
Please help! And by the way, if I just data-ajax=false everything it works perfectly. But I want the quick loading that ajax gives! I just don't understand how it works and there are really no good pointers on the web I could find.
Code in this pastebin: http://pastebin.com/9jMxV0B6
You can see some artifacts of my struggling to get the thing working.
From what I gather, you shouldn't call new pages via a href, but then why the hell does jqm use href's for its nav menu? Is that supposed to call a function or something?
"But when I load a page from the navbar, using a basic old fashioned a href tag, the pages load all nice and easy using the AJAX loader, but the newly loaded pages 1. don't run scripts, and 2. don't display any formatting. This is a problem."
That happens because JQM ignores all the headers in all other pages besides the first page that loads. So if you want to do any changes to the page use page events, place them In first page.
I had problems understanding it also. Here is a link to my previous post that explains it a bit: How do I enable onload in jQuery mobile (open page both from link & load)?
Hope it clears some things for you. My recommendation for you is to do two simple pages and test simple URL functionality.

Turbolinks causes a link with href="#" to trigger page refresh

I have a very simple link on my page. My link. It causes a page refresh. when I remove "turbolinks", it no longer causes a refresh.
I've used links with hash fragments all the time in the past. Unless I've missed something very fundamental for a long time, I don't understand how this can cause a refresh.
It does not have any JS event handlers attached to it.
Any ideas?
It may not matter, but I'm using jQuery, Twitter-Bootstrap, and Ruby on Rails.
Clues so far:
When I remove Turbolinks, the link behaves properly (does not cause page refresh).
Links with "#" as the URL cause a reload on every page of my app.
Links with any "#hasfragmenttext" will cause a single refresh and then the URL of the page is "mypage#hasfragmenttext", any additional clicks do NOT cause page refresh... hmm.
The above solution didn't work for me but this did :
My link
This can be found at https://github.com/turbolinks/turbolinks
update: This solution works for turbolinks 5, for classic turbolinks check the previous answer by #wael34218
Use data-no-turbolink attribute on that link the error should be gone
<a href="#" data-no-turbolink>My link</a>
With Rails 7 / Hotwire, you now need to use:
data-turbo="false"

CKEditor doesnt want appear if it already in cache

I am trying to setup CKEditor (https://github.com/tsechingho/ckeditor-rails) it seems to be very simple, and its work fine on first page load, but if I go back(to the root or elsewhere on same browser page) and then again go to edit or new form I`ve just get simple text area field, so when I open it in new window everything is fine.
I think that the problem is in rails or browser cache... So I have to do somthing to prevent this page from caching or to clear cache after action... but I cant understand how to implement this. Does anybody know how to solve this?
Heh, solved, if it help somebody:
Just put
<script type="text/javascript">
$(function(){
$(".ckeditor").ckeditor();
};
</script>`
at the bottom of the page, just before body closing tag.

Rails 3 Links are broken after activescaffold update

I just updated active scaffold on my rails app, and now all the links are broken on the site. If I hover over the link in firefox, I can see http://localhost:3000/correct_link; however, when I click the link, I end up at http://localhost:3000/current_link#__1_. When the link is loaded all styling/javascript is messed up. Furthermore, the number after the two underscores increases every time I click another link, but I can never navigate away from http://localhost:3000/current_link__NUM_.
Interestingly, if I type the url that I want into the browser, all is well. There don't seem to be any errors in my logs or in my server console.
I'm not sure how to go about debugging this
Aha! The error was caused by my removing active_scaffold, which introduced some weird behavior from custom javascript that had hooked into it. After active scaffold was removed, the javascript started hijacking the links. Shuffling the javascript around fixed the bug

Resources