Commit graph

1100 commits

Author SHA1 Message Date
jankuca
2a3212a0a3 fix($http): allow empty responses to be cached
Closes #3809
2013-09-02 11:48:14 +02:00
Igor Minar
dbcc44dc80 revert: feat(ngForm): Supports expression in form names
This reverts commit 4407e81c61.

No features or breaking changes in the stable branch please.
2013-08-22 10:22:17 -07:00
Igor Minar
166e0d63d0 revert: fix($compile): correct controller instantiation...
fix($compile): correct controller for async directives

This reverts commit 51d32243fe
as well as commit   9c51d50318

Changing ordering of events in stable branch is not a good idea.
2013-08-21 01:27:58 -07:00
Igor Minar
0d7f19bb62 revert: fix($compile): always instantiate controllers...
fix($compile): always instantiate controllers in parent->child order

This reverts commit 683fd713c4.

It turns out that there is some existing code that relies on the
incorrect timing. Rather than breaking these apps that depend on
stable releases, we are going to keep this changeo only in master
and the apps will need to migrate to the correc timing during the
1.2 upgrade.
2013-08-21 01:21:02 -07:00
Chirayu Krishnappa
51d32243fe fix($compile): correct controller instantiation for async directives
This fixes regression introduced by #3514 (9c51d503) - this commit is being
reverted here and a better fix is included.

The regression caused the controller to be instantiated before the isolate scope
was initialized.

Closes #3493
Closes #3482
Closes #3537
Closes #3540
2013-08-20 18:51:07 -07:00
Andy Gurden
ac69392cd7 fix($timeout): clean deferreds immediately after callback exec/cancel
Make sure $timeout callbacks are forgotten about immediately after
execution or cancellation.

Previously when passing invokeApply=false, the cleanup used $q and so
would be pending until the next $digest was triggered. This does not
make a large functional difference, but can be very visible when
looking at memory consumption of an app or debugging around the
$$asyncQueue - these callbacks can have a big retaining tree.
2013-08-14 16:04:48 -07:00
Vojta Jina
2b90ef1694 test(matchers): update toThrow matcher 2013-08-12 16:23:39 -07:00
Igor Minar
cbe31d8dfd fix($location): default to / for the url base if no base[href]
With the recent refactoring of $location service we changed this behavior
resulting in a regression.

Previously we thought that html5 mode always required base[href]
to be set in order for urls to resolve properly. It turns out that
base[href] is problematic because it makes anchor urls (#foo) to
always resolve to the base url, which is almost always incorrect
and results in all anchors links and other anchor urls (e.g. svg
references) to be broken.

For this reason, we should now start recommending that people just
deploy to root context (/) and not set the base[href] when using
the html5 mode (push/pop history state).

If it's impossible to deploy to the root context then either all
urls in the app must be absolute or base[href] must be set with the
caveat that anchor urls in such app won't work.

Closes #2762
2013-08-12 16:23:38 -07:00
Jeff Cross
64e447354e fix(dump): Prevented window.dump from being overridden by karma-jasmine.
In commit 6820322db562382fac903be35831275948825317 of Karma-Jasmine, the
dependency on angular.dump was removed. This caused two undesirable side
effects in the angular.js project. 1) Tests for presence of mock dump were failing,
and 2) the default window.dump was not outputting valuable angular-aware info. This
simple fix adds window.dump in testabilityPatch, to preprocess dumped input prior
to passing it to the global dump method.
2013-08-12 16:23:38 -07:00
Brenton
da1f7c762d fix(equals): {} and [] should not be considered equivalent
angular.equals was returning inconsistent values for the comparison between
{} and []:

    angular.equals({}, []) // true
    angular.equals([], {}]) // false

Since these object are not of the same type, they should not be considered
equivalent.
2013-08-12 16:23:38 -07:00
Pete Bacon Darwin
d59027c40e fix($q): call reject() even if $exceptionHandler rethrows
Normally $exceptionHandler doesn't throw an exception.  It is normally
used just for logging and so on.  But if an application developer
implemented a version that did throw an exception then $q would never
have called reject() when converting an exception thrown inside a `then`
handler into a rejected promise.
2013-08-12 16:23:37 -07:00
Eric Hagman
01cd34957e fix(jqLite): return array from multi select in val() 2013-08-12 12:00:47 -07:00
Andy Hitchman
5cca077e4a fix(angular.copy): change angular.copy to correcly clone RegExp
angular.copy previously copied RegExp as an empty object. Change detects
RegExp instance and clones into new RegExp. This change is based on a previous
fix to allow Date to be copied.

Closes #3473
Closes #3474
2013-08-09 00:17:34 -07:00
jankuca
9c51d50318 fix($compile): always instantiate controllers before pre-link fns run
Controllers should be always instantiated after compile fn runs, but before
pre-link fn runs. This way, controllers are available to pre-link fns that
request them.

Previously this was broken for async directives (directives with templateUrl).

