Commit Graph

4606 Commits

Author SHA1 Message Date
Brian Ford
55fe6d6331 fix(ngClass): handle ngClassOdd/Even affecting the same classes
The basic approach is to introduce a new elt.data() called $classCounts that keeps
track of how many times ngClass, ngClassEven, or ngClassOdd tries to add a given class.
The class is added only when the count goes from 0 to 1, and removed only when the
count hits 0.

To avoid duplicating work, some of the logic for checking which classes
to add/remove move into this directive and the directive calls $animate.

Closes #5271
2014-04-03 11:58:29 -07:00
Andreas Krummsdorf
f4c08fee85 style(loader.js): correct JSDoc tags of the params of the function module(name, requires, configFn)
This will improve the hints for IDE's which support the Google Closure Compiler (e.g. Webstorm)
2014-04-03 09:39:29 -07:00
Pascal Precht
71bc451f95 docs(guide): fix link in "Complementary libraries" section
the link to `angular-translate` is outdated. this commit fixes it.
2014-04-03 09:27:51 -07:00
Igor Minar
7e4e696ec3 fix(Scope): more scope clean up on $destroy to minimize leaks
Due to a known V8 memory leak[1] we need to perform extra cleanup to make it easier
for GC to collect this scope object.

V8 leaks are due to strong references from optimized code (fixed in M34) and inline
caches (fix in works). Inline caches are caches that the virtual machine builds on the
fly to speed up property access for javascript objects. These caches contain strong
references to objects so under certain conditions this can create a leak.

The reason why these leaks are extra bad for Scope instances is that scopes hold on
to ton of stuff, so when a single scope leaks, it makes a ton of other stuff leak.

This change removes references to objects that might be holding other big
objects. This means that even if the destroyed scope leaks, the child scopes
should not leak because we are not explicitly holding onto them.

Additionally in  theory we should also help make the current scope eligible for GC
by changing properties of the current Scope object.

I was able to manually verify that this fixes the problem for the following
example app: http://plnkr.co/edit/FrSw6SCEVODk02Ljo8se

Given the nature of the problem I'm not 100% sure that this will work around
the V8 problem in scenarios common for Angular apps, but I guess it's better
than nothing.

This is a second attempt to enhance the cleanup, the first one failed  and was
reverted because it was too aggressive and caused problems for existing apps.
See: #6897

[1] V8 bug: https://code.google.com/p/v8/issues/detail?id=2073

Closes #6794
Closes #6856
Closes #6968
2014-04-03 00:25:48 -07:00
Stephanie Nacios Staub
6da44a4410 docs(tutorial): update instructions for running tests in step 2
Fixing outdated instructions on how to run the test

Closes #6972
2014-04-03 01:02:37 -04:00
Igor Minar
a81195c6ca chore(rootScopeSpec): fix a typo in spec description 2014-04-02 21:25:36 -07:00
Yiling Lu
102a3201c1 docs(tutorial): remove reference to old webserver script
script/web-server.js is not present anymore. This doc might be referencing a previous version of the
code. Currently the only way to start the server seems to be using "npm start".

Closes #6966
2014-04-03 00:00:30 -04:00
Jonathan Woodard
59244a7776 docs(guide/bootstrap): remove extra call to angular.module()
There was an extra call to angular.module() not being used in 'getter' mode. While this doesn't
break the demo app, it does look kind of weird, so lets toss it.

Closes #6969
2014-04-02 23:57:16 -04:00
Tobias Bosch
293cb1fc5d docs(ngForm): clarify the purpose of ngForm
Related to #6704 and #2513.
2014-04-02 17:23:42 -07:00
Alexander Harding
81395ac298 test($compile): add tests for <option> or <optgroup> tags as root template nodes 2014-04-02 19:43:08 -04:00
Caitlin Potter
ba66c4f3cc refactor(jqLite): IE8-support fixes
ddb8081982 refactors jqLite, and removes support
for IE8. This patch extends this to prevent the CL from breaking IE8, and to
remain suitable for the 1.2.x branch.

Closes #6963
2014-04-02 19:41:28 -04:00
Caitlin Potter
4ea57e7e96 refactor(jqLite): make HTML-parsing constructor more robust
Previously, the jqLite constructor was limited and would be unable to circumvent many of the HTML5
spec's "allowed content" policies for various nodes. This led to complicated and gross hacks around
this in the HTML compiler.

