Commit graph

3617 commits

Author SHA1 Message Date
Pete Bacon Darwin
aea76f0d5c fix(animateSpec): run digest to enable animations before tests 2013-11-08 01:03:18 -08:00
Pete Bacon Darwin
ffa9d0a6db fix(ngClassSpec): clear animation enable fn from postDigestQueue 2013-11-08 01:03:17 -08:00
Pete Bacon Darwin
9d00458563 fix(ngScenario): correctly disable animations for end 2 end tests 2013-11-08 01:03:17 -08:00
Igor Minar
98adc9e038 fix($animate): don't force animations to be enabled
The way that enabling of animations was set up, made it impossible to inject a
module into the bootstrap to disable animations for things like end 2 end tests.
Now animations are temporarily blocked by setting the animation state to RUNNING
during bootstrap, which allows the developer to permanently disable at any point
by calling $animate.enabled(false).
2013-11-08 01:03:17 -08:00
Igor Minar
5cfacec499 refactor($animate): speed up animationsDisabled check 2013-11-08 01:03:17 -08:00
Igor Minar
1df3da361d fix(bootstrap-prettify): share $animate and $$postDigestQueue with demo apps
Although demo apps run in an isolated environment, we need to be able to tell them to disable
animations when we are running end-to-end tests.  By sharing the same instance of $animate
between the two environments we can disable animation across the board.

The $animate service uses the $$postDigestQueue to run animations.  The outer $animate
service uses the outer $$postDigestQueue and to queue up these animations.  This means that
when we run a digest inside the embedded scope, the animations are never performed - they
just sit in the outer scope's queue and are only run when a digest is run on the outer scope.
By sharing this queue across the two scopes the animations are performed correctly.
2013-11-08 01:03:17 -08:00
Igor Minar
27e9340b3c feat(jqLite): expose isolateScope() getter similar to scope()
See doc update in the diff for more info.

BREAKING CHANGE: jqLite#scope() does not return the isolate scope on the element
that triggered directive with isolate scope. Use jqLite#isolateScope() instead.
2013-11-07 22:08:22 -08:00
Igor Minar
b5af198f0d fix($compile): don't leak isolate scope state when replaced directive is used multiple times
When an isolate scope directive is also a "replace" directive and at the root of its template
it has other directives, we need to keep track remember to use isolate scope when linking
these.

This commit fixes the leakage of this state when this directive is used again later inside
or outside of the isolate directive template.
2013-11-07 22:08:05 -08:00
Igor Minar
3fe4491a6b fix($compile): correct isolate scope distribution to controllers
Fixes an issue when we didn't share the isolate scope with the controller
of the directive from the isolate directive's template when this directive
was replaced onto the isolate directive element.
2013-11-07 22:08:05 -08:00
Misko Hevery
97c7a4e379 fix($compile): replaced element has isolate scope 2013-11-07 22:08:05 -08:00
Vojta Jina
d0efd5eefc fix($compile): only pass isolate scope to children that belong to the isolate directive
I had to fix one unit test, as it assumed the broken behavior, where application template gets the
isolate scope of other (isolate) directive, rather than the regular scope.

BREAKING CHANGE: Child elements that are defined either in the application template or in some other
directives template do not get the isolate scope. In theory, nobody should rely on this behavior, as
it is very rare - in most cases the isolate directive has a template.
2013-11-07 22:08:04 -08:00
Vojta Jina
909cabd36d fix($compile): make isolate scope truly isolate
Fixes issue with isolate scope leaking all over the place into other directives on the same element.

Isolate scope is now available only to the isolate directive that requested it and its template.

A non-isolate directive should not get the isolate scope of an isolate directive on the same element,
instead they will receive the original scope (which is the parent scope of the newly created isolate scope).

Paired with Tobias.

BREAKING CHANGE: Directives without isolate scope do not get the isolate scope from an isolate directive on the same element. If your code depends on this behavior (non-isolate directive needs to access state from within the isolate scope), change the isolate directive to use scope locals to pass these explicitly.

// before
<input ng-model="$parent.value" ng-isolate>

.directive('ngIsolate', function() {
  return {
    scope: {},
    template: '{{value}}'
  };
});

// after
<input ng-model="value" ng-isolate>

.directive('ngIsolate', function() {
  return {
    scope: {value: '=ngModel'},
    template: '{{value}}
  };
});

