Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da984ad187 | |||
| 4015357ce5 | |||
| dc3d11ad19 | |||
| 0e1545eb04 | |||
| ec7cabf5c9 | |||
| 3051beba2f | |||
| 92304323b1 | |||
| c28123a872 | |||
| d798423813 | |||
| 2583e77cc7 | |||
| f66836fee4 | |||
| 0ccc445d53 | |||
| b7d5fa1cbe | |||
| 8bb3942453 | |||
| 51a79cebcb | |||
| 36bcf64008 | |||
| 5c6630605b | |||
| 125827406c | |||
| 62c21422a6 | |||
| 98d489712e | |||
| 2cab2d8ef1 | |||
| 8fa2bb72bc | |||
| d151f94937 | |||
| 5b74b7185b | |||
| 4f0be2ae4e | |||
| bb9badeb2a | |||
| c287c8361d | |||
| ade7127c79 | |||
| d341483f1f | |||
| b36acbc857 | |||
| a4fea38b94 | |||
| 300c5c0c99 | |||
| 152537c4e9 | |||
| 8b46bf6bc9 | |||
| aef861eb41 | |||
| f61d36861d | |||
| 2af0348cea | |||
| 78c5743494 | |||
| 2cb9fbd043 | |||
| e9dad5dbf4 | |||
| 54895fc2a1 | |||
| 60a12b4161 | |||
| cd7e58ba41 | |||
| 9391475dc3 | |||
| 7840803add | |||
| 7d77de2834 | |||
| ab044cada6 | |||
| d010e0cc7d | |||
| 40f728b1aa | |||
| 23abb26405 | |||
| fd55bc8e1d | |||
| 541aaa4e08 | |||
| f22c422547 | |||
| 0e461f0c07 | |||
| 5074448443 | |||
| 8d66af11e6 | |||
| 169948bb47 | |||
| 58d9469574 | |||
| 8d858a2360 | |||
| 5540748890 | |||
| f8a52be817 | |||
| 3b5f1105f6 | |||
| 663ccc5449 | |||
| 263f47819f | |||
| 6b75475ce3 | |||
| 07c354a8c0 | |||
| 1391579599 | |||
| 5d2bd1d84c | |||
| bf77e212af | |||
| eef2f9c31e | |||
| 438627c2c3 |
+2
-1
@@ -1,7 +1,8 @@
|
||||
<a name="1.1.0"></a>
|
||||
# 1.1.0 increase-gravatas (2012-08-31)
|
||||
|
||||
_Note: 1.1.x releases are [considered unstable](http://blog.angularjs.org/2012/07/angularjs-10-12-roadmap.html)._
|
||||
_Note: 1.1.x releases unlike 1.0.x are considered unstable.
|
||||
[More info](http://blog.angularjs.org/2012/07/angularjs-10-12-roadmap.html)_
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -126,10 +126,10 @@
|
||||
<i class="icon-eye-open icon-white"></i> Learn <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="disabled"><a href="http://angularjs.org/">Why AngularJS?</a></li>
|
||||
<li class="disabled"><a href="">Why AngularJS?</a></li>
|
||||
<li><a href="http://www.youtube.com/user/angularjs">Watch</a></li>
|
||||
<li><a href="tutorial">Tutorial</a></li>
|
||||
<li><a href="http://builtwith.angularjs.org/">Case Studies</a></li>
|
||||
<li><a href="https://github.com/angular/angular.js/wiki/Projects-using-AngularJS">Case Studies</a></li>
|
||||
<li><a href="misc/faq">FAQ</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -139,10 +139,10 @@
|
||||
<i class="icon-book icon-white"></i> Develop <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="http://docs.angularjs.org/tutorial">Tutorial</a></li>
|
||||
<li><a href="http://docs.angularjs.org/guide/">Developer Guide</a></li>
|
||||
<li><a href="http://docs.angularjs.org/api/">API Reference</a></li>
|
||||
<li><a href="http://docs.angularjs.org/misc/contribute">Contribute</a></li>
|
||||
<li><a href="tutorial">Tutorial</a></li>
|
||||
<li><a href="guide/">Developer Guide</a></li>
|
||||
<li><a href="api/">API Reference</a></li>
|
||||
<li><a href="misc/contribute">Contribute</a></li>
|
||||
<li><a href="http://code.angularjs.org/">Download</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -410,10 +410,9 @@ function createInjector(modulesToLoad) {
|
||||
decorator: decorator
|
||||
}
|
||||
},
|
||||
providerInjector = (providerCache.$injector =
|
||||
createInternalInjector(providerCache, function() {
|
||||
throw Error("Unknown provider: " + path.join(' <- '));
|
||||
})),
|
||||
providerInjector = createInternalInjector(providerCache, function() {
|
||||
throw Error("Unknown provider: " + path.join(' <- '));
|
||||
}),
|
||||
instanceCache = {},
|
||||
instanceInjector = (instanceCache.$injector =
|
||||
createInternalInjector(instanceCache, function(servicename) {
|
||||
@@ -490,7 +489,9 @@ function createInjector(modulesToLoad) {
|
||||
try {
|
||||
for(var invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {
|
||||
var invokeArgs = invokeQueue[i],
|
||||
provider = providerInjector.get(invokeArgs[0]);
|
||||
provider = invokeArgs[0] == '$injector'
|
||||
? providerInjector
|
||||
: providerInjector.get(invokeArgs[0]);
|
||||
|
||||
provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
|
||||
}
|
||||
|
||||
+1
-3
@@ -381,8 +381,6 @@ function $HttpProvider() {
|
||||
* - **withCredentials** - `{boolean}` - whether to to set the `withCredentials` flag on the
|
||||
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
|
||||
* requests with credentials} for more information.
|
||||
* - **responseType** - `{string}` - see {@link
|
||||
* https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.
|
||||
*
|
||||
* @returns {HttpPromise} Returns a {@link ng.$q promise} object with the
|
||||
* standard `then` method and two http specific methods: `success` and `error`. The `then`
|
||||
@@ -699,7 +697,7 @@ function $HttpProvider() {
|
||||
// if we won't have the response in cache, send the request to the backend
|
||||
if (!cachedResp) {
|
||||
$httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
|
||||
config.withCredentials, config.responseType);
|
||||
config.withCredentials);
|
||||
}
|
||||
|
||||
return promise;
|
||||
|
||||
@@ -32,7 +32,7 @@ function $HttpBackendProvider() {
|
||||
|
||||
function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, locationProtocol) {
|
||||
// TODO(vojta): fix the signature
|
||||
return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
|
||||
return function(method, url, post, callback, headers, timeout, withCredentials) {
|
||||
$browser.$$incOutstandingRequestCount();
|
||||
url = url || $browser.url();
|
||||
|
||||
@@ -65,8 +65,8 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
|
||||
// always async
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4) {
|
||||
completeRequest(callback, status || xhr.status, xhr.response || xhr.responseText,
|
||||
xhr.getAllResponseHeaders());
|
||||
completeRequest(
|
||||
callback, status || xhr.status, xhr.responseText, xhr.getAllResponseHeaders());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -74,10 +74,6 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
|
||||
xhr.withCredentials = true;
|
||||
}
|
||||
|
||||
if (responseType) {
|
||||
xhr.responseType = responseType;
|
||||
}
|
||||
|
||||
xhr.send(post || '');
|
||||
|
||||
if (timeout > 0) {
|
||||
|
||||
+10
-16
@@ -52,7 +52,7 @@ function $InterpolateProvider() {
|
||||
};
|
||||
|
||||
|
||||
this.$get = ['$parse', '$exceptionHandler', function($parse, $exceptionHandler) {
|
||||
this.$get = ['$parse', function($parse) {
|
||||
var startSymbolLength = startSymbol.length,
|
||||
endSymbolLength = endSymbol.length;
|
||||
|
||||
@@ -124,24 +124,18 @@ function $InterpolateProvider() {
|
||||
if (!mustHaveExpression || hasInterpolation) {
|
||||
concat.length = length;
|
||||
fn = function(context) {
|
||||
try {
|
||||
for(var i = 0, ii = length, part; i<ii; i++) {
|
||||
if (typeof (part = parts[i]) == 'function') {
|
||||
part = part(context);
|
||||
if (part == null || part == undefined) {
|
||||
part = '';
|
||||
} else if (typeof part != 'string') {
|
||||
part = toJson(part);
|
||||
}
|
||||
for(var i = 0, ii = length, part; i<ii; i++) {
|
||||
if (typeof (part = parts[i]) == 'function') {
|
||||
part = part(context);
|
||||
if (part == null || part == undefined) {
|
||||
part = '';
|
||||
} else if (typeof part != 'string') {
|
||||
part = toJson(part);
|
||||
}
|
||||
concat[i] = part;
|
||||
}
|
||||
return concat.join('');
|
||||
}
|
||||
catch(err) {
|
||||
var newErr = new Error('Error while interpolating: ' + text + '\n' + err.toString());
|
||||
$exceptionHandler(newErr);
|
||||
concat[i] = part;
|
||||
}
|
||||
return concat.join('');
|
||||
};
|
||||
fn.exp = text;
|
||||
fn.parts = parts;
|
||||
|
||||
+6
-7
@@ -5,7 +5,6 @@
|
||||
*
|
||||
* @name ng.$sniffer
|
||||
* @requires $window
|
||||
* @requires $document
|
||||
*
|
||||
* @property {boolean} history Does the browser support html5 history api ?
|
||||
* @property {boolean} hashchange Does the browser support hashchange event ?
|
||||
@@ -14,10 +13,9 @@
|
||||
* This is very simple implementation of testing browser's features.
|
||||
*/
|
||||
function $SnifferProvider() {
|
||||
this.$get = ['$window', '$document', function($window, $document) {
|
||||
this.$get = ['$window', function($window) {
|
||||
var eventSupport = {},
|
||||
android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]),
|
||||
document = $document[0];
|
||||
android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]);
|
||||
|
||||
return {
|
||||
// Android has history.pushState, but it does not update location correctly
|
||||
@@ -27,7 +25,7 @@ function $SnifferProvider() {
|
||||
history: !!($window.history && $window.history.pushState && !(android < 4)),
|
||||
hashchange: 'onhashchange' in $window &&
|
||||
// IE8 compatible mode lies
|
||||
(!document.documentMode || document.documentMode > 7),
|
||||
(!$window.document.documentMode || $window.document.documentMode > 7),
|
||||
hasEvent: function(event) {
|
||||
// IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
|
||||
// it. In particular the event is not fired when backspace or delete key are pressed or
|
||||
@@ -35,13 +33,14 @@ function $SnifferProvider() {
|
||||
if (event == 'input' && msie == 9) return false;
|
||||
|
||||
if (isUndefined(eventSupport[event])) {
|
||||
var divElm = document.createElement('div');
|
||||
var divElm = $window.document.createElement('div');
|
||||
eventSupport[event] = 'on' + event in divElm;
|
||||
}
|
||||
|
||||
return eventSupport[event];
|
||||
},
|
||||
csp: document.SecurityPolicy ? document.SecurityPolicy.isActive() : false
|
||||
// TODO(i): currently there is no way to feature detect CSP without triggering alerts
|
||||
csp: false
|
||||
};
|
||||
}];
|
||||
}
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ describe('Binder', function() {
|
||||
$rootScope.error['throw'] = function() {throw 'MyError';};
|
||||
errorLogs.length = 0;
|
||||
$rootScope.$apply();
|
||||
expect(errorLogs.shift().message).toBe('Error while interpolating: {{error.throw()}}\nMyError');
|
||||
expect(errorLogs.shift()).toBe('MyError');
|
||||
|
||||
$rootScope.error['throw'] = function() {return 'ok';};
|
||||
$rootScope.$apply();
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
describe('injector', function() {
|
||||
var providers;
|
||||
var injector;
|
||||
var providerInjector;
|
||||
|
||||
beforeEach(module(function($provide, $injector) {
|
||||
beforeEach(module(function($provide) {
|
||||
providers = function(name, factory, annotations) {
|
||||
$provide.factory(name, extend(factory, annotations||{}));
|
||||
};
|
||||
providerInjector = $injector;
|
||||
}));
|
||||
beforeEach(inject(function($injector){
|
||||
injector = $injector;
|
||||
@@ -74,11 +72,6 @@ describe('injector', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should create a new $injector for the run phase', inject(function($injector) {
|
||||
expect($injector).not.toBe(providerInjector);
|
||||
}));
|
||||
|
||||
|
||||
describe('invoke', function() {
|
||||
var args;
|
||||
|
||||
@@ -542,26 +535,26 @@ describe('injector', function() {
|
||||
|
||||
|
||||
it('should decorate the missing service error with module name', function() {
|
||||
angular.module('TestModule', [], function(xyzzy) {});
|
||||
angular.module('TestModule', [], function($injector) {});
|
||||
expect(function() {
|
||||
createInjector(['TestModule']);
|
||||
}).toThrow('Unknown provider: xyzzy from TestModule');
|
||||
}).toThrow('Unknown provider: $injector from TestModule');
|
||||
});
|
||||
|
||||
|
||||
it('should decorate the missing service error with module function', function() {
|
||||
function myModule(xyzzy){}
|
||||
function myModule($injector){}
|
||||
expect(function() {
|
||||
createInjector([myModule]);
|
||||
}).toThrow('Unknown provider: xyzzy from ' + myModule);
|
||||
}).toThrow('Unknown provider: $injector from ' + myModule);
|
||||
});
|
||||
|
||||
|
||||
it('should decorate the missing service error with module array function', function() {
|
||||
function myModule(xyzzy){}
|
||||
function myModule($injector){}
|
||||
expect(function() {
|
||||
createInjector([['xyzzy', myModule]]);
|
||||
}).toThrow('Unknown provider: xyzzy from ' + myModule);
|
||||
createInjector([['$injector', myModule]]);
|
||||
}).toThrow('Unknown provider: $injector from ' + myModule);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -135,24 +135,6 @@ describe('$httpBackend', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should set responseType and return xhr.response', function() {
|
||||
$backend('GET', '/whatever', null, callback, {}, null, null, 'blob');
|
||||
|
||||
var xhrInstance = MockXhr.$$lastInstance;
|
||||
expect(xhrInstance.responseType).toBe('blob');
|
||||
|
||||
callback.andCallFake(function(status, response) {
|
||||
expect(response).toBe(xhrInstance.response);
|
||||
});
|
||||
|
||||
xhrInstance.response = {some: 'object'};
|
||||
xhrInstance.readyState = 4;
|
||||
xhrInstance.onreadystatechange();
|
||||
|
||||
expect(callback).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
|
||||
describe('JSONP', function() {
|
||||
|
||||
var SCRIPT_URL = /([^\?]*)\?cb=angular\.callbacks\.(.*)/;
|
||||
|
||||
+3
-6
@@ -959,13 +959,12 @@ describe('$http', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should pass timeout, withCredentials and responseType', function() {
|
||||
it('should pass timeout and withCredentials', function() {
|
||||
var $httpBackend = jasmine.createSpy('$httpBackend');
|
||||
|
||||
$httpBackend.andCallFake(function(m, u, d, c, h, timeout, withCredentials, responseType) {
|
||||
$httpBackend.andCallFake(function(m, u, d, c, h, timeout, withCredentials) {
|
||||
expect(timeout).toBe(12345);
|
||||
expect(withCredentials).toBe(true);
|
||||
expect(responseType).toBe('json');
|
||||
});
|
||||
|
||||
module(function($provide) {
|
||||
@@ -973,9 +972,7 @@ describe('$http', function() {
|
||||
});
|
||||
|
||||
inject(function($http) {
|
||||
$http({
|
||||
method: 'GET', url: 'some.html', timeout: 12345, withCredentials: true, responseType: 'json'
|
||||
});
|
||||
$http({method: 'GET', url: 'some.html', timeout: 12345, withCredentials: true});
|
||||
expect($httpBackend).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
|
||||
@@ -25,29 +25,6 @@ describe('$interpolate', function() {
|
||||
expect($interpolate('{{ false }}')()).toEqual('false');
|
||||
}));
|
||||
|
||||
it('should rethrow exceptions', inject(function($interpolate, $rootScope) {
|
||||
$rootScope.err = function () {
|
||||
throw new Error('oops');
|
||||
};
|
||||
expect(function () {
|
||||
$interpolate('{{err()}}')($rootScope);
|
||||
}).toThrow('Error while interpolating: {{err()}}\nError: oops');
|
||||
}));
|
||||
|
||||
it('should stop interpolation when encountering an exception', inject(function($interpolate, $compile, $rootScope) {
|
||||
$rootScope.err = function () {
|
||||
throw new Error('oops');
|
||||
};
|
||||
var dom = jqLite('<div>{{1 + 1}}</div><div>{{err()}}</div><div>{{1 + 2}}</div>');
|
||||
$compile(dom)($rootScope);
|
||||
expect(function () {
|
||||
$rootScope.$apply();
|
||||
}).toThrow('Error while interpolating: {{err()}}\nError: oops');
|
||||
expect(dom[0].innerHTML).toEqual('2');
|
||||
expect(dom[1].innerHTML).toEqual('{{err()}}');
|
||||
expect(dom[2].innerHTML).toEqual('{{1 + 2}}');
|
||||
}));
|
||||
|
||||
|
||||
it('should return interpolation function', inject(function($interpolate, $rootScope) {
|
||||
$rootScope.name = 'Misko';
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ describe('$log', function() {
|
||||
|
||||
|
||||
beforeEach(module(function($provide){
|
||||
$window = {navigator: {}, document: {}};
|
||||
$window = {navigator: {}};
|
||||
logger = '';
|
||||
log = function() { logger+= 'log;'; };
|
||||
warn = function() { logger+= 'warn;'; };
|
||||
|
||||
+6
-24
@@ -2,10 +2,9 @@
|
||||
|
||||
describe('$sniffer', function() {
|
||||
|
||||
function sniffer($window, $document) {
|
||||
function sniffer($window) {
|
||||
$window.navigator = {};
|
||||
$document = jqLite($document || {});
|
||||
return new $SnifferProvider().$get[2]($window, $document);
|
||||
return new $SnifferProvider().$get[1]($window);
|
||||
}
|
||||
|
||||
describe('history', function() {
|
||||
@@ -21,15 +20,15 @@ describe('$sniffer', function() {
|
||||
|
||||
describe('hashchange', function() {
|
||||
it('should be true if onhashchange property defined', function() {
|
||||
expect(sniffer({onhashchange: true}, {}).hashchange).toBe(true);
|
||||
expect(sniffer({onhashchange: true, document: {}}).hashchange).toBe(true);
|
||||
});
|
||||
|
||||
it('should be false if onhashchange property not defined', function() {
|
||||
expect(sniffer({}, {}).hashchange).toBe(false);
|
||||
expect(sniffer({document: {}}).hashchange).toBe(false);
|
||||
});
|
||||
|
||||
it('should be false if documentMode is 7 (IE8 comp mode)', function() {
|
||||
expect(sniffer({onhashchange: true}, {documentMode: 7}).hashchange).toBe(false);
|
||||
expect(sniffer({onhashchange: true, document: {documentMode: 7}}).hashchange).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -43,7 +42,7 @@ describe('$sniffer', function() {
|
||||
if (elm === 'div') return mockDivElement;
|
||||
});
|
||||
|
||||
$sniffer = sniffer({}, mockDocument);
|
||||
$sniffer = sniffer({document: mockDocument});
|
||||
});
|
||||
|
||||
|
||||
@@ -79,21 +78,4 @@ describe('$sniffer', function() {
|
||||
expect($sniffer.hasEvent('input')).toBe((msie == 9) ? false : true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('csp', function() {
|
||||
it('should be false if document.SecurityPolicy.isActive not available', function() {
|
||||
expect(sniffer({}, {}).csp).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
it('should use document.SecurityPolicy.isActive() if available', function() {
|
||||
var createDocumentWithCSP = function(csp) {
|
||||
return {SecurityPolicy: {isActive: function() {return csp;}}};
|
||||
};
|
||||
|
||||
expect(sniffer({}, createDocumentWithCSP(false)).csp).toBe(false);
|
||||
expect(sniffer({}, createDocumentWithCSP(true)).csp).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
# AngularJS build config file
|
||||
---
|
||||
version: 1.1.0
|
||||
codename: increase-gravatas
|
||||
version: 1.0.2
|
||||
codename: debilitating-awesomeness
|
||||
stable: 1.0.1
|
||||
|
||||
Reference in New Issue
Block a user