This change refactors these hacks by simplifying them, and placing them in jqLite rather than in
$compile, in order to better support these things, and simplify code.

While the new jqLite constructor is still not even close to as robust as jQuery, it should be more
than suitable enough for the needs of the framework, while adding minimal code.

Closes #6941
Closes #6958
2014-04-02 19:40:56 -04:00
Tero Parviainen
6e420ff28d fix($parse): mark constant unary minus expressions as constant
Previously, constant numbers with a unary minus sign were not treated as constants. This fix corrects
this behaviour, and may provide a small performance boost for certain applications, due to constant
watches being automatically unregistered after their first listener call.

Closes #6932
2014-04-02 10:07:44 -04:00
Julie
5393814756 docs(tutorial): update tutorial steps to discuss protractor
Closes #6940
2014-04-02 08:47:46 -04:00
b9chris
fab59e7515 docs($location): fix link to Developer Guide for "Using $location"
Closes #6946
2014-04-02 08:09:45 -04:00
Igor Minar
553c252d5c revert: fix(Scope): aggressively clean up scope on $destroy to minimize leaks
This reverts commit f552f25171.

The commit is causing regressions.

Closes #6897
2014-04-01 16:43:25 -07:00
Peter Bacon Darwin
e145a8df72 docs(tutorial): update to match changes to phonecat 2014-04-01 18:22:47 +01:00
Peter Bacon Darwin
b49d0cc6e7 docs(css): ensure all type-hints have a background color
If the type of a type-hint was not recognized, say a "Promise", then
the background color was left as white.  Given that the default
foreground color is also white, this meant that such type-hints were
invisible.

Closes #6934
2014-04-01 13:51:15 +01:00
Peter Bacon Darwin
97b171ecb2 chore(grunt): add jscs task to test task
It is too easy to forget to check jscs for things like trailing whitespace
before pushing commits, such as simple doc changes.  This then breaks the
build and is messy.  Adding jscs to the test task gives people a slightly
better chance of catching these before pushing.
2014-04-01 13:51:15 +01:00
Joseph Orbegoso Pea
245de33c00 docs(guide/bootstrap): add note about ngApp and manual bootstrap 2014-03-31 16:58:34 -07:00
Igor Minar
8d4d437e8c fix(Scope): aggressively clean up scope on $destroy to minimize leaks
Due to a known V8 memory leak[1] we need to perform extra cleanup to make it easier
for GC to collect this scope object.

The theory is that the V8 leaks are due to inline caches which are caches
built on the fly to speed up property access for javascript objects.

By cleaning the scope object and removing all properties, we clean up ICs
as well and so no leaks occur.

I was able to manually verify that this fixes the problem for the following
example app: http://plnkr.co/edit/FrSw6SCEVODk02Ljo8se?p=preview

Given the nature of the problem I'm not 100% sure that this will work around
the V8 problem in scenarios common for Angular apps, but I guess it's better
than nothing.

[1] V8 bug: https://code.google.com/p/v8/issues/detail?id=2073

Closes #6794
Closes #6856
2014-03-28 17:23:41 -04:00
mrmrs
7287dbf71d chore(docs): remove px declaration from x,y coordinates in header svg 2014-03-28 17:07:20 -04:00
sgrebnov
da88449f25 fix(doc-gen): Run Gulp on Windows too
Using node_module/.bin/gulp will enable to gulp command to run
both on Windows and Linux. In its current form, the default action of
executing a Javascript file on Windows does not use node.
Requires quotes around the command to correctly resolve path on Windows

Closes #6346
2014-03-28 17:07:13 -04:00
Diego Algorta
eaf1f8546d docs(faq): fix link to Closure Library
The previous link throws a 404.
2014-03-28 17:07:03 -04:00
John K. Paul
20d926cc45 docs(guide/directive): fix broken link
Fix broken internal link in directive documentation.

Closes #6802
2014-03-28 17:06:52 -04:00
Sekib Omazic
9ae9c1c0da docs(error/ng/btstrpd): fix typo in error page
Minimal typo fix

Closes #6803
2014-03-28 17:06:16 -04:00
Matias Niemelä
8a5972461c chore($animate): fix broken IE8 test 2014-03-28 13:27:30 -04:00
Matias Niemelä
35d635cbcb fix($animate): prevent cancellation timestamp from being too far in the future
Closes #6748
2014-03-28 12:26:13 -04:00
David I. Lehn
db2a4c04d6 docs($sce): fix typo.
Closes #6882
2014-03-27 20:28:33 -04:00
tamakisquare
0d62257c5f docs(guide/filter): mention that filters can be used in directives
The doc mentions filters can be used in services and controllers but directives
aren't mentioned. This could lead to confusion for beginners.
2014-03-27 15:37:29 -07:00
Uri Goldshtein
f911b84aef docs(guide): add ngStorage to specific topics 2014-03-27 14:31:07 -07:00
jim lyndon
32c09c1d19 feat($http): add xhr statusText to completeRequest callback
Makes xhr status text accessible is $http success/error callback.
See www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-statustext

Closes #2335
Closes #2665
Closes #6713
2014-03-27 17:09:04 -04:00
ChrisRose
26064375ca docs(filter/orderBy): fixed typo 2014-03-27 13:53:49 -07:00
Alex Sanford
7a294369ab docs(ngResource): clarify behaviour of $promise
Closes #6753
2014-03-27 16:36:37 -04:00
winkler1
fbab287ea2 docs(ngShowHide): fix typo 'hrml' -> 'html'
Typo 'hrml'

Oops!

Closes #6874
2014-03-27 14:39:14 -04:00
Narretz
254dcee93d docs(guide/scope): fix links to $interpolate
Closes #6877
2014-03-27 14:33:49 -04:00
William Bagayoko
69e5c369d7 chore(docs): remove unneeded Bootstrap/jQuery files from distribution 2014-03-27 12:33:02 +00:00
wbyoko
c0ccbb7b6a docs(error/index): add header
Closes #6849
2014-03-26 17:23:19 -07:00
wbyoko
b87713687e docs(misc/index): add header; general links
Closes #6850
2014-03-26 17:23:19 -07:00
wbyoko
950ffb5a84 docs(misc/started): add header
Closes #6851
2014-03-26 17:23:19 -07:00
Narretz
259003056d docs($compile): add note about recursive compilation in templates
Closes #3079
Closes #6869
2014-03-26 16:43:11 -07:00
Tobias Bosch
fedc4194d9 chore(release): simplify scripts so that they can be tested locally
The `git fetch --all` resulted in an error if in the local `.gitconfig`
a remote was configured that does not exist in the bower/code.anguarjs.org
repositories (e.g. "remote "upstream-prs"").
2014-03-26 16:28:26 -07:00
Tobias Bosch
16862705e1 chore(release): remove after CDN script
The homepage (angularjs.org) and the docs now calculate the
current cdn version on every build, so there is no need
for an after-cdn script.
2014-03-26 16:28:19 -07:00
Tobias Bosch
c694c96e4c chore(release): calculate the cdnVersion on every build
The CDN version of angular is now calculated on every build,
by looking at the tags in angular/angular.js, sorting them
by semver and checking against ajax.googleapis.com which
one is available.
2014-03-26 16:28:02 -07:00
Tobias Bosch
5ac8a6e74a chore(release): don't update phonecat and seed during a release
This is no more needed as phonecat and seed are using bower
now to get the angular version.
2014-03-26 16:26:54 -07:00
Matias Niemelä
0e5106ec2c fix($animate): run CSS animations before JS animations to avoid style inheritance
If a JS animation is run before a CSS animation then the JS animation may end up writing style
data to the element. If any transition or animation style data is written then it may end up
being accidentally inherited into the CSS animation hanlder that ngAnimate uses. This may result
in an unexpected outcome due to the tweaks and hacks that the CSS handler places on the element.
If the CSS animation is run before the JS animation then, if there are no transitions on the style
attribute nor within the global CSS on the page then nothing will happen and the JS animation can
work as expected.

Closes #6675
2014-03-26 12:13:50 -04:00
Igor Minar
9091b77fe6 docs(guide/unit-testing): fix link 2014-03-26 03:50:49 -07:00
Alex Miller
849f998be3 docs(guide/migration): clarify some confusing points
Closes #6756
2014-03-26 03:41:21 -07:00
Nikita Tovstoles
8bc77b68b3 docs(guide/unit-testing): recommend pre-compiling templates
quite a few folks struggle with how to test directives with external templates.
karma-ng-html2js-preprocessor provides an easy solution but the issues is not
raised in the docs.
2014-03-25 17:58:32 -07:00
Brian Ford
95bd046881 docs(guide/filter): fix example style
* use -Controller suffix
* use array annotations
2014-03-25 17:37:08 -07:00