Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c9199ee

Browse files
vojtajinaIgorMinar
authored andcommitted
docs: load angular from CDN only on production
So that when running the docs locally, eg. during e2e testing, we use the latest build version of angular, rather than the stable one from CDN. This fixes e2e tests running with Testacular.
1 parent 6f18ade commit c9199ee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/src/templates/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
baseUrl = location.href.replace(rUrl, indexFile),
2323
jQuery = /index-jq[^\.]*\.html$/.test(baseUrl),
2424
debug = /index[^\.]*-debug\.html$/.test(baseUrl),
25-
gae = (baseUrl.split('/').length == 4),
25+
production = location.hostname === 'docs.angularjs.org',
2626
headEl = document.getElementsByTagName('head')[0],
2727
sync = true,
2828
angularVersion = {
@@ -45,7 +45,7 @@
4545
addTag('script', {src: 'docs-keywords.js'}, sync);
4646

4747
function path(name) {
48-
if (gae) {
48+
if (production) {
4949
if (name.match(/^angular(-\w+)?\.js/) && !name.match(/bootstrap/)) {
5050
name = '//ajax.googleapis.com/ajax/libs/angularjs/' +
5151
angularVersion.stable +

testacular-e2e.conf.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ autoWatch = false;
66
singleRun = true;
77
logLevel = LOG_INFO;
88
logColors = true;
9-
browsers = ['Chrome']
9+
browsers = ['Chrome'];
1010

1111
proxies = {
12+
// angular.js, angular-resource.js, etc
13+
'/angular': 'http://localhost:8000/build/angular',
1214
'/': 'http://localhost:8000/build/docs/'
1315
};
1416

0 commit comments

Comments
 (0)