Closes #3493
Closes #3482
Closes #3514
2013-08-08 22:58:51 -07:00
Matthew Windwer
4407e81c61 feat(ngForm): Supports expression in form names
<form name="ctrl.form"> form controller will accessible
as $scope.ctrl.form instead of $scope['ctrl.form']

BREAKING CHANGE:
If you have form names that will evaluate as an expression:

<form name="ctrl.form">

And if you are accessing the form from your controller:

  Before:

  function($scope) {
    $scope['ctrl.form'] // form controller instance
  }

  After:

  function($scope) {
    $scope.ctrl.form // form controller instance
  }

This makes it possible to access a form from a controller
using the new "controller as" syntax. Supporting the previous
behavior offers no benefit.
2013-08-07 13:59:41 -07:00
neilmcgibbon
ad76e77fce fix(input): fix the email regex to accept TLDs up to 6 characters long
The input field email regex does't not match long domain extensions. This commit extends the email regexp to take a 6 character TLD.

Example 6-character TLDs include .museum and .travel - (e.g. allabout.travel).
2013-08-07 14:18:22 -04:00
Pawel Kozlowski
ac5b9055f6 fix(jqLite): forgive unregistration of a non-registered handler 2013-08-07 19:09:04 +02:00
Igor Minar
9c53d0769e revert: fix(location): fix parameter handling on search()
This reverts commit 90532f5e3c.

The commit contains references to minErr that are not available
in the stable branch.
2013-08-01 09:34:56 -07:00
Misko Hevery
90532f5e3c fix(location): fix parameter handling on search() 2013-07-31 17:10:10 -07:00
Pawel Kozlowski
dc1e55ce1a fix(form): pick the right attribute name for ngForm
Closes #2997
2013-07-24 14:41:54 -07:00
Paul Meskers
408e868237 fix(numberFilter): always convert scientific notation to decimal
Previously, the number filter would format small and large numbers
as scientific notation. It now uses toFixed() to ensure that all
requested digits are shown.
2013-07-24 12:06:19 -07:00
Igor Minar
acb6b75fe9 chore(dump): remove dead code
This code is not being used any more and the test is now failing
due to Karma changes. Karma used to expose window.dump but that
changed recently and that's why our build is now failing.

I'm removing the code and test, but we still need to figure out
how to route window.dump through angular.mock.dump, but that will
have to be a separate commit.
2013-07-22 14:01:38 -07:00
Igor Minar
683fd713c4 fix($compile): always instantiate controllers in parent->child order
Previously it was possible to get into a situation where child controller
was being instantiated before parent which resulted in an error.

Closes #2738
2013-07-22 11:32:50 -07:00
James deBoer
424bd49ede test(utils): Adds a missing test for snake_case 2013-07-16 11:18:11 -07:00
Ben Ripkens
a357649da5 fix(angular.equals): add support for regular expressions
Regular expression objects didn't used to be considered to be equal when using
'angular.equals'. Dirty checking therefore failed to recognize a
property modification.

Closes #2685

Conflicts:

	test/AngularSpec.js
2013-07-13 22:35:17 -07:00
Greg Thornton
332a3c7984 feat(Angular.js): skip JSON.stringify for undefined
Return early in `angular.toJson` if the object to be stringified is `undefined`.
IE8 stringifies `undefined` to `'undefined'` whereas other browsers return
`undefined`. This normalizes behavior and passes currently broken unit tests
in IE8.
2013-07-12 20:49:50 +02:00
Pete Bacon Darwin
fcd761b9d7 fix(sanitize): match URI schemes case-insensitively
According to RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)
schemes such as http or mailto are case-insensitive. So links such as
http://server/ and HTTP://server/ are valid and equivalent.

Closes #3210
2013-07-12 09:32:23 +01:00
Wesley Cho
b0d5f062e3 fix(ngSubmit): expose $event to ngSubmit callback 2013-07-11 17:27:36 -07:00
Mikk Kirstein
3b898664ee fix(ngValue): made ngValue to write value attribute to element 2013-07-11 14:59:38 -07:00
Paulo Scardine
a4ec297925 fix(scope): watches can be safely unregistered inside watch handlers
Closes #2915
2013-07-11 22:07:15 +01:00
Igor Minar
338264b5f6 test(ngPattern): fix disabled test 2013-07-11 11:58:47 -07:00
Igor Minar
19b51caa2c test(ngList): remove disabled test
this test fails and we don't have intentions on making it pass since
we never made a commitment to implement this feature.
2013-07-11 11:12:17 -07:00
Joao Sa
63414b9653 fix(jqLite): prepend array in correct order
Match jQuery behavior when prepending array into empty element
2013-07-03 20:25:28 +01:00
Vojta Jina
2fae296cbc chore: remove jstd leftovers 2013-06-28 16:29:09 -07:00
Pete Bacon Darwin
b9dcb35e9b fix(Angular.js): don't crash on invalid query parameters 2013-06-20 14:32:05 +01:00
Caio Cunha
25d9f5a804 fix($http): ensure case-insens. header overriding
If user send content-type header, both content-type and default
Content-Type headers were sent. Now default header overriding is
case-insensitive.
2013-06-19 22:43:19 +01:00
Michał Gołębiowski
815053e403 fix(jqLite): correctly monkey-patch core jQuery methods
When real jQuery is present, Angular monkey patch it to fire `$destroy` event.

