Commit Graph

3023 Commits

Author SHA1 Message Date
Igor Minar
8f10dca300 refactor(jqLite): remove legacy code to support IE8 and older 2014-08-16 15:05:22 -07:00
Igor Minar
566f1015d2 perf(jqLite): optimize event listener registration 2014-08-16 14:31:29 -07:00
Igor Minar
274e9c4ddf perf($compile): optimize publicLinkFn 2014-08-16 14:31:29 -07:00
Igor Minar
e9cd6dc055 perf(jqLite): improve createEventHandler method by switching from forEach to for loop 2014-08-16 14:31:29 -07:00
Igor Minar
960a841051 perf(jqLite): don't use forEach in #off
off() is called on each element removal, so we want to make it as fast as possible
2014-08-16 14:31:28 -07:00
Igor Minar
01b10d7a24 refactor(jqLite): remove code duplication 2014-08-16 14:31:28 -07:00
Igor Minar
2a5dbbdc52 refactor(jqLite): don't recreate mouse event map 2014-08-16 14:31:28 -07:00
Igor Minar
6c4d601ff6 refactor(jqLite): drop Node.contains polyfill
Node.contains is supported on IE5+ and all the other browsers we care about.
2014-08-16 14:31:24 -07:00
Igor Minar
d1536e7c8b perf(jqLite): don't recreate the Node.contains polyfill 2014-08-16 14:22:56 -07:00
Ken Sheedlo
a19131494c style($rootScope): add semicolon for jshint 2014-08-15 17:17:55 -07:00
rodyhaddad
bf0e83732a fix($watchGroup): call listener once when the watchExpressions array is empty 2014-08-15 15:53:51 -07:00
Igor Minar
0554c1aae4 chore(Scope): remove deregisterNotifier feature for $watch
We no longer have a need for this feature that was added to primarily support
$watchGroup (see previous commit).

BREAKING CHANGE: deregisterNotifier callback for $watch is no longer available

This api was available only in the last few 1.3 beta versions and is not
very useful for applications, so we don't expect that anyone will be affected
by this change.
2014-08-15 15:53:51 -07:00
Igor Minar
3f0e642eef perf(Scope): use remove the need for the extra watch in $watchGroup
Instead of using a counter and an extra watch, just schedule the reaction function via .

This gives us the same/similar ordering and coalecsing of updates as counter without the extra
overhead. Also the code is easier to read.

Since interpolation uses watchGroup, this change additionally improves performance of interpolation.

In large table benchmark digest cost went down by 15-20% for interpolation.

Closes #8396
2014-08-15 15:53:51 -07:00
J. Bruni
1a05daf5dc feat(jqLite): implement the detach method
Closes #5461
2014-08-14 21:19:44 +02:00
Michał Gołębiowski
b9389b26ba fix(jQuery): cooperate with other libraries monkey-patching jQuery.cleanData
Some libraries (like jQuery UI) patch jQuery.cleanData as well. This commit
makes Angular work correctly even if such external patching was done after
the Angular one.

Fixes #8471
2014-08-14 21:09:13 +02:00
Jack Wearden
77a1acc7fc feat(ngRoute): add method for changing url params
Add a $route#updateParams method for changing the current route
parameters without having to build a URL and call $location#path.
Useful for apps with a structure involving programmatically moving
between pages on the current route, but with different :param
values.

Properties in the object passed to $route.updateParams() will be
added to the location as queryParams if not contained within the
route's path definition.
2014-08-13 14:11:58 -07:00
rodyhaddad
2d678f1d0a feat($parse): allow for assignments in ternary operator branches
Closes #8512
Closes #8484
CLoses #5434
2014-08-11 16:54:40 +01:00
Peter Bacon Darwin
01d81cdab3 fix(jqLite): allow triggerHandler() to accept custom event
In some scenarios you want to be able to specify properties on the event
that is passed to the event handler. JQuery does this by overloading the
first parameter (`eventName`). If it is an object with a `type` property
then we assume that it must be a custom event.

In this case the custom event must provide the `type` property which is
the name of the event to be triggered.  `triggerHandler` will continue to
provide dummy default functions for `preventDefault()`, `isDefaultPrevented()`
and `stopPropagation()` but you may override these with your own versions
in your custom object if you wish.

In addition the commit provides some performance and memory usage
improvements by only creating objects and doing work that is necessary.

This commit also renames the parameters inline with jQuery.

Closes #8469
2014-08-10 20:26:32 +01:00
Caitlin Potter
5038bf79c6 fix($compile): make '='-bindings NaN-aware
Update parent and child scopes correctly when a '='-binding changes from a NaN value.