Closes #1924
Closes #2500
2013-11-07 22:03:19 -08:00
Tobias Bosch
3662140201 docs(guide/filter): Refactor filter guide docs
This refactors the filter guide docs into a single file.
Also removes out of date references to the fact that Angular used to enhance Arrays while evaluating expressions.
2013-11-07 14:14:57 -08:00
Brad Green
ed8640b964 docs(guide): delete ancient video
We have links to better videos now on the guide/index page.  This one's time has past.
2013-11-06 20:51:39 -08:00
Matias Niemelä
8a5daaed42 chore(docs): add -webkit-transition for ngClass example 2013-11-06 20:29:03 -05:00
Tobias Bosch
fc060dfc08 docs(guide/overview): Refactor overview and mvc docs
Before, there we multiple overview docs:
- guide/overview
- guide/introduction
- guide/dev_guide.mvc
- guide/dev_guide.mvc.understanding_model
- guide/dev_guide.mvc.understanding_view
- guide/concepts

Now we have:
- guide/introduction: High level description of Angular with the key benefits but without code or any concrete concepts
- guide/concepts: explains all important concepts with a simple example and contains deep links to the other parts of the guide.

 All the old information was moved into existing documents or deleted when they were duplicates.
2013-11-06 17:11:44 -08:00
Matias Niemelä
947a44d1ee chore(docs): specify how ngClass deals with natural CSS transitions 2013-11-06 18:11:59 -05:00
Jeff Cross
eb51b024c9 fix(docModuleComponents): implement anchor scroll when content added
When navigating to URLs such as
docs.angularjs.org/api/ng#filter, the browser
was not able to navigate to the named anchor,
"filter," because the anchor did not yet exist
in the DOM.

This fix uses the $anchorScroll service
to automatically scroll to the right place when
the content has been added to the page.

Fixes #4703
2013-11-06 10:24:22 -08:00
Brian Ford
56d0917799 docs(guide/directive): link to directives API from the top of the page 2013-11-06 09:50:56 -08:00
Brian Ford
c1260716de chore(ngdoc): add dynamic anchors to anchor list
Fixes some warnings during docs generation.

Closes #4673
2013-11-06 09:32:09 -08:00
Brian Ford
5614fd283a docs(guide/providers): add providers documentation 2013-11-06 08:47:06 -08: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ä
7d2d2575a2 chore(animateSpec): provide meaningful CSS class names in animation tests 2013-11-05 21:46:07 -05: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
Matias Niemelä
952fea69fb chore(ngAnimate): ensure elapsedTime values are in seconds and millseconds 2013-11-05 21:42:42 -05:00
Pete Bacon Darwin
0fca288224 chore(grunt): add test:docsgen to ci checks 2013-11-05 21:22:04 +00:00
Pete Bacon Darwin
d4493fda2c fix(ngdocs): create mock Doc objects correctly 2013-11-05 21:20:46 +00:00
Pete Bacon Darwin
4c8fa35324 fix(ngdocs): shortDescription() should not error if no description 2013-11-05 21:16:52 +00:00
Michal Bendowski
e196413df6 docs(guide/directive): fix transclusion example
The example about transclusion and scopes worked only because the order of `scope` and `element`
arguments is wrong, which means that the `name' property of the scope is not really being updated.
To really work, the directive has to define its own scope, either a new child scope or, as is more
common with transclusion, an isolated scope.

Closes #4774
2013-11-05 13:38:09 +00:00
G Lormeau
727b232fb2 docs(guide): add SEO4Ajax to the SEO tools list
Closes #4748
2013-11-04 22:34:11 +00: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
joshbowdoin
159a63f538 docs(guide/understanding-controllers): fix typo in example
Broken - $scope.spicy = 'very';
Works - $scope.spice = 'very';

Closes #4752
2013-11-04 22:24:18 +00:00
Jesse Palmer
5b1c972723 docs(overview): improve readability
Inserted a couple of line breaks to increase readability.

Closes #4756
2013-11-04 22:23:02 +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
Brian Ford
a92b419551 chore(docs): fix ordering of docs in the guide 2013-11-04 11:43:41 -08: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
Brian Ford
de2cced192 docs(guide/contribute): remove redundancy and link to CONTRIBUTING.md 2013-11-04 10:35:21 -08:00
Jordan Klassen
84166029ec docs($parse): Fix typo 2013-11-04 09:59:31 -08:00