I tried to access the documentation pages for AngularJS:
http://docs.angularjs.org/tutorial
http://docs.angularjs.org/api/
But I noticed that the script links are broken and the page gets also broken because of that.
Is there any alternative resource for the interactive documentation?
Note
It seems that with the exception of the home page, which uses 1.2.0:
Request URL:http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js
Request Method:GET
Status Code:304 Not Modified
the links are broken on most of the pages of the official website.
Request URL:http://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js
Request Method:GET
Status Code:404 Not Found
There's also an entry in the official issue tracker: http://docs.angularjs.org/ referring to a non existent version of angular from google CDN.
Every bit of documentation you need is in the Angular source code:
Angular methods are very well documented. For example, if (like the comment) you wanted to view the docs for ng-switch. You can go to:
src->directives->ngSwitch.js
That's give you all the documentation, usage examples and more plus the relevant source code which is worth reading.
You can also go to /docs/ for the actual documentation but it's not as nice imo :)
Related
I have a PyScript running on the home.html page of a website, and within the script I'd like to read some information from a file stored in same directory as the home.html page but I always get error "Host is unreachable".
I expect to be able to read information from a file stored in same directory as my home.html page containing the script.
I am trying the following:
url='<my file full URL here>'
req = urllib.request.Request(url=url)
response = urllib.request.urlopen(req,timeout=120)
data=response.read().decode('utf-8')
PyScript doesn't play well (actually, doesn't play at all) with most existing Python libraries that handle HTTP requests (requests, httpx, urllib). Take a look at the PyScript documentation on HTTP requests here for guidance. It's a great walk-through on making HTTP requests in PyScript using pyfetch, a Python wrapper of the JavaScript fetch api.
One quick warning about the documentation. Like PyScript itself, the documentation is a work in progress. In the link above, there's a reference to the py-env tag. That has been deprecated and it doesn't look like they've updated that part of the documentation. The functions of the py-env tag have been subsumed in the py-config tag. More on that here.
UPDATE:
As a framework under development, PyScript is going to be a moving target for a while. Specific to your case, the documentation on http-requests (How to make HTTP requests using PyScript) was actually updated just this morning (11/8/2022). I'll refer you to that page for the code. One very important note, however. The code examples are written as though they are being run in an updated local development environment. When you point to the remote PyScript version to use, it matters which one you select. Your code points to <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
, which is perfectly reasonable -- it is, after all, the suggested release. The code example in the documentation, however, will not work with 'latest'. It will, however, work with 'unstable' (<link rel="stylesheet" href="https://pyscript.net/unstable/pyscript.css" />). When running this code using the 'unstable' release, it also appears that you have to run it in a live server. The point is workable solutions are going to be hit and miss for a while. What works today may not work next week.
I don't see any updated answer on similar topics (hopefully something has changed with last crawl releases), that's why I come up with a specific question.
I have an AngularJS website, which lists products that can be added or removed (the links are clearly updated). URLs have the following format:
http://example.com/#/product/564b9fd3010000bf091e0bf7/published
http://example.com/#/product/6937219vfeg9920gd903bg03/published
The product's ID (6937219vfeg9920gd903bg03) is retrieved by our back-end.
My problem is that Google doesn't list them, probably because I don't have a sitemap.xml file in my server..
In a day a page can be added (therefore a new url to add) or removed..
How can I manage this?
Do I have to manually (or by batch) edit the file each time?
Is there a smart way to tell Google: "Hey my friend, look at this page"?!
Generally you can create a JavaScript - AngularJS sitemap, and according to this guidance from google :
https://webmasters.googleblog.com/2015/10/deprecating-our-ajax-crawling-scheme.html
They Will crawl it.
you can also use Fetch as Google To validate that the pages rendered correctly
.
There is another study about google execution of JavaScript,
http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
I did my research and it's still not clear to me. It seems it once did, when Chrome Apps were still called Chrome Packaged Apps.
Is it navigation a no-no for Chrome Apps? It doesn't sound right to me. The use of views seems the way to go...
Trying to use ngView I got the following error:
XMLHttpRequest cannot load chrome-extension://opjofdlbcghpdgfhmpdfmadlnmnblijo/views/main.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
The error persists even using:
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);
(this line is in an related answer, I'll try to get the link here later)
Inline templates don't do it either. Apparently.
So, I'm looking for up-to-date info on this subject. The following article is great: http://www.ng-newsletter.com/posts/chrome-apps-on-angular.html. But the code available on Github is not so complete as stated so I had a little trouble trying to test it.
Of course it's possible do go with ngHide, ngShow, ngIf etc... But having templates in seprate files is much much better...
I've run into some basic trouble implementing Angular Google Maps into my application.
At first I thought it was my app code but this plunker demonstrates the same problem:
http://plnkr.co/edit/SWxqso?p=preview
This is almost exactly the Quickstart guide found here: http://angular-google-maps.org/use and for some reason I'm hitting Google's AuthenticationService when the map files are requested.
This seems to be Angular related as similar code outside of the app runs fine without an API key. I've tried everything I can think of (including adding my API key and adding my domains to my API console at Google).
There's another non-working version here too: pitwall.csoutham.com/#/circuit/adelaide (not enough reputation to post more than two links).
Any guidance very gratefully received.
this is my answer to a question from yesterday with google-maps implementation, there is a working example in jsfiddle too
AngularJS - load google map script async in directive for multiple maps
#Chris Southam I know you've switched off, but for posterity sake, your plnkr was missing a closing for the angular-google-maps import. See your example corrected here, http://plnkr.co/edit/qfhuW9?p=preview .
I have a CakePHP 2 app with DebugKit installed. It is working fine and I get the memory usage and processing time in the "Timing" toolbar for each page I load.
What I also want to be able to do is get memory usage and processing times for ajax requests after the page has loaded. I am aware that I can access previous ajax requests using the "History" button in the DebugKit Toolbar, but this is doesn't really help when I want to click around the page, firing ajax requests and get instant debugging information for them.
So, I did some searching and I found that I could use Firebug + FirePHP in Firefox along with the FirePHP and FireCake libraries in my app and get all of DebugKit's stats on a per-ajax-request basis. This sounds perfect and exactly what I want to do.
Unfortunately, I can't seem to get it to work. I could only find one tutorial on the matter at http://someguyjeremy.com/blog/using-firephp-to-debug-your-cakephp-app
I have done everything that tutorial mentions and Cake gives me no errors at all. However, unless I am missing something, I don't see where in Firebug the debug info is being displayed, if indeed it is even being fed to Firebug in the first place.
My config:
Cake Version: 2.2.4
Firefox Version: 17.0.1
Firebug Version: tried with 1.11.1 and 1.9.0
FirePHP Version: 0.7.1
DebugKit Version: 2.2.0 (latest master branch)
UPDATE
It appears to work perfectly for Ajax requests that do not end in .json and, therefore, are not being picked up by the Router::parseExtensions('json'); I have in routes.php.
I took out Router::parseExtensions('json'); and changed my Ajax request to go for my filter action directly instead of calling it filter.json and Cake serves all of the FireBug headers. Unfortunately, I can't use it like this because JQuery needs the content type to be application.json.
It looks like this might be a documented bug:
http://cakephp.lighthouseapp.com/projects/42880/tickets/107-firephp-messages-are-not-sent-in-response-if-using-jsonxmlview-with-serialization
My usage case is not exactly the same, but outputting json is stopping the FirePHP headers from appearing. If I turn off the parse extensions directive for json, the FirePHP headers appear as they should.