AngularJs : two page routing won't work for changing views , status code : 404 - json

As a newbie in Angular, i am working a tutorial : WEB DEVELOPMENT WITH_ANGULARJS AND BOOTSTRAP via "Packt".
Below is the link in plunker to check the code implementation.
At the moment i am working on the Routing Events, specificly a login form where i added 2 links to change the view from the Login form to Report.
The error i receive is when i click on these links it returns :
{ "statusCode": 404,"error": "Not Found"}
Furthermore the data binding for the "report" template won't work as well.
The version of Angular that is been used in the tutorial is AngularJs v1.3.0, however i am using v1.4.6 and no problem have been occurred so far!
While most of the similar issue posts refer to a version compatibility issue , in my case any version of Angular i used it produces the same error.
Have i done anything wrong in the script.js configuration?

The href's you are using don't include the hash and proper angular path.
Change:
Login
Report
To:
Login
Report

Related

What do content addresses look like in Umbraco?

I was trying to access content through previews. At first, this was fine with both Preview and non-preview views, but I moved some of my code to another branch and noticed issues. I remembered seeing http://localhost:63761/1120 work, but now: I'm not sure if this is the correct form of address for content under 1120 to appear. Is there something I need to check?
Postfixing your url with an id is a quick way to look up the content of a node:
For example the following url works in my environment, but is not user or search engine friendly https://localhost:44392/1141
When I look up the node in my umbraco backend: https://localhost:44392/umbraco#/content/content/edit/1141
Navigate to the Properties tab and look for "Link to document", that's the user friendly url for the node
If I understand your question properly, the urls should be like below
Non-preview mode url -
http://localhost:63761/umbraco#/content/content/edit/1120
Preview mode url -
http://localhost:63761/umbraco/preview/?id=1120#?id=1120
Thanks

In MVC url is not getting properly on clicking a link for the iis8.5 hosted application

I have a MVC4 application and have hosted on IIS8.5 with published file.
I have a link on my cshtml page
<a href='/home/ContactGrabber'>Import Contacts</a>
Here home is controller and ContactGrabber is an action of controller. When I am clicking on this link it show 404 error because url is showing
http://localhost/home/ContactGrabber
It should be
http://localhost/cruuntest/home/ContactGrabber
But when I am running my development code without hosting on IIS. it works fine.
Can anybody help me on this?
Use Url.Action helper for this, so that your url is generated right, by this way you wull face issues:
<a href='#Url.Action("ContactGrabber","home")'>Import Contacts</a>
you can see details of it on MSDN
http://msdn.microsoft.com/en-us/library/dd505232%28v=vs.118%29.aspx
You can also use Html.ActionLink to generate the anchor tag:
Razor:
Html.ActionLink("Import Contacts",
"ContactGrabber", // <-- ActionMethod
"home", // <-- Controller Name.
null, // <-- Route arguments.
null // <-- htmlArguments .. which are none.
)
MSDN docs

Using history.pushState in Angular results in "10 $digest() iterations reached. Aborting!" error

I'm trying to change the url in my app from "http://www.test.com/foo" to "http://www.test.com/bar+someVariable" (somevariable is a string that I recieve from an http request inside bar's controller) using history.pushState() . In my routes I enabled html5mode and everything works fine. I'm also using location.path() to switch between views and controllers as instructed in the docs. Now once the app switches view and controller I added history.pushState(null,null,"/bar"+somevariable) to "/bar"'s controller. Everything works and the url is updated but in the console I receive the "10 $digest() iterations reached. Aborting!" error. I suspect that activating the history.pushState function is somehow interfering with angular's $location or $route service.
What is the correct way to use history.pushState() within angular without receiving the $digest error?
By the way I'm using angular 1.0.3
Thanks ahead,
Gidon
Change the path with
$location.path('/newValue')
See: http://docs.angularjs.org/guide/dev_guide.services.$location
It is hard to know for sure without seeing the relevant source, but this is a common issue in older versions of IE (8 and 9 mostly I think). The solution that worked for me a few weeks ago when I encountered this (and may work for you if you're using IE) was changing my anchor tags in my navigation.
I had:
what fixed it:

AngularJs project doesnt run in ie-8 and onward?

Please help how to run angularjs project in ie-8 and onward?
we have venueSvc angular service that are working fine in other browsers(chrome,firefox,opera etc) but not working in ie-8 and onward.
it is giving the following error.
Unknown provider: venueSvcProvider <- venueSvc
Looks like your service is not being included properly. Ie8 has some issues with directives being used as elements without being specified, however it should work in general. That error looks as though the program cannot find the provider, so make sure it exists in your source.

Widget object is undefined in Dashcode

I'm using Dashcode for a mobile Safari web application and from the documentation (https://developer.apple.com/library/archive/documentation/AppleApplications/Conceptual/Dashcode_UserGuide/Contents/Resources/en.lproj/MakingaWidgetwithDashcode/MakingaWidgetwithDashcode.html), it appears that I should be able to access an object called "widget".
However, when I tried, I get the error message saying that widget is undefined. I've also tried "window.widget" and it gives me the same error.
What's going on?
I'd like to make a text in my application a clickable link to open a URL using openURL (like the example given at the URL above).
You use widget.xxx to access things inside and outside you widget.
So to access curl and the Mac and get some data from Yahoo you do as follows
var yahoorate = widget.system("/usr/bin/curl 'http://download.finance.yahoo.com/d/quotes.csv?s=EUR" + interim0 + "=X&f=l1'", null).outputString;
to get a preference key value, stored in the widgets plist when you install on a mac
globalPreferenceValue = widget.preferenceForKey(null, "your-key");
i think in the question ask (below) we are checking to see if we are in a widget and then preparing a transition to the back of the widget.
if (window.widget) {
widget.prepareForTransition("ToBack");
}
this is how i set a preference so it is stored between system reboots (you use a get preference to retrieve them)
widget.setPreferenceForKey(2,"ratePrecision");
and this is how you create a link to open in a browser not the widget
<a onclick=" + "widget.openURL('http://www.wf.com/private/?ID=636');" + "><span id=company-info>click here</span></a>
These are all rel working examples from widgets i have built. Hope it helps. I found it useful to download widgets that performed similar functions to ones i wanted and then as well as installing them opening them as projects, you can import, and then you can see all the code.
Ok, this worked...hope it will help someone else...
window.location = "http://www.apple.com";