Angular Single url used for all routing? - html

Here is my apps home page url: http://localhost:4200/
Whenever the user selects a next button a new screen loads with a new url similar to the examples shown below:
http://localhost:4200/screen/static/text/1/0
http://localhost:4200/screen/activity/click-and-reveal/1/1
http://localhost:4200/screen/activity/click-and-reveal/3/2
and so on
I would really like the url to display a single value something like http://MyProjectName ..... as i think it looks rather unprofessional to have the url looking the way it is looking currently.
Any help as to how i could accomplish this would be greatly appreciated :).

The URL won't change if you use the navigation option SkipLocationChange on your links.
<a routerLink="/somePath" skipLocationChange>Settings</a>
Or in code behind:
this.router.navigate(['/somePath'], { skipLocationChange: true });

Their are few ways to achieve it:-
Redux
Shared Observable

Related

How to change part of html body in flutter

maybe somone know how to use html adress hidding like this, i have rest api who response as Map<String, dynamic> with two variables, title and content. Variable content have all code inside and part of this code is a hidden link like below 'google-link' in postman i can follow link using ctrl+click but when i use Html widget in vsc with onLinkTap, he build page for me but when i try to use hyperlink debug console give info back '/google-link' is null
<a title=\"Google\" href=\"/google-link\"><img src=\"https://www.speedtest.pl/wiadomosci/wp-content/uploads/2016/11/google-logo.jpg\"
My question is how can i change body from this rest api from '/google-link' to 'https://www.google.com" and make this hyperlink working? or maybe is better way to do this?
thanks!

How to determine what content is active on a page

I am at a bit of loss of knowledge and honestly don't know what to search for. What I need to be able to do is determine what content to show on a webpage that way when I refresh it will not reset everything. For example, if someone clicks on the messages tab I want the browser to know when it refreshes, that is the tab to stay on. I believe this is done through url encoding but I am not sure. Any help would be AWESOME! Thanks fellow coders.
MORE INFO: I have 2 buttons on a page. One is named "home" and when I click it I want the content of the home page to appear in a box named "info-main". I am doing this with ajax requests. When I click on "edit profile", I want the content in div id "info-main" to be replaced with the edit profile information that is retrieved via ajax as well. I need to figure out how if someone refreshes the page... I want it to stay showing the edit profile information rather then going back to the default of "home" content.
MORE INFO(AGAIN)
I just had a great idea. When the page refreshes, I want it to load specific ajax code based on what the url encode is.
For example.... if the url is:
http://www.exampleurl.com/index.php?info=status-load
I want the browser to execute the ajax I have for retrieving status's.
OR
If the url is:
http://www.exampleurl.com/index.php?info=edit-prof
I want it to load the ajax code I have for retrieving profile edit info.
I really hope this helps. :/
The way I do it is I place a # before the link i.e. href="#messages"
Then I link a .js with this code.
$(function () {
var hash = location.hash
, hashPieces = hash.split('?')
, activeTab = $('[href=' + hashPieces[0] + ']');
activeTab && activeTab.tab('show');
});
I hope this helps
For referring an element on your page, you use a link with a hashtag.
For example, if you have a layout like this:
<div class="top-nav">
Home
Edit Profile
</div>
And you have a password edit form on your editProfile page, you can like to it like this:
Edit Profile
if you have a <form id="passwordChange"> on your editProfile.
Read more: http://css-tricks.com/hash-tag-links-padding/

FB Share without App ID

Is it possible to use FB share plugin without APP ID?
If I use HTML5 code then the console logs an error FB.getLoginStatus() called before calling FB.init().
To use HTML 5 FB like is it necessary to have an APP ID?
Thank you
Here i am sharing what i did to share post on fb wall, In this way you do not need to use appId. Just put this code in your HTML page where you want link to share...
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php?u={$url}&media={$imgPath}&description={$desc}" class="joinFB">Share Your Advertise</a>
URL parameters are as explained below,
u : url or link you want to user to go when he clicks on your wall post,
media : full image path,make sure that image is available on given path,it will accept one image only
description : a short description that you want to show on wall
It will also ask you to write some data which will be displayed above your post. Description passed in url will be displayed in right side of your image.
Please note that i had passed $url,$desc,$imgPath variables as per my need. The above code is in smarty-php, so change it as per your requirement.
Hope this becomes helpful to you.
Yes you need an app id. You can try to inject your own code into the DOM of the user when using facebook and call functions in their javascript... But I doubt many users will actiually use an "app" that works this way.

jqMobi - How to dynamically add a panel from another page

I am using jqMobi ( NOT jQuery Mobile ) and I would like to be able to dynamically load a panel with some remote html page and then navigate to it. I have read the documentation that shows how to add a new panel with html in it, but what I'd like to do is something like this:
$.ui.addContentDiv("newDiv","somePage.html","Some Title");
I know that I could do something like this:
$.get("somePage.html",function(data){
$.ui.addContentDiv("newDiv",data,"Some Title");
$.ui.loadContent("newDiv", false, false, "up");
});
But I'm wondering if there is something better out there. Also, the above method does nothing if there is a failure, so any suggestions that you may have about that would be appreciated. As far as I can tell, there is no failure callback for the get method
There is an easier way - just link to the HTML page and it handles the xhr request for you. data-persist-ajax caches it in the dom, so future request do not load it.
My Page

how to print another webpage in html?

i am writing a website in html
but in my code on one page i want to have something say
"click HERE to print directory listing"
and the directory listing is another webpage that has my information loaded on it.
can anyone tell me how to do this?
You may use jQuery:
Click here for...
<div id="directorylisting"></div>
$("#dir_list").click(function() {
$("#directorylisting").load("/path/to/your/page/with/data");
// or if you what replace all page contents use:
// $('body').load(...);
return false;
});
Or something like this:
Click for...