I have an Ember app which is run using engines (So there are other apps as well)
In my app, I have the following route defined in addon\routes.js
this.route('my-route');
My question is, say from some other app (which does not use Ember), can I have the following link called as say href of an anchor tag
OR browser redirect & it would deep route to where I want ?
https://abc.xyz.com/xyz/123/ui/#/myapp/my-route?action=123
I ultimately hope to get the control in my-route (after the other app hits the above URL)
Related
here in my local my application is working and previously the build edition used to run in docker also but when we moved to aws the issue we arised is some url and not navigating when we try to navigate i am getting
the link is this http://www.sometesturl/demo-page
and other routing url are working and it is like i declared like
on clicking it has to redirect and like this i have 7 other pages which are working but only this page is not working and i applied
RouterModule.forRoot(
appRoutes,
{ enableTracing: true,useHash:true,anchorScrolling:'enabled' } // <-- debugging purposes only
)
useHash:True also but whats happening is then the url stays in the same page i mean if click on the demo page then it redirects and come back to the same page again like http://www.sometesturl/#/ to http://www.sometesturl/demo-page to http://www.sometesturl/#/ it even doesn't redirect also if i use Hash is there any config rules to be written for aws instance
How come I can't navigate to a page using a regular url? For example I have a page at /about, but if I open a new tab and try to go to http://localhost:3000/about I'll get the general Cannot GET '/about' error.
But if I go to http://localhost:3000/#!/about it renders the page and changes the url to a clean url without the #!.
I have html5Mode(true) set.
I'm using version 1.6.6 of angular and angular-route
I have an angularjs app running within a third party iframe (i.e. different domains). All the routing and navigation within this app will add entries to the browser history, but I'd like to disable this app from do so. After much research, it seems that making use of the html5 history api is my best chance at this.
This reference makes use of a solution which essentially, onclick of a link within an iframe, will replace the current history state (history.replaceState()) with that of the links destination url. Thus the browser will not add a history entry if the current url is the same as the destination: http://www.webdeveasy.com/back-button-behavior-on-a-page-with-an-iframe/
I'm trying to implement a similar solution within an angular context which uses the ngRoute module for all navigation. With that said, I think adding a handler for the $routeChangeStart event is one solution, but it doesn't work:
$rootScope.$on('$routeChangeStart', function(e, cur, pre) {
history.replaceState(null, null, $location.absUrl());
});
In the above, this event handler appears to execute prior to navigation taking place. The absUrl is a path within the iframe app, and is the destination of the route, however the browser is still adding entries. Any ideas why?
EDIT:
So I found a partial solution. Much of the app navigates using $location.path(myPath). If I add replace() onto the $location.path() then this tells the browser to replace the history entry instead of adding a new one.
This seems to work for all navigation which makes use of $location.path(), but not for user driven navigation (i.e. clicking links); I need to find a solution for those scenarios.
I've built an Ember.JS app using the latest Bootstrap.css/js for styling. In one of my templates, I have a button that triggers an action that disables the button and sets it's text to "loading" via the Bootstrap function described here. I access the button using jQuery from within my action as follows:
$('.find').button('loading'); //Starts "Please Wait" message
This worked great when running the ember app a server on my desktop. However, I'm presently trying to package the app into a Phonegapp app, initially in iOS. Whenever the action fires in the simulator, I get the following error:
I'm beginning to suspect this may be due to my action-firing button not being accessible through the class with jQuery like on desktop? But I'm not terribly sure as this is my first Phonegap app. Many thanks if someone can clear this up.
Got it! It was solved by an answer on this question.
I don't think that JQuery is being loaded into the page.
You have referenced it as:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
which says use whatever protocol the current page is being server
from. On a mobile device you are being served from file:// so the
actual request the browser makes to fetch the script is:
file://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
You need to specify the scheme you want to use or else include it in
the PG project itself.
With me, it wasn't my jQuery not being loaded, but rather my Bootstrap.js! When you follow the CDN instructions on the bootstrap website, the URLs are similarly formatted starting with "//" (known as a "protocol-relative URL" or also "network-path reference") instead of the explicit "http://". Making the changed fixed the issue!
I've created a small website by using backbone.js. It's hosted in IIS 7.
The routing:
routes: {
"/": "index",
"": "index",
"detailedpage/:id": "detailedpage",
'*notFound': 'index'
}
I've a problem when I try to copy/paste an url.
If I want to access directly to
http://www.anydomain.com/detailedpage/1234
it's not working. I can see in the developper tools an internal server error for 1234, path "/detailedpage".
The strange thing is if I access first to
http://www.anydomain.com/
and after copy/paste the url
http://www.anydomain.com/detailedpage/1234
it's working.
Can you please tell me if I need to enable/disable any handler in IIS?
Thank you!
Since backbone is doing the routing, your browser has to have the right content before its loaded. If you wish to use pushState with Backbone, you have to trick your webserver into serving the same html page for all possible routes. The way we do that in IIS is have the .NET routing setup in such a way that loads the required backbone assets so it can do routing directly.
Alternatively, you can disable pushState in Backbone.history.start() and use hash based routing. (myurl/#/myroute)
These are client routes, so you begin with a #.
http://www.anydomain.com/#detailedpage/1234
Include a hashtag is not a solution. It's just tell to the browser what is the root url.
The root cause is probably the redirection to the index page which is not correctly working.
The solution I did is to put the html into a view in a MVC application. All requests are redirect to the same controller, which return this new view. So I'm sure that all request are redirect to the index page.