aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng
AgeCommit message (Collapse)Author
2014-02-06fix(mocks): remove usage of $animate.flushNext in favour of queingMatias Niemelä
The flushNext method of testing is difficult and highly coupled with the behavior of ngAnimate's $animate workflow. It is much better instead to just queue all $animate animation calls into a queue collection which is available on the $animate service when mock.animate is included as a module within test code.
2014-01-31fix($q): make $q.reject support `finally` and `catch`Lucas Galfasó
Add support for the functions `finally` and `catch` to the promise returned by `$q.reject` Closes #6048 Closes #6076
2014-01-31fix($compile): retain CSS classes added in cloneAttachFn on asynchronous ↵Caitlin Potter
directives Previously, classes added to asynchronous directive elements during the clone attach function would not persist after the node is merged with the template, prior to linking. This change corrects this behaviour and brings it in line with synchronous directives. Closes #5439 Closes #5617
2014-01-31fix(filterFilter): don't interpret dots in predicate object fields as pathsIgor Minar
Closes #6005 Closes #6009
2014-01-22fix(a): don't preventDefault on click when SVGAElement has an xlink:href ↵Caitlin Potter
attribute Before this change, an SVGAElement with an xlink:href attribute and no href or name attribute which was compiled by the angular HTML compiler would never be clickable, due to the htmlAnchorDirective calling event.preventDefault() due to the missing href attribute. This change corrects this behaviour by also testing the xlink:href attribute if the element in question is determined to be an SVG anchor tag (with the href property having type SVGAnimatedString) Closes #5896 Closes #5897
2014-01-21fix(input): use Chromium's email validation regexpCaitlin Potter
This change uses the regexp from Chromium/Blink to validate emails, and corrects an error in the validation engine, which previously considered an invalid email to be valid. Additionally, the regexp was invalidating emails with capital letters, however this is not the behaviour recomended in the spec, or implemented in Chromium. Closes #5899 Closes #5924
2014-01-21fix($parse): do not use locals to resolve object propertiesLucas Galfasó
Do not use the locals when performing a field access in an angular expression. Closes #5838 Closes #5862
2014-01-13fix($http): ensure default headers PUT and POST are different objectsHendrixer
Send PUT and POST through copy() to make sure they are not the same. Closes #5742 Closes #5747 Closes #5764
2014-01-13fix($rootScope): prevent infinite $digest by checking if asyncQueue is empty ↵Noam Lewis
when decrementing ttl An infinite $digest loop can be caused by expressions that invoke a promise. The problem is that $digest does not decrement ttl unless it finds dirty changes; it should check also if asyncQueue is empty. Generally the condition for decrementing ttl should be the same as the condition for terminating the $digest loop. Fixes #2622
2014-01-10feat(select): allow multiline ng-optionsAjay Roopakalu
This patch allows the ng-options value of a <select> element to span multiple lines, which would previously throw an error when used with filters. Closes #5602
2014-01-10fix($http): return responseText on IE8 for requests with responseType setIgor Minar
Closes #4464 Closes #4738 Closes #5636
2014-01-09revert: fix($location): return '/' for root path in hashbang modeIgor Minar
This reverts commit 63cd873fef3207deef30c7a7ed66f4b8f647dc12. The change breaks existing tests of Google apps. The problem is that while we tried to avoid adding #/ to window.location.href unnecessarily we failed doing so. Likely because by setting $path, at some point (during a digest) we try to check if $location changed and we mistake the default '/' with an explicit settign of the path via the `path()` method. This results in us writing the url with '#/' into $browser.url() which updates the window.location by adding "#/" to the url - something we tried to avoid in the first place. I'll reopen PR #5712.
2014-01-09fix($location): return '/' for root path in hashbang modeCaitlin Potter
Before this change, on the root of the application, $location.path() would return the empty string. Following this change, it will always return a root of '/'. Closes #5650 Closes #5712
2014-01-09fix($httpBackend): Allow status code 0 from any protocolRafał Jagoda
Android 4.1 stock browser also returns status code 0 when a template is loaded via `http` and the application is cached using appcache. Fixes #1356. Closes #5547.
2014-01-08fix($httpBackend): cancelled JSONP requests will not print error in the consoleArtemy Tregubenko
When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes #5615 Closes #5616
2014-01-06chore(inputSpec): fixed typoBen Wiklund
2014-01-05refactor(filterFilter): simplify code by a ternary op instead of if-elseRoyLING
- use only one IIFE and a ternary op in it, instead of invoking separate IIFEs in if-else (this also completely fixed the same issue closed by PR #3597) - also add a spec to verify usage of '$' property in expression object (e.g. `{$: 'a'}`) Closes #5637
2014-01-03fix($parse): fix CSP nested property evaluation, and issue that prevented ↵Brian Nenninger
its tests from failing cspSafeGetterFn incorrectly returned undefined if any of its key parameters were undefined. This wasn't caught by the $parse unit tests because of a timing problem where $ParseProvider was reading the CSP flag before the tests manually set it, so the CSP property evaluation tests never ran. Add test that verifies evaluation of nested properties of multiple lengths. Closes #5591 Closes #5592
2014-01-03fix($httpBackend): don't delete xhr.onreadystatechange otherwise Safari :-OIgor Minar
2014-01-02fix(ngShow/ngHide, ngIf): functions with zero args should be truthyBrian Ford
Previously, expressions that were a function with one or more arguments evaluated to true, but functions with zero arguments evaluated to false. This behavior seems both unintentional and undesirable. This patch makes a function truthy regardless of its number of arguments. Closes #5414
2014-01-02fix($httpBackend): use ActiveX XHR when making PATCH requests on IE8Igor Minar
IE8's native XHR doesn't support PATCH requests, but the ActiveX one does. I'm also removing the noxhr error doc because nobody will ever get that error. Closes #2518 Closes #5043
2014-01-02fix($location): $location.path() behaviour when $locationChangeStart is ↵Sebastian K
triggered by the browser Fixed inconsistency in $location.path() behaviour on the $locationChangeStart event when using back/forward buttons in the browser or manually changing the url in the address bar. $location.path() now returns the target url in these cases. Closes #4989 Closes #5089 Closes #5118 Closes #5580
2014-01-02fix($browser): remove base href domain when url begins with '//'Caitlin Potter
This change prevents an incorrect appBase url from being calculated when the <base> href's domain begins with '//'. Closes #5606
2014-01-02fix(ngRepeat): allow for more flexible coding style in ngRepeat expressionGias Kay Lee
With this change it's possible to split the ng-repeat expression into multiple lines at any point in the expression where white-space is expected. Closes #5537 Closes #5598
2014-01-02fix(Scope): don't let watch deregistration mess up the dirty-checking digest ↵Igor Minar
loop Closes #5525
2014-01-02test(rootScope): reorganize $watch deregistration specs into a describeIgor Minar
2014-01-02fix($httpBackend): Ignore multiple calls to onreadystatechange with readyState=4Tobias Bosch
On mobile webkit `onreadystatechange` might by called multiple times with `readyState===4` caused by xhrs that are resolved while the app is in the background. Fixes #5426.
2013-12-31test(compileSpec): fix broken build on FFIgor Minar
FF 26.0 now throws: "TypeError: NodeList doesn't have an indexed property setter." when we try to assign to `childNodes[1]`, since this test still works properly on Chrome and the issue being tested is not a cross-browser issues, I'm just making the patchability check more robust instead of trying to figure out how to make this test fully pass on FF.
2013-12-30fix(input): prevent double $digest when using jQuery trigger.Michał Gołębiowski
If an event was performed natively, jQuery sets the isTrigger property. When triggering event manually, the field is not present. Manually triggered events are performed synchronously which causes the "$digest already in progress" error. Closes #5293
2013-12-27perf(Scope): limit propagation of $broadcast to scopes that have listeners ↵Karl Seamon
for the event Update $on and $destroy to maintain a count of event keys registered for each scope and its children. $broadcast will not descend past a node that has a count of 0/undefined for the $broadcasted event key. Closes #5341 Closes #5371
2013-12-19fix($compile): remove invalid IE exceptional case for `href`Alexandre Potvin Latreille
It appears that this exceptional case was only valid for IE<8 and that for IE>=8 it was actually causing a bug with the `ng-href-attr` directive on `<a>` elements. Closes #5479
2013-12-19fix($parse): return 'undefined' if a middle key's value is nullCaitlin Potter
Prior to this fix, $parse/$eval would return 'null' if a middle key in an expression's value is null, when it should be expected to be undefined. This patch tries to remedy this by returning undefined for middle values in expressions, when fetching a child of that null value. For example: ```js // Given the following object: $scope.a = { b: null }; // $scope.$eval('a.b.c') returns undefined, whereas previously it would return null ``` Closes #5480
2013-12-18fix($location): parse xlink:href for SVGAElementsCaitlin Potter
Before this fix, the xlink:href property of an SVG <a> element could not be parsed on click, as the property is an SVGAnimatedString rather than a DOMString. This patch parses the xlink:href's animVal into a DOMString in order to prevent an `Object #<SVGAnimatedString> has no method 'indexOf'` exception from being thrown, and also to update the location if necessary as expected. Closes #5472 Closes #5198 Closes #5199 Closes #4098 Closes #1420
2013-12-18perf($parse) use a faster path when the number of path parts is lowKarl Seamon
Use a faster path when the number of path tokens is low (ie the common case). This results in a better than 19x improvement in the time spent in $parse and produces output that is about the same speed in chrome and substantially faster in firefox. http://jsperf.com/angularjs-parse-getter/6 Closes #5359
2013-12-18fix(input): do not hold input for composition on androidChia-liang Kao
Workaround for chrome for android until #2129 is ready. Closes #5308, #5323
2013-12-18chore($sniffer): make android variable publicChia-liang Kao
2013-12-17fix(select): invalidate when 'multiple`, `required` and model is `[]`Caitlin Potter
When `multiple` attribute is set on a `<select>` control and the model value is an empty array, we should invalidate the control. Previously, this directive was using incorrect logic for determining if the model was empty. Closes #5337
2013-12-16fix(ngRepeat): allow multiline expressionsRhys Brett-bowen
allow and pass through new line characters when checking passed in expression Closes #5000
2013-12-13perf(jqLite): implement and use the `empty` method in place of `html(‘’)`Michał Gołębiowski
jQuery's elem.html('') is way slower than elem.empty(). As clearing element contents happens quite often in certain scenarios, switching to using .empty() provides a significant performance boost when using Angular with jQuery. Closes #4457
2013-12-13perf(a): do not link when href or name exists in templateKarl Seamon
Change the a directive to link and hookup a click event only when there is no href or name in the template element. In a large Google app, this results in about 800 fewer registrations, saving a small but measurable amount of time and memory. Closes #5362
2013-12-12fix(ngInclude): Add template to DOM before linking other directivesTobias Bosch
The template needs to be added to the DOM before other directives at the same element as `ngInclude` are linked. Fixes #5247.
2013-12-12fix($compile): Allow literals in isolate scope referencesTobias Bosch
When a component uses an isolate scope reference and the the component is used with an object literal a new object is created on every evaluation. Therefore the compiler needs to compare the values of the parent and the isolate scope using object equality and not object reference equality. Fixes #5296.
2013-12-05fix($compile): update cloned elements if the template arrives after the cloningTobias Bosch
If an element has a directive whose content is loaded using `templateUrl`, and the element is cloned using a linking function before the template arrives, the clone needs to be updated as well. This also updates `ngIf` and `ngRepeat` to keep the connection to the clone of a tranclude function, so that they know about the changes a directive with `templateUrl` does to the element in the future. Fixes to #4930.
2013-12-05chore(Scope): short-circuit after dirty-checking last dirty watcherKarl Seamon
Stop dirty-checking during $digest after the last dirty watcher has been re-checked. This prevents unneeded re-checking of the remaining watchers (They were already checked in the previous iteration), bringing a substantial performance improvement to the average case run time of $digest. Closes #5272 Closes #5287
2013-12-04fix(ngInit): evaluate ngInit before ngIncludeCaitlin Potter
The priority of ngInit is adjusted to occur before ngInclude, and after ngController. This enables ngInit to initiallize values in a controller's scope, and also to initiallize values before ngInclude executes. Closes #5167 Closes #5208
2013-12-04fix(input): ensure ngModelWatch() triggers second digest pass when appropriateDaniel Tabuenca
Due to an earlier change, ngModelWatch() no longer returns a value to the caller. This means the digest loop has no way to tell if the watch actually modified anything and so can not schedule another pass. This means any watches that watch form or model controller changes (e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch() will not be able to see any changes made therin. This commit fixes this behavior by returning the latest evaluated ng-model value. Closes #5258 Closes #5282
2013-12-04fix($rootScope): broadcast $destroy event on $rootScopeJeff Cross
Fixes #5169
2013-12-04fix($rootScope): clear phase if an exception is raised by a watcherThomas Guillory
Add calls to clearPhase() when an exception is raised by a watcher while a digest cycle, in order to not be stuck on `$digest` scope phase
2013-12-04fix($compile): ensure isolated local watches' lastValue is always in syncDaniel Tabuenca
When using two-way binding with isolate scope, under some circumstances the lastValue variable captured in the parentValueWatch function can get out of sync. Specifically, if both the value in the origin scope as well as the value in the isolate scope get independently updated to the same value within one digest cycle, the lastValue is never updated. This potentially causes the watch to make the wrong decision as to which side to update on subsequent passes. This fixes things by ensuring lastValue is always set to the last seen value even if the watch's logic was short circuited because there was no difference between the values in the original and isolate scopes. Closes #5182
2013-11-26refactor($location): move file://+win path fix to $locationJeff Cross
The urlResolve method was fixed to automatically remove the volume label from path names to fix issues with the file protocol on windows where $location.path() was returning paths where the first segment would be the volume name, such as "/C:/mypath". See #4942 and #4928 However, the solution was specific to the $location non- HTML5 mode, and was implemented at a lower level of abstraction than it should have been. This refactor moves the fix to inside of the LocationHashBangUrl $$parse method. Closes #5041