This commit fixes two issues in the jQuery patch:
- passing a selector to the $.fn.remove method (only fire `$destroy` on the matched elements)
- using `$.fn.html` without parameters as a getter (do not fire `$destroy`)
2013-05-23 11:45:57 -07:00
Lucas Galfasó
4d8b0282b4 test(parse): Test for the parsing not invoking twice to get self
New tests to not call twice a function to get self
2013-05-21 14:41:22 -07:00
Chirayu Krishnappa
9145d5ec3e fix($browser): should use first value for a cookie.
With this change, $browser.cookies()["foo"] will behave like
docCookies.getItem("foo") where docCookies is defined at
https://developer.mozilla.org/en-US/docs/DOM/document.cookie

This fixes the issue where, if there's a value for the XSRF-TOKEN cookie
value with the path /, then that value is used for all applications in
the domain even if they set path specific values for XSRF-TOKEN.

Closes #2635
2013-05-11 09:28:14 -07:00
Lucas Galfasó
42ce8f7f55 fix(ngPluralize): handle the empty string as a valid override
Fix the check for overrides so it is able to handle the empty string

Closes #2575
2013-05-10 20:04:59 +01:00
Igor Minar
5d2bb2c1b9 test(sortedHtml): ignore bogus rowspan=1 and colspan=1 in IE 2013-05-09 05:23:39 -07:00
Igor Minar
9039ddbb56 test(sortedHtml): fix comment support in sortedHtml helper 2013-05-09 05:23:39 -07:00
R. Merkert
016e1e675e fix(angular): do not copy $$hashKey in copy/extend functions.
Copying the $$hashKey as part of copy/extend operations makes little
sense since hashkey is used primarily as an object id, especially in
the context of the ngRepeat directive. This change maintains the
existing $$hashKey of an object that is being copied into (likewise for
extend).
It is not uncommon to take an item in a collection, copy it,
and then append it to the collection. By copying the $$hashKey, this
leads to duplicate object errors with the current ngRepeat.

Closes #1875
2013-05-08 13:04:08 +01:00
Illniyar
1240641f76 feat($cookieStore): $cookieStore.get now parses blank string as blank string
closes #1918
2013-05-08 10:07:24 +01:00
Chad Smith
f1a34f0908 fix(select): ensure empty option is not lost in IE9
Fix a check inside render for select elements with ngOptions, which
compares the selected property of an element with it's desired state.
Ensure the placeholder, if available, is explicitly selected if the model
value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which
option to choose. In most browsers, this has the effect of displaying the
first item in the list. In IE9 however, this causes the select to display
nothing.

Closes #2150, #1826
2013-05-07 21:29:44 +01:00
quazzie
ac086ae616 fix($location): back-button should fire $locationChangeStart
Before $locationChangeStart event is not broadcast when pressing the back-button on the browser.

Closes #2109
2013-05-01 14:51:05 +01:00
gockxml
b0233a33a1 fix(jqLite): correct implementation of mouseenter/mouseleave event
Implement mouseenter/mouseleave event referring to
http://www.quirksmode.org/js/events_mouse.html#link8 and jQuery source
code(not dependent on jQuery).
The old implementation is wrong. When moving mouse from a parent element
into a child element, it would trigger mouseleave event, which should not.
And the old test about mouseenter/mouseleave is wrong too. It just
triggers mouseover and mouseout events, cannot describe the process of mouse
moving from one element to another element, which is important for
mouseenter/mouseleave.

Closes #2131, #1811
2013-04-29 18:28:29 +01:00
Oren Avissar
c3235db9ee test(browser/compile): fix calls to Jasmine fail()
The fail() function in Jasmine expects an Error object parameter.
Also, there is no global alias for fail() so it must be accessed using
`this.fail(new Error())`.
2013-04-29 16:57:33 +01:00
Mark Dalgleish
3ebc2c2442 fix(ngModel): use paste/cut events in IE to support context menu
In IE the model is not updated when the input value is modified using the context
menu, e.g. pasting from the clipboard, or cutting all or part of the current value.
To capture these changes, we bind to the proprietary 'paste' and 'cut' events.

Closes #1462
2013-04-17 21:50:07 +01:00
Pete Bacon Darwin
7898490779 fix(ngClass): should remove classes when object is the same but property has changed
If you wire up ngClass directly to an object on the scope, e.g. ng-class="myClasses",
where scope.myClasses = { 'classA': true, 'classB': false },
there was a bug that changing scope.myClasses.classA = false, was not being picked
up and classA was not being removed from the element's CSS classes.

This fix uses angular.equals for the comparison and ensures that oldVal is a copy of
(rather than a reference to) the newVal.
2013-04-16 13:22:37 +01:00