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

Commit 1843151

Browse files
author
Simon Tsvilik
committed
Merge branch 'master' of https://github.com/angular/angular.js
2 parents adcffe7 + d307242 commit 1843151

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+453
-297
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"components-font-awesome": "3.1.0",
88
"bootstrap": "https://raw.github.com/twbs/bootstrap/v2.0.2/docs/assets/bootstrap.zip",
99
"closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
10-
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.1/assets/ng-closure-runner.zip"
10+
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.2/assets/ng-closure-runner.zip"
1111
}
1212
}

docs/components/angular-bootstrap/bootstrap-prettify.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ directive.prettyprint = ['reindentCode', function(reindentCode) {
102102
//ensure that angular won't compile {{ curly }} values
103103
html = html.replace(/\{\{/g, '<span>{{</span>')
104104
.replace(/\}\}/g, '<span>}}</span>');
105-
element.html(window.prettyPrintOne(reindentCode(html), undefined, true));
105+
if (window.RUNNING_IN_NG_TEST_RUNNER) {
106+
element.html(html);
107+
}
108+
else {
109+
element.html(window.prettyPrintOne(reindentCode(html), undefined, true));
110+
}
106111
}
107112
};
108113
}];
Lines changed: 41 additions & 41 deletions
Loading

docs/src/templates/css/docs.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,5 +502,4 @@ pre ol li {
502502
top: 10px;
503503
font-size: 16px;
504504
word-break: normal;
505-
word-wrap: normal;
506505
}

docs/src/templates/index.html

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
// we can't add css/js the usual way, because some browsers (FF) eagerly prefetch resources
2121
// before the base attribute is added, causing 404 and terribly slow loading of the docs app.
2222
(function() {
23+
if (window.name.indexOf('NG_DEFER_BOOTSTRAP!') == 0) {
24+
//TODO(i): super ugly hack to temporarily speed up our e2e tests until we move to protractor + extracted examples
25+
window.RUNNING_IN_NG_TEST_RUNNER = true;
26+
}
27+
2328
var indexFile = (location.pathname.match(/\/(index[^\.]*\.html)/) || ['', ''])[1],
2429
rUrl = /(#!\/|api|guide|misc|tutorial|cookbook|error|index[^\.]*\.html).*$/,
2530
baseUrl = location.href.replace(rUrl, indexFile),
@@ -49,8 +54,10 @@
4954
addTag('script', {src: path('angular-animate.js') }, sync);
5055
addTag('script', {src: 'components/angular-bootstrap.js' }, sync);
5156
addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync);
52-
addTag('script', {src: 'components/google-code-prettify.js' }, sync);
53-
addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync);
57+
if (!window.RUNNING_IN_NG_TEST_RUNNER) {
58+
addTag('script', {src: 'components/google-code-prettify.js' }, sync);
59+
addTag('script', {src: 'components/' + (debug ? 'lunr.js' : 'lunr.min.js') }, sync);
60+
}
5461
addTag('script', {src: 'components/marked.js' }, sync);
5562
addTag('script', {src: 'docs-data.js'}, sync);
5663
addTag('script', {src: 'js/docs.js'}, sync);
@@ -112,11 +119,13 @@
112119
_gaq.push(['_setAccount', 'UA-8594346-3']);
113120
_gaq.push(['_setDomainName', '.angularjs.org']);
114121

115-
(function() {
116-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
117-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
118-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
119-
})();
122+
if (!window.RUNNING_IN_NG_TEST_RUNNER) {
123+
(function() {
124+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
125+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
126+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
127+
})();
128+
}
120129
</script>
121130
</head>
122131

docs/src/templates/js/docs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ docsApp.controller.DocsNavigationCtrl = ['$scope', '$location', 'docsSearch', fu
109109

110110
docsApp.serviceFactory.lunrSearch = function() {
111111
return function(properties) {
112+
if (window.RUNNING_IN_NG_TEST_RUNNER) return null;
113+
112114
var engine = lunr(properties);
113115
return {
114116
store : function(values) {
@@ -122,7 +124,10 @@ docsApp.serviceFactory.lunrSearch = function() {
122124
};
123125

124126
docsApp.serviceFactory.docsSearch = ['$rootScope','lunrSearch', 'NG_PAGES',
125-
function($rootScope, lunrSearch, NG_PAGES) {
127+
function($rootScope, lunrSearch, NG_PAGES) {
128+
if (window.RUNNING_IN_NG_TEST_RUNNER) {
129+
return null;
130+
}
126131

127132
var index = lunrSearch(function() {
128133
this.ref('id');

lib/grunt/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ module.exports = {
1717
if (version) return version;
1818

1919
var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
20-
var match = package.version.match(/^([^\-]*)(-snapshot)?$/);
20+
// TODO(brian): change `(-|rc)` to `-` in the regex below after bower
21+
// fixes this issue: https://github.com/bower/bower/issues/782
22+
var match = package.version.match(/^([^\-]*)(?:(-|rc)(.+))?$/);
2123
var semver = match[1].split('.');
2224
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
2325

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"codename": "barehand-atomspliting",
66
"devDependencies": {
77
"grunt": "0.4.0",
8-
"bower": "1.0.3",
8+
"bower": "1.1.2",
99
"grunt-contrib-clean": "0.4.0",
1010
"grunt-contrib-compress": "0.4.1",
1111
"grunt-contrib-connect": "0.1.2",

src/auto/injector.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ function annotate(fn) {
5252
if (typeof fn == 'function') {
5353
if (!($inject = fn.$inject)) {
5454
$inject = [];
55-
fnText = fn.toString().replace(STRIP_COMMENTS, '');
56-
argDecl = fnText.match(FN_ARGS);
57-
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
58-
arg.replace(FN_ARG, function(all, underscore, name){
59-
$inject.push(name);
55+
if (fn.length) {
56+
fnText = fn.toString().replace(STRIP_COMMENTS, '');
57+
argDecl = fnText.match(FN_ARGS);
58+
forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
59+
arg.replace(FN_ARG, function(all, underscore, name){
60+
$inject.push(name);
61+
});
6062
});
61-
});
63+
}
6264
fn.$inject = $inject;
6365
}
6466
} else if (isArray(fn)) {

src/minErr.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,21 @@
3030

3131
function minErr(module) {
3232
return function () {
33-
var prefix = '[' + (module ? module + ':' : '') + arguments[0] + '] ',
33+
var code = arguments[0],
34+
prefix = '[' + (module ? module + ':' : '') + code + '] ',
3435
template = arguments[1],
3536
templateArgs = arguments,
36-
message;
37+
stringify = function (obj) {
38+
if (isFunction(obj)) {
39+
return obj.toString().replace(/ \{[\s\S]*$/, '');
40+
} else if (isUndefined(obj)) {
41+
return 'undefined';
42+
} else if (!isString(obj)) {
43+
return JSON.stringify(obj);
44+
}
45+
return obj;
46+
},
47+
message, i;
3748

3849
message = prefix + template.replace(/\{\d+\}/g, function (match) {
3950
var index = +match.slice(1, -1), arg;
@@ -52,6 +63,13 @@ function minErr(module) {
5263
return match;
5364
});
5465

66+
message = message + '\nhttp://errors.angularjs.org/' + version.full + '/' +
67+
(module ? module + '/' : '') + code;
68+
for (i = 2; i < arguments.length; i++) {
69+
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
70+
encodeURIComponent(stringify(arguments[i]));
71+
}
72+
5573
return new Error(message);
5674
};
5775
}

src/ng/filter/filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function filterFilter() {
183183
})();
184184
} else {
185185
(function() {
186-
if (!expression[key]) return;
186+
if (typeof(expression[key]) == 'undefined') { return; }
187187
var path = key;
188188
predicates.push(function(value) {
189189
return search(getter(value,path), expression[path]);

src/ng/interpolate.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,32 @@ var $interpolateMinErr = minErr('$interpolate');
1010
* @description
1111
*
1212
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
13-
*
13+
*
1414
* @example
15-
<doc:example>
15+
<doc:example module="customInterpolationApp">
1616
<doc:source>
1717
<script>
18-
var myApp = angular.module('App', [], function($interpolateProvider) {
18+
var customInterpolationApp = angular.module('customInterpolationApp', []);
19+
20+
customInterpolationApp.config(function($interpolateProvider) {
1921
$interpolateProvider.startSymbol('//');
2022
$interpolateProvider.endSymbol('//');
2123
});
22-
function Controller($scope) {
23-
$scope.label = "Interpolation Provider Sample";
24-
}
24+
25+
26+
customInterpolationApp.controller('DemoController', function DemoController() {
27+
this.label = "This bindings is brought you you by // interpolation symbols.";
28+
});
2529
</script>
26-
<div ng-app="App" ng-controller="Controller">
27-
//label//
30+
<div ng-app="App" ng-controller="DemoController as demo">
31+
//demo.label//
2832
</div>
2933
</doc:source>
34+
<doc:scenario>
35+
it('should interpolate binding with custom symbols', function() {
36+
expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.');
37+
});
38+
</doc:scenario>
3039
</doc:example>
3140
*/
3241
function $InterpolateProvider() {

src/ng/parse.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,21 @@ function parser(text, json, $filter, csp){
689689
}
690690
var fnPtr = fn(scope, locals, context) || noop;
691691
// IE stupidity!
692-
return fnPtr.apply
692+
var v = fnPtr.apply
693693
? fnPtr.apply(context, args)
694694
: fnPtr(args[0], args[1], args[2], args[3], args[4]);
695+
696+
// Check for promise
697+
if (v && v.then) {
698+
var p = v;
699+
if (!('$$v' in v)) {
700+
p.$$v = undefined;
701+
p.then(function(val) { p.$$v = val; });
702+
}
703+
v = v.$$v;
704+
}
705+
706+
return v;
695707
};
696708
}
697709

src/ng/sce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function $SceDelegateProvider() {
398398
* {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.
399399
*
400400
* As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
401-
* ng.$sce#parseHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
401+
* ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
402402
* simplified):
403403
*
404404
* <pre class="prettyprint">

src/ngCookies/cookies.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ angular.module('ngCookies', ['ng']).
1818
* Only a simple Object is exposed and by adding or removing properties to/from
1919
* this object, new cookies are created/deleted at the end of current $eval.
2020
*
21+
* # Installation
22+
* To use $cookies make sure you have included the `angular-cookies.js` that comes in Angular
23+
* package. You can also find this file on Google CDN, bower as well as at
24+
* {@link http://code.angularjs.org/ code.angularjs.org}.
25+
*
26+
* Finally load the module in your application:
27+
*
28+
* angular.module('app', ['ngCookies']);
29+
*
30+
* and you are ready to get started!
31+
*
2132
* @example
2233
<doc:example>
2334
<doc:source>

0 commit comments

Comments
 (0)