Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3decfe

Browse files
committed
MERGE: scope
1 parent 6ea225e commit c3decfe

19 files changed

+504
-271
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
- Added ng:options directive (http://docs.angularjs.org/#!angular.directive.ng:options)
66

77
### Breaking changes
8+
- Controller constructor functions are now looked up on scope first and then on window.
9+
- angular.equals now use === which means that things which used to be equal are no longer.
10+
Example '0' !== 0 and [] !== ''
11+
- angular.scope (http://docs.angularjs.org/#!angular.scope) now (providers, cache) instead of
12+
(parent, providers, cache)
13+
- Watch functions (see http://docs.angularjs.org/#!angular.scope.$watch) used to take
14+
fn(newValue, oldValue) and be bound to scope, now they take fn(scope, newValue, oldValue)
15+
- calling $eval() [no args] should be replaced with call to $apply()
16+
(http://docs.angularjs.org/#!angular.scope.$apply) ($eval(exp) should remain as is see
17+
http://docs.angularjs.org/#!angular.scope.$eval)
18+
- scope $set/$get have been removed. ($get is same as $eval; no replacement for $set)
19+
- $route.onChange() callback (http://docs.angularjs.org/#!angular.service.$route)
20+
no longer has this bound.
21+
- Removed undocumented $config in root scope. (You should have not been depending on this.)
822
- Dynamic Iteration (ng:repeater) on <option> elements is no longer supported. Use ng:options
923
- Removal of index formatter since its only use was with repeated options (see above)
1024
- $service now has $service.invoke for method injection ($service(self, fn) no longer works)

docs/src/templates/docs.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ h1, h2, h3, h4, h5 {
305305
border-collapse: collapse;
306306
}
307307

308-
.table th:FIRST-CHILD {
308+
.table th:first-child {
309309
text-align: right;
310310
}
311311

@@ -314,3 +314,11 @@ h1, h2, h3, h4, h5 {
314314
border: 1px solid black;
315315
padding: .5em 1em;
316316
}
317+
.table th {
318+
white-space: nowrap;
319+
}
320+
321+
.table th.section {
322+
text-align: left;
323+
background-color: lightgray;
324+
}

src/Angular.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,16 @@ function isLeafNode (node) {
569569
return false;
570570
}
571571

572+
/**
573+
* @workInProgress
574+
* @ngdoc function
575+
* @name angular.copy
576+
* @function
577+
*
578+
* @description
579+
* Alias for {@link angular.Object.copy}
580+
*/
581+
572582
/**
573583
* @ngdoc function
574584
* @name angular.Object.copy
@@ -653,6 +663,15 @@ function copy(source, destination){
653663
return destination;
654664
}
655665

666+
/**
667+
* @workInProgress
668+
* @ngdoc function
669+
* @name angular.equals
670+
* @function
671+
*
672+
* @description
673+
* Alias for {@link angular.Object.equals}
674+
*/
656675

657676
/**
658677
* @ngdoc function
@@ -775,6 +794,10 @@ function concat(array1, array2, index) {
775794
return array1.concat(slice.call(array2, index, array2.length));
776795
}
777796

797+
function sliceArgs(args, startIndex) {
798+
return slice.call(args, startIndex || 0, args.length);
799+
}
800+
778801

779802
/**
780803
* @workInProgress
@@ -794,7 +817,7 @@ function concat(array1, array2, index) {
794817
*/
795818
function bind(self, fn) {
796819
var curryArgs = arguments.length > 2
797-
? slice.call(arguments, 2, arguments.length)
820+
? sliceArgs(arguments, 2)
798821
: [];
799822
if (typeof fn == $function && !(fn instanceof RegExp)) {
800823
return curryArgs.length
@@ -1130,5 +1153,6 @@ function assertArg(arg, name, reason) {
11301153
}
11311154

11321155
function assertArgFn(arg, name) {
1133-
assertArg(isFunction(arg), name, 'not a function, got ' + (typeof arg));
1156+
assertArg(isFunction(arg), name, 'not a function, got ' +
1157+
(typeof arg == 'object' ? arg.constructor.name : typeof arg));
11341158
};

src/Browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Browser(window, document, body, XHR, $log) {
5252
*/
5353
function completeOutstandingRequest(fn) {
5454
try {
55-
fn.apply(null, slice.call(arguments, 1));
55+
fn.apply(null, sliceArgs(arguments, 1));
5656
} finally {
5757
outstandingRequestCount--;
5858
if (outstandingRequestCount === 0) {

src/Compiler.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Template.prototype = {
3030
childScope = isFunction(this.newScope) ? scope.$new(this.newScope(scope)) : scope.$new();
3131
element.data($$scope, childScope);
3232
}
33-
// TODO: refactor this!!!
33+
// TODO(misko): refactor this!!!
3434
// Why are inits even here?
3535
forEach(this.inits, function(fn) {
3636
queue.push(function() {
@@ -194,9 +194,6 @@ Compiler.prototype = {
194194
scope.$element = element;
195195
(cloneConnectFn||noop)(element, scope);
196196
template.attach(element, scope);
197-
// TODO: should this be here?
198-
// NO, since we get into infinity loop with ng:repeat
199-
// scope.$service('$updateView')();
200197
return scope;
201198
};
202199
},

src/JSON.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ function toJsonArray(buf, obj, pretty, stack) {
115115
}
116116
buf.push("]");
117117
} else if (isElement(obj)) {
118+
//TODO(misko): maybe in dev mode have a better error reporting?
118119
buf.push('DOM_ELEMENT');
119120
} else if (isDate(obj)) {
120121
buf.push(angular.String.quoteUnicode(angular.Date.toString(obj)));

0 commit comments

Comments
 (0)