TBR by angular-core

Closes #8553
Closes #8554
2014-08-10 03:18:11 -04:00
Jeff Cross
a001a417d5 fix(Scope): add deregisterNotifier to oneTimeLiteralWatch signature
A reverted commit removed deregisterNotifier from the arguments that would be passed
to a watcherFn.
2014-08-08 18:11:38 -04:00
Jeff Cross
b3047b9dc9 revert perf(Scope): remove the need for the extra watch in $watchGroup
This reverts commit 28540c804a.
2014-08-08 18:11:38 -04:00
Jeff Cross
ce378f2582 revert chore(Scope): remove deregisterNotifier feature for $watch
This reverts commit d2f8f25af2.

Closes #8542
2014-08-08 18:11:30 -04:00
Caitlin Potter
8c98d6a637 docs(http): don't use locale-specific uri for MDN link 2014-08-08 15:31:50 -04:00
Joey Yang
acad09efa6 docs($http): fix broken markdown link in withCredentials description
Markdown typo in $http config documentation

Closes #7859
2014-08-08 15:29:26 -04:00
paranoidandroid522
833e60a203 docs(ngHref): close the <a> tags in examples
Self closing <a> tags in the examples given make no sense because they won't
show up in the browser (and I think aren't even allowed according to HTML specs).
I've seen this confuse people over at stackoverflow.com who tried to copy/paste
those examples.

Closes #8488
2014-08-06 15:38:48 +01:00
Jeff H. Parrish
1bb4e87dd6 docs($resource): fix incorrect comment example for userId
Closes #8507
2014-08-06 15:11:54 +01:00
Andrew Silluron
7085b2bcac docs($compile): fix typo 'default' spelling
Change spelling of 'defualt' to 'default'

Closes #8476
2014-08-04 18:47:59 -04:00
Andrew Barbarello
947532828e docs(ngController): global controller fns disabled by default
Update doc to reflect 3f2232b5a1,
which disabled use of global controller constructors (by default).

Closes #8466
2014-08-04 12:01:36 +01:00
Michał Gołębiowski
91d5640a2c docs($compile): event handlers are not copied from the replaced node 2014-08-04 12:42:52 +02:00
PatrickJS
fc73256464 docs(form.js): fix ngdoc tags for $setSubmitted
See 108a69be17

Closes #8464
2014-08-04 11:37:16 +01:00
Jeff Cross
23bc92b17d perf($q): move Deferred and Promise methods to prototypes
NOTE: Deferred doesn't get all the advantages of moving methods to the prototype,
since the constructor binds instance methods to "this" to support unbounded execution.

Closes #8300
2014-08-03 22:53:09 -07:00
Joseph Spencer
48b34ddb79 docs($resource): clarify the meaning of @ in paramDefaults
Closes #8457
2014-08-03 17:14:53 +01:00
Shahar Talmi
477626d846 feat(ngMock): allow override of when/expect definitions
Closes #5766
Closes #8352
2014-08-03 17:08:48 +01:00
Peter Bacon Darwin
25a476ea09 fix(select): ensure that at least one option has the selected attribute set
Using `prop` to set selected is correct programmatically but accessibility
guidelines suggest that at least on item should have the `selected` attribute
set.

Closes #8366
Closes #8429
2014-08-03 16:35:41 +01:00
Arturo Guzman
dd2a803f4f perf(input): prevent additional $digest when input is already touched
@kevinjamesus86 noticed that the input control would trigger a $digest
cycle every time it was blurred, adcc5a00bf (commitcomment-7129512).

After the control is in a $touched state, other $digest cycles are
unnecesary.

Closes #8450
2014-08-02 16:49:38 +01:00
rodyhaddad
c024f28217 fix($parse): one-time binding for literal expressions works as expected
Meaning the watcher is only removed when all the properties of the object, or
all the elements of the array, are defined.

Closes #8209
2014-08-01 18:03:16 -07:00
Nicolás Andrés Gallinal
108a69be17 feat(form): Add new $submitted state to forms
The $submitted state changes
- to true when the form is submitted
- to false when $setPristine is called on the form

A .ng-submitted class is added to the form when $submitted=true

Closes #8056
2014-08-01 16:54:07 -07:00
cexbrayat
e98258184a docs($compile): fix title level for multiElement
Closes #8444
2014-08-01 10:13:21 -04:00
Peter Bacon Darwin
0107bfcab6 docs(ngSubmit): add link to form docs to discourage double submission
Closes #6017
2014-07-31 21:26:43 +01:00
Michał Gołębiowski
9e7cb3c375 feat(jQuery): upgrade to jQuery to 2.1.1
The data jQuery method was re-implemented in 2.0 in a secure way. This made
current hacky Angular solution to move data between elements via changing the
value of the internal node[jQuery.expando] stop working. Instead, just copy the
data from the first element to the other one.

Testing cache leaks on jQuery 2.x is not possible in the same way as it's done
in jqLite or in jQuery 1.x as there is no publicly exposed data storage. One
way to test it would be to intercept all places where a jQuery object is created
to save a reference to the underlaying node but there is no single place in the
jQuery code through which all element creation passes (there are various
shortcuts for performance reasons). Instead we rely on jqLite.cache testing
to find potential data leaks.

BREAKING CHANGE: Angular no longer supports jQuery versions below 2.1.1.
2014-07-31 22:20:31 +02:00
k-funk
1571950fe3 docs($http): add link to $http.path()
Closes #8424
2014-07-31 13:43:19 +01:00
Danielle
9836a2d696 docs(ngMockE2E): remove repeated word
Closes #8411
2014-07-31 13:40:33 +01:00
winsontam
97f230a983 fix($location) don't rewrite location when clicking on "javascript:" or "mailto:" link
Previously, absent a specified target attribute, when clicking on an anchor tag with an href beginning
with either "javascript:" or "mailto:", the framework would rewrite the URL, when it ought not to.

With this change, the browser is prevented from rewriting if the URL begins with a case-insensitive match
for "javascript:" or "mailto:", optionally preceeded by whitespace.

Closes #8407
Closes #8425
Closes #8426
2014-07-31 07:30:52 -04:00
Peter Bacon Darwin
9a2f8e1778 refact(select): don't recreate selectedSet on every digest loop
In the case of a "multiple" select, the model value is an array, changes
to which don't get picked up by NgModelController as it only looks for
object identity change.

We were rebuilding the `selectedSet` (a hash map of selected items) from
the modelValue on every turn of the digest. This is not needed as we can
simply use `$watchCollection` directly on the `$modelValue` instead.
2014-07-31 07:14:04 +01:00
Igor Minar
d2f8f25af2 chore(Scope): remove deregisterNotifier feature for $watch
We no longer have a need for this feature that was added to primarily support
$watchGroup (see previous commit).

BREAKING CHANGE: deregisterNotifier callback for $watch is no longer available

This api was available only in the last few 1.3 beta versions and is not
very useful for applications, so we don't expect that anyone will be affected
by this change.
2014-07-30 17:21:28 -07:00
Igor Minar
28540c804a perf(Scope): remove the need for the extra watch in $watchGroup
Instead of using a counter and an extra watch, just schedule the reaction function via $evalAsync.

This gives us the same/similar ordering and coalecsing of updates as counter without the extra
overhead. Also the code is easier to read.

Since interpolation uses watchGroup, this change additionally improves performance of interpolation.

In large table benchmark digest cost went down by 15-20% for interpolation.

Closes #8396
2014-07-30 17:20:58 -07:00
Dylan
e329243df1 docs(input): fix small grammatical error
Closes #8422
2014-07-30 18:59:55 -04:00
Peter Bacon Darwin
cdc7db3f35 fix(select): do not update selected property of an option element on digest with no change event
The `render()` method was being invoked on every turn of the digest cycle,
which was inadvertently updating the DOM even when a `change` event had
not been triggered.

This change only calls the `render()` method when `ctrl.$render()` is called,
as part of the NgModelController` lifecycle and when the `modelValue` has
significantly changed.

Closes #8221
Closes #7715
2014-07-30 23:13:23 +01:00
Erin Altenhof-Long
c306d251f4 revert(select): avoid checking option element selected properties in render
This reverts commit dc149de936. That commit fixes a bug caused by
Firefox updating `select.value` on hover. However, it
causes other bugs with select including the issue described in #7715. This issue details how
selects with a blank disabled option skip to the second option. We filed a bug
with Firefox for the problematic behavior the reverted commit addresses
https://bugzilla.mozilla.org/show_bug.cgi?id=1039047, and alternate Angular fixes are being
investigated.

Closes #7715 #7855
2014-07-30 23:08:26 +01:00
rodyhaddad
a00c9bca40 fix(jqLite): fix regression where mutating the dom tree on a event breaks jqLite.remove
Closes #8359
2014-07-30 11:13:36 -07:00