mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-05 21:54:42 +00:00
Allow angular to be included with query parameters. This is a common
pattern for forcing a reload of the script in the browser irrespective of the cache settings the host has.
This commit is contained in:
parent
21e78c443f
commit
b798ee80c2
1 changed files with 2 additions and 2 deletions
|
|
@ -385,7 +385,7 @@ function angularInit(config){
|
||||||
}
|
}
|
||||||
|
|
||||||
function angularJsConfig(document, config) {
|
function angularJsConfig(document, config) {
|
||||||
var filename = /^(.*)\/angular(-([^\/]*))?.js(#(.*))?$/,
|
var filename = /^(.*)\/angular(-([^\/]*))?.js(\?[^#]*)?(#(.*))?$/,
|
||||||
scripts = document.getElementsByTagName("script"),
|
scripts = document.getElementsByTagName("script"),
|
||||||
match;
|
match;
|
||||||
config = extend({
|
config = extend({
|
||||||
|
|
@ -396,7 +396,7 @@ function angularJsConfig(document, config) {
|
||||||
match = (scripts[j].src || "").match(filename);
|
match = (scripts[j].src || "").match(filename);
|
||||||
if (match) {
|
if (match) {
|
||||||
config.base_url = match[1] + '/';
|
config.base_url = match[1] + '/';
|
||||||
extend(config, parseKeyValue(match[5]));
|
extend(config, parseKeyValue(match[6]));
|
||||||
eachAttribute(jqLite(scripts[j]), function(value, name){
|
eachAttribute(jqLite(scripts[j]), function(value, name){
|
||||||
if (/^ng:/.exec(name)) {
|
if (/^ng:/.exec(name)) {
|
||||||
name = name.substring(3).replace(/-/g, '_');
|
name = name.substring(3).replace(/-/g, '_');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue