Commit graph

2166 commits

Author SHA1 Message Date
Matias Niemelä
947a44d1ee chore(docs): specify how ngClass deals with natural CSS transitions 2013-11-06 18:11:59 -05:00
Jeff Cross
da344daa40 fix(ngView): only run anchorScroll after animation is done 2013-11-06 00:14:11 -08:00
Jeff Cross
6fb191570e fix(ngMock): throw more descriptive errors for $animate.flushNext() 2013-11-06 00:14:11 -08:00
Pete Bacon Darwin
d378f5500a fix(ngInclude): only run anchorScroll after animation is done
We need to wait until animations have added the content to the document before
trying to `autoscroll` to anchors that may have been inserted.

Fixes #4723
2013-11-06 00:14:11 -08:00
Matias Niemelä
9470080762 fix($animate): only apply the fallback property if any transition animations are detected 2013-11-06 02:01:19 -05:00
Matias Niemelä
aba0fe6830 chore(docs): refactor/improve new CSS transition code in examples 2013-11-05 21:21:18 -08:00
Matias Niemelä
b1d4d580e5 chore(docs): update $animate and ngAnimate docs 2013-11-05 21:21:17 -08:00
Matias Niemelä
9d69a0a7c7 feat($animate): ensure CSS transitions can work with inherited CSS class definitions
BREAKING CHANGE

ngAnimate addClass / removeClass animations are now applied right away. This means
that as soon as the animation starts the class will be added (addClass) or removed
(removeClass) to the element being animated instead of after the -add-active /
-remove-active animations are completed. This allows for animations outside of
ngAnimate to not conflict with $animate.

This commit introduces beforeAddClass and beforeRemoveClass animation event functions and
executes any addClass and removeClass event functions AFTER the class has been added or
removed (this is opposite functionality of how ngAnimate used to work when performing
JS-enabled animations addClass / removeClass animations). If your animation code relies on
any animations being performed prior to the class change then simply use the new
beforeAddClass and beforeRemoveClass animation event functions.

Finally, when animating show and hide animations using CSS transitions or keyframe animations,
ng-hide-remove doesn't require `display:block!important` for ng-hide-add anymore.
2013-11-05 21:15:59 -08:00
Matias Niemelä
b89584db10 fix($animate): avoid hanging animations if the active CSS transition class is missing
Closes #4732
Closes #4490
2013-11-05 21:45:36 -05:00
Matias Niemelä
41a2d5b30f fix($animate): ensure staggering animations understand multiple delay values 2013-11-05 21:44:25 -05:00
Matias Niemelä
e53ff431e1 fix($animate): ensure the active class is not applied if cancelled during reflow
Closes #4699
2013-11-05 21:44:02 -05:00
Matias Niemelä
974b6d4a5b chore($sniffer): make msie variable public
The msie variable is a global variable used within the ng core which contains the
version number for the current Internet Explorer browser that is rendering the
application. Other modules outside of the ng core could make use of this variable
instead of having to rollout duplicate detection code. This code makes it easy to
reuse this simple property within the $sniffer service.
2013-11-05 21:43:31 -05:00
Tim Graham
6dcdb4e306 docs(input): fix typo
Closes #4734
2013-11-04 22:31:51 +00:00
Dmitry Kichenko
8cfaeb0e82 docs($http): note that default $http headers can be overridden
Closes #4750
2013-11-04 22:28:34 +00:00
granteagon
c82058ad57 docs($log): add the word "safely" to clarify
I was reading the doc and had to read the code to be sure it was safe.  Spelling it out seems easier.

Closes #4760
2013-11-04 22:21:49 +00:00
Igor Minar
8f989d652f fix(ngModel): deregister from the form on scope not DOM destruction
Due to animations, DOM might get destroyed much later than scope and so the element $destroy event
might get fired outside of $digest, which causes changes to the validation model go unobserved
until the next digest. By deregistering on scope  event, the deregistration always happens
in $digest and the form validation model changes will be observed.

Closes #4226
Closes #4779
2013-11-04 10:35:51 -08:00
Igor Minar
9483373c33 fix(ngIf): destroy child scope when destroying DOM 2013-11-04 10:35:51 -08:00
Igor Minar
c6923d2df4 style: remove ws 2013-11-04 10:35:51 -08:00
Jordan Klassen
84166029ec docs($parse): Fix typo 2013-11-04 09:59:31 -08:00
Freek Wielstra
8d4e3fdd31 docs($location): update paramValue description for search()
search() supports an array for paramValue, but this is not described in the docs.
2013-11-02 21:40:15 -07:00
Tobias Bosch
9a828738cd fix(ngEventDirectives): parse expression only once during compile phase. 2013-10-31 12:56:49 -07:00
Chirayu Krishnappa
3d6a89e888 feat($parse): secure expressions by hiding "private" properties
BREAKING CHANGE:
This commit introduces the notion of "private" properties (properties
whose names begin and/or end with an underscore) on the scope chain.
These properties will not be available to Angular expressions (i.e. {{
}} interpolation in templates and strings passed to `$parse`)  They are
freely available to JavaScript code (as before).

Motivation
----------
Angular expressions execute in a limited context.  They do not have
direct access to the global scope, Window, Document or the Function
constructor.  However, they have direct access to names/properties on
the scope chain.  It has been a long standing best practice to keep
sensitive APIs outside of the scope chain (in a closure or your
controller.)  That's easier said that done for two reasons: (1)
JavaScript does not have a notion of private properties so if you need
someone on the scope chain for JavaScript use, you also expose it to
Angular expressions, and (2) the new "controller as" syntax that's now
in increased usage exposes the entire controller on the scope chain
greatly increaing the exposed surface.  Though Angular expressions are
written and controlled by the developer, they (1) typically deal with
user input and (2) don't get the kind of test coverage that JavaScript
code would.  This commit provides a way, via a naming convention, to
allow publishing/restricting properties from controllers/scopes to
Angular expressions enabling one to only expose those properties that
are actually needed by the expressions.
2013-10-30 17:01:51 -07:00
Brian Ford
5b620653f6 chore($compile): remove special case for ngIf and ngRepeat 2013-10-30 16:21:02 -07:00
Brian Ford
6578bd0c82 chore: move getBlockElements to Angular.js 2013-10-30 16:21:02 -07:00
Brian Ford
e19067c9bb fix(ngIf): ngIf removes elements dynamically added to it
When using ngIf with ngInclude on the same element, ngIf previously did not remove
elements added by ngInclude. Similarly, when using ngIfStart/End, ngIf will miss
elements added between the start/end markers added after ngIf is linked.

This commit changes the behavior of ngIf to add a comment node at the end of its
elements such that elements between the starting comment and this ending comment
are removed when ngIf's predicate does not hold.
2013-10-30 16:21:02 -07:00
Pete Bacon Darwin
627f9ba091 docs($route): split over-length line 2013-10-30 21:03:10 +00:00
Andrew Jackson
217feda041 docs($route): change example module name
The name of the example module is `ngView`, which might cause needless confusion.
Changed name to `ngViewExample`, which should make it clearer.

Closes #4702
2013-10-30 20:58:10 +00:00
Matias Niemelä
d434eabec3 fix($animate): use direct DOM comparison when checking for $rootElement
Closes #4679
2013-10-28 22:47:47 -07:00
Matias Niemelä
7f0767acab fix($animate): ensure former nodes are fully cleaned up when a follow-up structural animation takes place
Closes #4435
2013-10-28 21:26:35 -07:00
Pete Bacon Darwin
cf54510b2c docs($provide): fix link to factory section 2013-10-28 21:27:28 +00:00
Matias Niemelä
6818542c69 fix($animate): ensure enable/disable animations work when the document node is used
Closes #4669
2013-10-28 14:26:07 -07:00
Matias Niemelä
7484830744 feat(ngAnimate): provide support for staggering animations with CSS 2013-10-28 15:00:47 -06:00
Derek Hammer
6d23591c31 fix(angular-mocks): add inline dependency annotation
Annotation allows the angular-mocks to be minified, which sometimes happens with frameworks that
automatically process files before running tests.
Also, some developers have been using this library in code for their applications.
This is not recommended as the library is only designed to support testing and not production
applications.  If you are likely to want to use the code here in production you would be best
forking and maintaining your own version of the code as we will not guarantee that we won't
break the annotation of the code in the future.

Closes #4448
2013-10-28 19:45:00 +00:00
Igor Minar
18ae985c3a fix($compile): don't instantiate controllers twice for element transclude directives
This is a fix for regression introduced last week by faf5b980.

Closes #4654
2013-10-28 01:11:18 -07:00
Jarrett Harris
c9a1df3ae9 docs($resource): fix typo
Closes #4670
2013-10-27 21:51:53 +00:00
Yuriy Bilogub
0429f6c7f5 docs(form): fix typo
Close #4671
2013-10-27 21:42:23 +00:00
Valentyn Shybanov
dfccdd5b86 docs($location): document $location's events
Closes #1569
Closes #4446
2013-10-26 20:20:42 +01:00
rjferguson21
28ab4b600a docs($q): promises are no longer automatically unwrapped, by default
Although it is still possible to turn this on, the feature is deprecated and it is
best to remove this mention completely here.

Closes #4632
2013-10-26 19:29:27 +01:00
thorn0
9f0d4085e7 docs(Angular.js): angular.equals calls itself recursively on objects
Closes #4622
2013-10-26 18:57:59 +01:00
mgechev
af34a4a2c0 docs(http): add missing brace in the 2nd interceptors example
Closes #4621
2013-10-26 18:53:41 +01:00
David Bennett
31ebeeef7d docs(ngForm): ensure correct attribute name in usage example
Closes #4611
2013-10-26 18:18:53 +01:00
Caio Cunha
0a84739776 docs($rootScope): added $eval locals parameter documentation
Added documentation for `locals` parameter of `$eval` method.
2013-10-25 23:53:15 -04:00
Igor Minar
79223eae50 fix($compile): attribute bindings should not break due to terminal directives
Recently we changed the priority of attribute interpolation directive to -100
to ensure that it executes early in the post linking phase. This causes issues
with when terminal directives are placed on elements with attribute bindings
because the terminal directive will usually have 0 or higher priority which
results in attr interpolation directive not being applied to the element.

To fix this issue I'm switching the priority back to 100 and making moving the
binding setup into the pre-linking function.

This means that:

- terminal directives with priority lower than 100 will not affect the attribute
  binding
- if a directive wants to add or alter bindings it can do so in the pre-linking
  phase, as long as the priority of this directive is more than 100
- all post-linking functions will execute after the attribute binding has been
  set up
- all pre-linking functions with directive priority lower than 100 will execute
  after the attribute bindings have been setup

BREAKING CHANGE: the attribute interpolation (binding) executes as a directive
with priority 100 and the binding is set up in the pre-linking phase. It used
to be that the priority was -100 in rc.2 (100 before rc.2) and that the binding
was setup in the post-linking phase.

Closes #4525
Closes #4528
Closes #4649
2013-10-25 14:19:58 -07:00
BrainCrumbz
9bf9c236cf docs(compile): fix typo in 'Attributes' description
Closes #4589
2013-10-25 22:16:35 +01:00
Balázs Suhajda
924abdae9f docs(ngIf): fix typo
Closes #4512
2013-10-25 22:06:37 +01:00
Sam Dornan
e8a3569be6 docs(ngClass): fix typo
Closes #4471
2013-10-24 23:22:36 +01:00
Wesley Cho
459e85bfea docs(rootScope): add example of using a listener function for $watch
Closes #4451
2013-10-24 23:13:30 +01:00
Pete Bacon Darwin
82dec9b81e style($route): fix line length 2013-10-24 22:36:40 +01:00
Matias Niemelä
76b628bcb3 fix($animate): skip unnecessary addClass/removeClass animations
Skip addClass animations if the element already contains the class that is being
added to element. Also skip removeClass animations if the element does not contain
the class that is being removed.

Closes #4401
Closes #2332
2013-10-24 17:35:57 -04:00
basarat
46d396df72 docs(ngModelController): $parent can help isolate scope directives 2013-10-24 22:26:39 +01:00