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

Issue with canceling XHR request using promises - fixed #11035

Closed
wants to merge 489 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
489 commits
Select commit Hold shift + click to select a range
6b304c2
chore(utils.js): only set maximum stack size on non-win32 machines
petebacondarwin Apr 29, 2015
d623582
chore(docs): include attribute type in directive usage
petebacondarwin Apr 29, 2015
d08102d
docs(ngAnimate): fix typo in 'greetingBox' directive
rjatkinson2 Apr 30, 2015
5a1ed03
docs(contribute): transpose "however" and "it's"
thatType Apr 23, 2015
89088b5
style(docs): improve formatting in code comment
vokoshyv Apr 22, 2015
9f01761
docs(ngCloak): remove information for ie7
stevemao Apr 21, 2015
c8c279b
docs(form): replace obsolete tt element
Apr 14, 2015
68c136d
docs(ngSwitch): Replace tt tag with code tag
rparrapy Apr 4, 2015
15e2426
docs(ngModel): improve formatting of `$modelValue`
LeonardoBraga Apr 2, 2015
3e45bc9
fix(ngOptions): iterate over the options collection in the same way a…
petebacondarwin Apr 30, 2015
7cc2c9f
docs(ngJq): update to indicate common pitfall
Apr 30, 2015
242b77b
docs(changelog): wrap jqLite example containing html with code block
Narretz Apr 30, 2015
a29fb9e
fix(ngOptions): ensure label is watched in all cases
petebacondarwin May 1, 2015
b47fd6c
test(ngOptions): remove unnnecessary var
petebacondarwin May 1, 2015
e562486
docs($provide): add array annotation type to $provide.decorator param…
KevinBrogan Apr 3, 2015
4b12b75
docs($injector): add array annotation to all injectable parameters
petebacondarwin May 5, 2015
7555867
fix(jqLite): check for "length" in obj in isArrayLike to prevent iOS8…
snapwich Apr 7, 2015
24a6f31
docs($location): explain difference between $location.host() and loca…
dnozay Apr 28, 2015
9dcc023
docs($location): fix trailing whitespace
petebacondarwin May 5, 2015
00a22f8
test(ngRepeat): fix test setup for `ngRepeat` stability test
Apr 29, 2015
148a20a
docs(angular.element): clarify when jquery must be loaded for Angular…
petebacondarwin May 5, 2015
140141b
docs(guide/i18n): fix internal link to `MessageFormat Extensions` sec…
petebacondarwin May 5, 2015
0249eb1
fix($httpParamSerializerJQLike): follow jQuery logic for nested params
lgalfaso Apr 17, 2015
dda6962
style($http): add missing semi-colon
petebacondarwin May 5, 2015
45af1e0
fix($compile): ensure directive names have no leading or trailing whi…
lugovsky Apr 30, 2015
27f6499
fix(ngAnimate): ensure animations are not attempted on text nodes
matsko May 4, 2015
145c3ff
fix(core): ensure that multiple requests to requestAnimationFrame are…
matsko May 4, 2015
13108e3
fix(ngOptions): ensure that tracked properties are always watched
petebacondarwin May 1, 2015
2c8c454
fix(ngAnimate): ensure that all jqLite elements are deconstructed pro…
matsko Apr 29, 2015
65a3368
docs(error/nonassign): add optional binding example
Apr 23, 2015
966a7fb
fix(ngClass): add/remove classes which are properties of Object.proto…
caitp May 5, 2015
e078dc2
fix(ngAnimate): ensure that the temporary CSS classes are applied bef…
matsko May 4, 2015
3288dc4
docs(ngAnimate): add docs for the usage of the `ng-animate` CSS class
matsko May 5, 2015
64ff692
fix(ngAnimate): prohibit usage of the `ng-animate` class with classNa…
matsko May 5, 2015
5b051e5
fix(ngAnimate): ensure that shared CSS classes between anchor nodes a…
matsko May 6, 2015
0378432
fix(ngAnimate): rename `ng-animate-anchor` to `ng-anchor`
matsko May 6, 2015
738afef
fix(ngAnimate): force use of `ng-anchor` instead of a suffixed `-anch…
matsko May 6, 2015
13f7cc6
fix($animateCss): ensure that an object is always returned even when …
matsko Apr 25, 2015
3a7e446
feat(ngAnimate): ensure JS animations recognize $animateCss directly
matsko Apr 25, 2015
e011d2b
docs(CHANGELOG): update to 1.4.0-rc.2
petebacondarwin May 12, 2015
d82cf3d
fix(ngAnimate): ensure anchored animations remove the leave element a…
matsko May 11, 2015
7aad388
fix(ngAnimate): throw an error if a callback is passed to animate met…
petebacondarwin May 11, 2015
725e6f8
docs(error//nocb): add error doc for invalid parameter
petebacondarwin May 12, 2015
4f8bfd7
fix($http): do not modify the config object passed into $http short m…
maxthyen Apr 30, 2015
682dc60
docs(migration): general style improvements
Narretz May 11, 2015
e043f75
fix($animate): accept unwrapped DOM elements as inputs for enter + move
matsko May 18, 2015
4ad4491
docs(select): provide more info and example about non-string options
petebacondarwin May 18, 2015
d553778
fix(select): prevent unknown option being added to select when bound …
divercraig May 14, 2015
c3baa00
feat(filterFilter): allow array like objects to be filtered
May 1, 2015
bc59880
fix(ngAnimate): ensure that cancelled class-based animations are prop…
matsko May 18, 2015
1264611
fix(ngAnimate): ensure that repeated structural calls during pre-dige…
matsko May 18, 2015
6cbf9a6
fix(ngAnimate): class-based animations must not set addClass/removeCl…
matsko May 7, 2015
d5374f9
chore(test): update protractor to 2.1
juliemr May 20, 2015
2427de4
fix(ngAnimate): ensure nested class-based animations are spaced out w…
matsko May 20, 2015
7bc32d6
docs(ngPattern): add note about using the `g` flag
gkalpak May 22, 2015
d4192a8
revert: fix(ngAnimate): throw an error if a callback is passed to ani…
matsko May 22, 2015
92fce40
fix($animateCss): ensure that custom durations do not confuse the gcs…
matsko May 11, 2015
60ad9bf
test(matchers): fix "not" string for `toHaveClass` matcher
petebacondarwin May 23, 2015
43e5463
fix($animate): ignore invalid option parameter values
matsko May 26, 2015
8e47888
fix(ngAnimate): close follow-up class-based animations when the same …
matsko Apr 29, 2015
68cc7b8
docs(CHANGELOG): add changes for 1.4.0
matsko May 27, 2015
1122e86
feat($q): $q.resolve as an alias for $q.when
May 30, 2015
405c21b
refactor($compile): remove unused elementTransclusion argument
teropa May 30, 2015
eb4c64d
docs(guide/Expressions): added special case for one-time binding of o…
pholly May 29, 2015
b1648c1
docs(README.closure.md): clarify sentence
petebacondarwin Jun 1, 2015
c42c226
docs(guide/Scopes): capitalisation of word `scope`
mj-watts May 28, 2015
8d5ee7d
docs(numberFilter): update to match handling of null and undefined
calamarico May 28, 2015
7f121f2
docs(guide/Directives): use more standard `data-ng-model` in example
May 28, 2015
be5d8a0
docs(README): improve unusual phrasing
vokoshyv May 28, 2015
87d1ff3
docs(ngAnimate): fix typo
May 27, 2015
788f289
fix($parse): set null reference properties to `undefined`
lgalfaso May 31, 2015
5228a32
feat($compile): show module name during multidir error
lugovsky May 7, 2015
263c459
fix($compile): exception when using "watch" as isolated scope binding…
randing89 Apr 17, 2015
b46a509
chore(injector): avoid invoking noop
mechpen May 7, 2015
cf81398
docs(migration): fix minor typo
Jun 1, 2015
dce4460
fix(ngAria): ensure boolean values for aria-hidden and aria-disabled
fredsa Mar 18, 2015
0062278
test(ngAria): test that aria-hidden/disabled are always "true" or "fa…
typeofweb May 13, 2015
f95ed7d
chore(jscs): remove .jscs.json.todo, rename config to .jscsrc
hzoo Jun 1, 2015
6f2ad14
fix(ngOptions): use reference check only when not using trackBy
Jun 1, 2015
6bde575
docs(ngMessages): fix spelling error
yuriybash Jun 3, 2015
610414f
docs(ngMessages): fixes logical bug
0x-r4bbit Jun 2, 2015
2d7cb9b
docs(ngRepeat): document that track by must be the last expression
bcherny May 22, 2015
997e2ca
docs($cookiesProvider): escape HTML
twogood May 18, 2015
22d9fbe
docs($httpBackend): correct typo
May 14, 2015
b250908
docs(ngModelOptions): make object notation style consistent
stevemao May 14, 2015
be57752
docs(guide/Using $location): format parameter name
dguzzo May 14, 2015
1bf0bca
docs(guide/i18n): grammar fix
dguzzo May 14, 2015
ef9f8d5
docs(guide/security): remove errant word
dguzzo May 14, 2015
7318d31
docs(guide/Modules): simple grammar fix
dguzzo May 9, 2015
4bd1f2d
fix(ngAria): update `aria-valuemin/max` when `min/max` change
gkalpak Apr 30, 2015
caeffe1
fix(ngOptions): do not watch properties starting with $
petebacondarwin Jun 2, 2015
4b5c15f
docs(orderBy): improve sorting behaviour and move logic into the cont…
rjenks May 29, 2015
da9a742
docs(orderBy): fix JSCS trailing whitespace error
gkalpak Jun 4, 2015
fe715cc
docs(changelog): fixed grammatical error
Apr 21, 2015
3a618db
docs(guide/Conceptual Overview): remove text from in-page anchor tags
kevhuang Mar 28, 2015
8232959
docs(ngAria): clarify which module to include for ngAria
ajbogh May 4, 2015
182548e
docs(guide/expressions): include filters in one-time binding examples
Narretz Jun 4, 2015
03c28db
docs(*): improve accessibility of links
Narretz Jun 4, 2015
23d8552
docs(http): add info about unique cookies and XSRF protection on shar…
IgorMinar Jun 5, 2015
92975a6
docs(CHANGELOG): add changes for 1.3.16
matsko Jun 5, 2015
e586a86
docs(ngClass): add class 'has-error' to demonstrate hyphen use
qbzzt Jun 4, 2015
80c225c
fix($compile): workaround for IE11 MutationObserver
lgalfaso May 3, 2015
ea938b2
docs(tutorial/index): add a "next step" sentence
Jun 6, 2015
d9ff322
docs(tutorial/step0): display list correctly
josherick Jun 5, 2015
bacf383
docs(input[number]): mention incompatibility with allowInvalid
Narretz Jun 6, 2015
81c886c
docs($animateCss): fix a dangling link
Narretz Jun 6, 2015
22719b1
fix(copy): do not copy the same object twice
jbedard Feb 21, 2015
8b12508
perf($compile): avoid jquery data calls when there is no data
jbedard Jun 6, 2015
f4914eb
docs($compile): correct what gets passed to ctrl argument
Narretz Jun 8, 2015
5877ef2
docs(orderBy): correctly is not the right word
dwanderton Jun 7, 2015
0d0d1a3
docs(select): add note about breaking change with numeric values
Narretz Jun 8, 2015
b9a0ed0
test($compile): fix test
gkalpak Jun 9, 2015
546eed2
docs(select): correct workaround for numeric option bc
Narretz Jun 9, 2015
75a89d1
docs(tutorial/Tutorial): clarify what npm install does
dlink Jun 6, 2015
6d9d4a8
fix($sanitize): dont not remove tab index property
lgalfaso Jun 10, 2015
4dfd6c6
fix(linky): allow case insensitive scheme detection
Jun 10, 2015
4904b26
test($logSpec): don't pollute the global namespace with helpers
petebacondarwin Jun 10, 2015
5347e24
test($locationSpec): refactor and clean up tests
petebacondarwin Jun 10, 2015
b44d9c4
test($location): ensure mock window can be wrapped by jqLite
caitp Jun 11, 2015
e2a953e
fix(ngModel): form validation when there is an Object.prototype enume…
lgalfaso Jun 10, 2015
eed3225
fix($location): do not get caught in infinite digest in IE9
petebacondarwin Jun 11, 2015
396be99
fix(compile): assign ctrl return values correctly for multiple direct…
Narretz Jun 5, 2015
a95a93e
fix($parse): set null reference properties to `undefined`
lgalfaso Jun 12, 2015
62b1d12
docs($http): expand the param serializer docs
Narretz Jun 9, 2015
f944236
chore(npm): add the license to package.json
realityking Jun 14, 2015
f1e9adb
fix(forms): parse exponential notation in numberInputType parser
caitp Jun 15, 2015
7a61af4
docs(changelog): fix typo
Narretz Jun 15, 2015
d792564
docs(filter): document third argument of predicate function
ThomasLandauer Jun 2, 2015
809f0b9
docs(forms): remove redundant call to `$scope.$apply()`
noynir Jun 16, 2015
db38ab8
style(forms): fix indentation in example
gkalpak Jun 16, 2015
f9d470c
docs(CHANGELOG): add 1.4.1 changes
petebacondarwin Jun 16, 2015
3db6959
docs(input[radio]): clarify difference between value and ngValue
Narretz Jun 15, 2015
b5510d9
docs(guide/Unit Testing): add variable declaration to $filter test
Jun 16, 2015
de6474c
docs(resource): clarify success callback arguments
Narretz Jun 16, 2015
4c7dccc
fix($browser): prevent infinite digest if changing hash when there is…
petebacondarwin Jun 17, 2015
c61a00a
docs(CHANGELOG): fix typo
petebacondarwin Jun 17, 2015
8587627
fix($compile): do not write @-bound properties if attribute is not pr…
caitp Jun 17, 2015
c13c226
docs(tutorial): make docTutorialReset use a button
Narretz Jun 16, 2015
24971d2
docs(ngTouch): Document event parameter for $swipe handlers
alfonso-presa Jun 17, 2015
28faf68
docs(tutorial/Tutorial): add missing word
scampi Jun 17, 2015
07658ee
docs(CHANGELOG): fix position for some entries in 1.4.1
Narretz Jun 17, 2015
777d1d2
refact(filter): move `hasCustomToString` into shared namespace to be …
petebacondarwin Jun 16, 2015
0f41e5a
fix(orderBy): ensure correct ordering with arrays of objects and no p…
petebacondarwin Jun 18, 2015
b32fff2
fix($location): allow navigating outside the original base URL
tsuyoshizawa Mar 12, 2015
9d6c4a3
chore(dependencies): update to dgeni-packages 0.10.15
petebacondarwin Jun 21, 2015
a84b968
docs(directives): add multiElement tag to appropriate directives
petebacondarwin Jun 21, 2015
7ec99fc
docs($httpProvider): typo fix
JanDalF Jun 21, 2015
e4b3a5d
docs($http): set correct link to XMLHttpRequest.responseType
philBrown May 28, 2015
71f8d82
fix(merge): treat dates as atomic values instead of objects.
gabrielmaldi Apr 24, 2015
5694134
docs(ngCookies): improve deprecation notice
Narretz Jun 22, 2015
78bc5a9
docs(ngChecked): note that it shouldn't be used with ngModel
Narretz Jun 22, 2015
2177155
chore(doc-gen): update to dgeni-packages 0.10.17
petebacondarwin Jun 22, 2015
7138f36
fix(ngOptions): only watch numeric properties of an array
petebacondarwin Jun 23, 2015
a65dcde
test($compile): test default value for optional attribute with new scope
gkalpak Jun 23, 2015
2b77898
docs(ngAnimate): fix typos in JS and CSS selector
yichaowang Jun 24, 2015
70b382e
fix($compile): throw error when requestng new and isolate scopes (async)
gkalpak Jun 26, 2015
9f9971d
docs(guide/Migrating): add breaking change for 1.4 regarding controll…
bgever Jun 29, 2015
70a751e
docs(guide/Migrating): `$animate.on/off` example updated to match docs
cbosco Jun 25, 2015
66e4c85
docs(ngAnimate): fix typos
petebacondarwin Jun 30, 2015
d52352a
refactor($templateRequest): move $sce checks and trust the cache
rjamet Jun 30, 2015
b8939e0
docs($templateRequest): update the description with caching changes
rjamet Jun 30, 2015
5f8f995
refactor($templateRequest): Remove useless dependencies in tests
rjamet Jun 30, 2015
aad2269
revert: "fix($compile): do not write @-bound properties if attribute …
jeffbcross Jul 2, 2015
8c148b8
feat(ngAria): add option to disable role=button
marcysutton Jun 30, 2015
435ff7b
chore(animate): remove dead code
wesleycho Jul 1, 2015
9e2d4fe
docs(CHANGELOG): add changes for 1.4.2
Narretz Jul 6, 2015
5f12720
fix(loader): define isFunction
jerryorta-dev Jul 8, 2015
2166eca
refactor(ngCsp): use `document.head`
realityking May 19, 2015
c253a8d
docs($routeChangeSuccess): note that `resolve` values are available o…
petebacondarwin Jul 13, 2015
56de516
docs(guide/controller): clarify that controllers are defined **by** a…
niteshthakur May 17, 2015
fae94c8
docs(guide/controller): add a line about `controller as`
petebacondarwin Jul 13, 2015
3198708
docs(guide/controller): add a line about `controller as`
petebacondarwin Jul 13, 2015
4ccdf01
docs(CONTRIBUTING): revert is a modifier
stevemao Jul 1, 2015
c544113
docs(CONTRIBUTING): how to write a breaking change
stevemao Jul 1, 2015
27381a7
docs(CONTRIBUTING): state what is mandatory or optional
stevemao Jul 1, 2015
4ddbb7b
docs(ngAnimate) - Correct `keyframe` to `keyframeStyle`
Jun 15, 2015
a4e318a
fix(ngAnimate): ensure that orphaned elements do not throw errors whe…
matsko Jul 3, 2015
a1cd8e3
fix($animateCss): ensure animations execute if only a keyframeStyle i…
matsko Jul 14, 2015
4ce5df9
test($animateCss): ensure that `transitionStyle` by itself doesn't tr…
matsko Jul 14, 2015
9406698
test($animateCss): avoid unnecessary checking for transition-timing-f…
matsko Jul 14, 2015
c96ccf4
docs(CHANGELOG): add changes for 1.4.3
matsko Jul 15, 2015
18df6c3
docs(CHANGELOG): Remove redundant items from 1.4.3 changes
petebacondarwin Jul 15, 2015
cec290e
docs(migration): clarify non-numeric matching
petebacondarwin Jul 15, 2015
12f462f
fix(ngCsp): allow CSP to be configurable
petebacondarwin Jul 15, 2015
22c6a24
refactor($location): compute `appBaseNoFile` only once
petebacondarwin Jul 16, 2015
833a65c
fix($location): don't crash if navigating outside the app base
petebacondarwin Jul 16, 2015
d6f9d21
refactor($locale): use en-us as generic built-in locale
petebacondarwin Jul 16, 2015
2b3e9db
fix(i18n): by default put negative sign before currency symbol
petebacondarwin Jul 16, 2015
983251e
chore(i18n): update closure library
petebacondarwin Jul 16, 2015
8ec0d0f
chore(ngLocale): regenerate locales
petebacondarwin Jul 16, 2015
7a60574
docs(error/ctrlfmt): fixed a small typo in ctrl error message
apassanisi Jul 10, 2015
bba820d
docs(tutorial/7 - Routing): fix matching in test
Mohamed5amy Jul 9, 2015
0870dc7
docs(guide/Dependency Injection): minor punctuation fixes
kadimi Jul 3, 2015
1b4703b
docs($cookiesProvider): fixed a typo
kachhalimbu Jul 3, 2015
a6f93f4
docs($sce): correct typos
Jul 1, 2015
40071b6
fix(ngAnimate): $timeout without invokeApply
startswithaj Jul 7, 2015
18a3314
docs($animateCss): add missing options flag to animation example
matsko Jul 16, 2015
0979785
docs(CHANGELOG): fix release date of 1.4.3 version
jnizet Jul 15, 2015
7a18faa
chore(mocks): remove `$$animateReflow` from triggerReflow()
matsko Jul 16, 2015
8e6887d
chore($$forceReflow): create service for issuing reflows in animations
matsko Jul 16, 2015
b50029f
fix($animate): ensure that class-based animations are properly applie…
sreeramu Jul 6, 2015
181acf7
chore(core): introduce $$body service
matsko Jun 30, 2015
73e60fa
chore: replace `jqLite($document[0].body)` with `$$body`
matsko Jun 30, 2015
a458ac6
fix(ngAnimate): allow animations on body and root elements
OlenDavis May 27, 2015
9084ff2
chore(asyncCallback): Remove dead code
lgalfaso Jul 18, 2015
8bb2923
fix($q): Use extend to avoid overwriting prototype
Jan 9, 2015
67c5cc8
chore(angularFiles.js): Remove deleted file
lgalfaso Jul 18, 2015
b9900d4
docs(filter.js): documents second parameter to .register
matthewjh Jul 18, 2015
04b84d1
docs(guide/module): fixed link to blog post
supergibbs Jun 19, 2015
7ba8aba
docs(guide/Controllers): Syntax adjustments.
Jul 19, 2015
fd673e0
fix($animateCss): make sure that `skipBlocking` avoids the pre-emptiv…
matsko Jun 30, 2015
16ceb56
chore(ngAnimate): skip adding the preparation classes when options.$$…
matsko Jun 30, 2015
1d9395a
revert: fix(ngAnimate): ensure nested class-based animations are spac…
matsko Jun 30, 2015
84f21e3
fix(ngAnimate): ensure that parent class-based animations are never c…
matsko Jun 30, 2015
e4fd7f7
fix(httpParamSerializerJQLike): Follow jQuery for index of arrays of …
lgalfaso Jul 21, 2015
83283ae
fix(merge): regExp should not be treated as a objects when merging.
sreeramu Jul 23, 2015
5d6140f
fix($rootScope): don't clear phase if $apply is re-entered
lgalfaso Jun 19, 2015
e1aeb74
docs($compile): pluralize DOM element
johnstonbl01 Jul 25, 2015
5795794
docs(ngOptions): remove obsolete trkslct error page
Narretz Jul 23, 2015
0ac01e1
fix(input): Firefox validation trigger
lgalfaso Jun 13, 2015
1e494b8
fix($animate): make sure to run a post-digest reflow for parentless a…
matsko Jul 22, 2015
a80b74a
test(expression): add `sleep(100)` to protractor spec that uses `alert`
petebacondarwin Jul 27, 2015
e6b26a4
revert: refactor($locale): use en-us as generic built-in locale
petebacondarwin Jul 27, 2015
7526fe7
fix(ng/$locale): by default put negative sign before currency symbol
petebacondarwin Jul 27, 2015
67e911c
fix(Angular): allow unescaped `=` signs in values in `parseKeyValue`
Jul 15, 2015
b43d13d
test(guide/expression): we must tell protractor to wait for the alert…
petebacondarwin Jul 28, 2015
b62ddd9
fix(ngAnimate): ensure that only string-based addClass/removeClass va…
matsko Jul 28, 2015
b745289
fix($compile): ignore optional =-bound properties with empty value
caitp Jul 7, 2015
6322ea7
docs($compile): fix typo
patyatka Jul 27, 2015
dfca6f1
docs(guide/expression): replace tt by code
Laisky Jul 26, 2015
1194390
docs($rootScope.Scope): improve clarity describing $watch with no lis…
Strikeskids Jul 24, 2015
e1b9810
fix($compile): don't trigger $observer if initial value is `undefined`
petebacondarwin Jul 29, 2015
bd39cde
docs(guide): Facebook was mispelled as Faceb0ok
stevenw Jul 30, 2015
246c575
refactor($locale): use en-us as generic built-in locale
lgalfaso Jul 29, 2015
7f2d8cc
feat($httpProvider): add 'useLegacyPromiseExtensions' configuration
realityking Jun 14, 2015
d12c48b
docs(ngOptions): close select element
Jul 20, 2015
a1140c9
docs($q): add $q.when and $q.resolve callback arguments
Jul 17, 2015
4a498c3
fix(injector): check that modulesToLoad isArray.
mprobst Jul 7, 2015
430b632
docs(guide/Forms): display scope form / master data in examples
maurya777 Jul 11, 2015
b861bb8
docs(tutorial/7 - Routing): update angular version
vedelaar Jul 21, 2015
c29d5b9
docs(guide/Dependency Injection): fix angular.injector arguments list
adamsea Jul 7, 2015
cc205ac
docs($rootScope.Scope): remove obsolete line, and link to guide
Narretz Aug 3, 2015
3082c50
docs(.Scope): correct link to scope guide
Narretz Aug 3, 2015
c6d6dcc
docs(CONTRIBUTING): correct spelling and grammar
stevemao Aug 4, 2015
1cb30be
style(ngAnimate): add missing semi-colon
ryanhendry Aug 6, 2015
fa0d615
fix(ngSanitize): escape the wide char quote marks in a regex in linky.js
luanshixia Apr 16, 2015
1c8dbc8
style($http): fix typo in useLegacyPromise var
isyun Aug 6, 2015
7780425
refactor(): remove more bits and pieces related to Internet Explorer 8
realityking Jul 22, 2015
b094b8c
refactor(form): remove the use of the private setter function
lgalfaso Aug 2, 2015
3746552
docs(form): explain why the empty-string setter is created
Narretz Aug 7, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ngAnimate): ensure nested class-based animations are spaced out w…
…ith a RAF

Prior to this fix any nested class-based animations (animations that are
triggered with addClass/removeClass or ngClass) would cancel each other
out when nested in DOM structure. This fix ensures that the nested
animations are spaced out with sequenced RAFs so that parent CSS classes
are applied prior to any ancestor animations that are scheduled to run.

Closes #11812
  • Loading branch information
matsko authored and netman92 committed Aug 8, 2015
commit 2427de42d8c7ed05f9620982b473ac7428493180
1 change: 1 addition & 0 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ var angularFiles = {
'angularModules': {
'ngAnimate': [
'src/ngAnimate/shared.js',
'src/ngAnimate/rafScheduler.js',
'src/ngAnimate/animateChildrenDirective.js',
'src/ngAnimate/animateCss.js',
'src/ngAnimate/animateCssDriver.js',
Expand Down
11 changes: 3 additions & 8 deletions src/ngAnimate/animateCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
var gcsStaggerLookup = createLocalCacheLookup();

this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',
'$document', '$sniffer', '$$rAF',
'$document', '$sniffer', '$$rAFScheduler',
function($window, $$jqLite, $$AnimateRunner, $timeout,
$document, $sniffer, $$rAF) {
$document, $sniffer, $$rAFScheduler) {

var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);

Expand Down Expand Up @@ -452,15 +452,10 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
}

var bod = getDomNode($document).body;
var cancelLastRAFRequest;
var rafWaitQueue = [];
function waitUntilQuiet(callback) {
if (cancelLastRAFRequest) {
cancelLastRAFRequest(); //cancels the request
}
rafWaitQueue.push(callback);
cancelLastRAFRequest = $$rAF(function() {
cancelLastRAFRequest = null;
$$rAFScheduler.waitUntilQuiet(function() {
gcsLookup.flush();
gcsStaggerLookup.flush();

Expand Down
8 changes: 6 additions & 2 deletions src/ngAnimate/animateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
return runner;
}

closeParentClassBasedAnimations(parent);
if (isStructural) {
closeParentClassBasedAnimations(parent);
}

// the counter keeps track of cancelled animations
var counter = (existingAnimation.counter || 0) + 1;
Expand Down Expand Up @@ -420,7 +422,9 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
? 'setClass'
: animationDetails.event;

closeParentClassBasedAnimations(parentElement);
if (animationDetails.structural) {
closeParentClassBasedAnimations(parentElement);
}

markElementAnimationState(element, RUNNING_STATE);
var realRunner = $$animation(element, event, animationDetails.options);
Expand Down
86 changes: 68 additions & 18 deletions src/ngAnimate/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
return element.data(RUNNER_STORAGE_KEY);
}

this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner',
function($$jqLite, $rootScope, $injector, $$AnimateRunner) {
this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$rAFScheduler',
function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$rAFScheduler) {

var animationQueue = [];
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);

var totalPendingClassBasedAnimations = 0;
var totalActiveClassBasedAnimations = 0;
var classBasedAnimationsQueue = [];

// TODO(matsko): document the signature in a better way
return function(element, event, options) {
options = prepareAnimationOptions(options);
Expand Down Expand Up @@ -53,12 +57,19 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
options.tempClasses = null;
}

var classBasedIndex;
if (!isStructural) {
classBasedIndex = totalPendingClassBasedAnimations;
totalPendingClassBasedAnimations += 1;
}

animationQueue.push({
// this data is used by the postDigest code and passed into
// the driver step function
element: element,
classes: classes,
event: event,
classBasedIndex: classBasedIndex,
structural: isStructural,
options: options,
beforeStart: beforeStart,
Expand All @@ -73,6 +84,10 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
if (animationQueue.length > 1) return runner;

$rootScope.$$postDigest(function() {
totalActiveClassBasedAnimations = totalPendingClassBasedAnimations;
totalPendingClassBasedAnimations = 0;
classBasedAnimationsQueue.length = 0;

var animations = [];
forEach(animationQueue, function(entry) {
// the element was destroyed early on which removed the runner
Expand All @@ -87,23 +102,58 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
animationQueue.length = 0;

forEach(groupAnimations(animations), function(animationEntry) {
// it's important that we apply the `ng-animate` CSS class and the
// temporary classes before we do any driver invoking since these
// CSS classes may be required for proper CSS detection.
animationEntry.beforeStart();

var operation = invokeFirstDriver(animationEntry);
var triggerAnimationStart = operation && operation.start; /// TODO(matsko): only recognize operation.start()

var closeFn = animationEntry.close;
if (!triggerAnimationStart) {
closeFn();
if (animationEntry.structural) {
triggerAnimationStart();
} else {
var animationRunner = triggerAnimationStart();
animationRunner.done(function(status) {
closeFn(!status);
classBasedAnimationsQueue.push({
node: getDomNode(animationEntry.element),
fn: triggerAnimationStart
});
updateAnimationRunners(animationEntry, animationRunner);

if (animationEntry.classBasedIndex === totalActiveClassBasedAnimations - 1) {
// we need to sort each of the animations in order of parent to child
// relationships. This ensures that the child classes are applied at the
// right time.
classBasedAnimationsQueue = classBasedAnimationsQueue.sort(function(a,b) {
return b.node.contains(a.node);
}).map(function(entry) {
return entry.fn;
});

$$rAFScheduler(classBasedAnimationsQueue);
}
}

function triggerAnimationStart() {
// it's important that we apply the `ng-animate` CSS class and the
// temporary classes before we do any driver invoking since these
// CSS classes may be required for proper CSS detection.
animationEntry.beforeStart();

var startAnimationFn, closeFn = animationEntry.close;

// in the event that the element was removed before the digest runs or
// during the RAF sequencing then we should not trigger the animation.
var targetElement = animationEntry.anchors
? (animationEntry.from.element || animationEntry.to.element)
: animationEntry.element;

if (getRunner(targetElement)) {
var operation = invokeFirstDriver(animationEntry);
if (operation) {
startAnimationFn = operation.start;
}
}

if (!startAnimationFn) {
closeFn();
} else {
var animationRunner = startAnimationFn();
animationRunner.done(function(status) {
closeFn(!status);
});
updateAnimationRunners(animationEntry, animationRunner);
}
}
});
});
Expand Down Expand Up @@ -175,7 +225,7 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
var lookupKey = from.animationID.toString();
if (!anchorGroups[lookupKey]) {
var group = anchorGroups[lookupKey] = {
// TODO(matsko): double-check this code
structural: true,
beforeStart: function() {
fromAnimation.beforeStart();
toAnimation.beforeStart();
Expand Down
2 changes: 2 additions & 0 deletions src/ngAnimate/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* global angularAnimateModule: true,

$$rAFMutexFactory,
$$rAFSchedulerFactory,
$$AnimateChildrenDirective,
$$AnimateRunnerFactory,
$$AnimateQueueProvider,
Expand Down Expand Up @@ -742,6 +743,7 @@ angular.module('ngAnimate', [])
.directive('ngAnimateChildren', $$AnimateChildrenDirective)

.factory('$$rAFMutex', $$rAFMutexFactory)
.factory('$$rAFScheduler', $$rAFSchedulerFactory)

.factory('$$AnimateRunner', $$AnimateRunnerFactory)

Expand Down
59 changes: 59 additions & 0 deletions src/ngAnimate/rafScheduler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use strict';

var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {
var tickQueue = [];
var cancelFn;

function scheduler(tasks) {
// we make a copy since RAFScheduler mutates the state
// of the passed in array variable and this would be difficult
// to track down on the outside code
tickQueue.push([].concat(tasks));
nextTick();
}

/* waitUntilQuiet does two things:
* 1. It will run the FINAL `fn` value only when an uncancelled RAF has passed through
* 2. It will delay the next wave of tasks from running until the quiet `fn` has run.
*
* The motivation here is that animation code can request more time from the scheduler
* before the next wave runs. This allows for certain DOM properties such as classes to
* be resolved in time for the next animation to run.
*/
scheduler.waitUntilQuiet = function(fn) {
if (cancelFn) cancelFn();

cancelFn = $$rAF(function() {
cancelFn = null;
fn();
nextTick();
});
};

return scheduler;

function nextTick() {
if (!tickQueue.length) return;

var updatedQueue = [];
for (var i = 0; i < tickQueue.length; i++) {
var innerQueue = tickQueue[i];
runNextTask(innerQueue);
if (innerQueue.length) {
updatedQueue.push(innerQueue);
}
}
tickQueue = updatedQueue;

if (!cancelFn) {
$$rAF(function() {
if (!cancelFn) nextTick();
});
}
}

function runNextTask(tasks) {
var nextTask = tasks.shift();
nextTask();
}
}];
87 changes: 86 additions & 1 deletion test/ngAnimate/animationSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,90 @@ describe('$$animation', function() {
};
}));

it('should space out multiple ancestorial class-based animations with a RAF in between',
inject(function($rootScope, $$animation, $$rAF) {

var parent = element;
element = jqLite('<div></div>');
parent.append(element);

var child = jqLite('<div></div>');
element.append(child);

$$animation(parent, 'addClass', { addClass: 'blue' });
$$animation(element, 'addClass', { addClass: 'red' });
$$animation(child, 'addClass', { addClass: 'green' });

$rootScope.$digest();

expect(captureLog.length).toBe(1);
expect(capturedAnimation.options.addClass).toBe('blue');

$$rAF.flush();
expect(captureLog.length).toBe(2);
expect(capturedAnimation.options.addClass).toBe('red');

$$rAF.flush();
expect(captureLog.length).toBe(3);
expect(capturedAnimation.options.addClass).toBe('green');
}));

it('should properly cancel out pending animations that are spaced with a RAF request before the digest completes',
inject(function($rootScope, $$animation, $$rAF) {

var parent = element;
element = jqLite('<div></div>');
parent.append(element);

var child = jqLite('<div></div>');
element.append(child);

var r1 = $$animation(parent, 'addClass', { addClass: 'blue' });
var r2 = $$animation(element, 'addClass', { addClass: 'red' });
var r3 = $$animation(child, 'addClass', { addClass: 'green' });

r2.end();

$rootScope.$digest();

expect(captureLog.length).toBe(1);
expect(capturedAnimation.options.addClass).toBe('blue');

$$rAF.flush();

expect(captureLog.length).toBe(2);
expect(capturedAnimation.options.addClass).toBe('green');
}));

it('should properly cancel out pending animations that are spaced with a RAF request after the digest completes',
inject(function($rootScope, $$animation, $$rAF) {

var parent = element;
element = jqLite('<div></div>');
parent.append(element);

var child = jqLite('<div></div>');
element.append(child);

var r1 = $$animation(parent, 'addClass', { addClass: 'blue' });
var r2 = $$animation(element, 'addClass', { addClass: 'red' });
var r3 = $$animation(child, 'addClass', { addClass: 'green' });

$rootScope.$digest();

r2.end();

expect(captureLog.length).toBe(1);
expect(capturedAnimation.options.addClass).toBe('blue');

$$rAF.flush();
expect(captureLog.length).toBe(1);

$$rAF.flush();
expect(captureLog.length).toBe(2);
expect(capturedAnimation.options.addClass).toBe('green');
}));

they('should return a runner that object that contains a $prop() function',
['end', 'cancel', 'then'], function(method) {
inject(function($$animation) {
Expand Down Expand Up @@ -513,7 +597,7 @@ describe('$$animation', function() {
}));

it("should not group animations into an anchored animation if enter/leave events are NOT used",
inject(function($$animation, $rootScope) {
inject(function($$animation, $rootScope, $$rAF) {

fromElement.addClass('shared-class');
fromElement.attr('ng-animate-ref', '1');
Expand All @@ -528,6 +612,7 @@ describe('$$animation', function() {
});

$rootScope.$digest();
$$rAF.flush();
expect(captureLog.length).toBe(2);
}));

Expand Down
Loading