7433 Commits

Author SHA1 Message Date
Georgios Kalpakas 197e18d232 chore(protractor): update jasmine-reporters and switch to jasmine2 2016-12-08 14:17:26 +02:00
Peter Bacon Darwin 7d7b03811d chore(Gruntfile): lengthen a+ promise test timeout to prevent flakes 2016-12-07 23:48:02 +02:00
Martin Staffa bcac64b7b5 chore(travis): use Firefox 47
This commit also adds a new capability to the protractor configs that
ensures that all angularjs.org tests run correctly on Firefox. See
https://github.com/SeleniumHQ/selenium/issues/1202
2016-12-07 23:05:50 +02:00
Martin Staffa 8de31388da chore(npm): update protractor to 4.0.0
4.0.0 is the first version with Selenium 2.53.x, and we need that as lower versions have problems
with current Firefox versions.
See https://github.com/SeleniumHQ/selenium/issues/1202 and https://github.com/SeleniumHQ/selenium/issues/2110.

We are currently running tests on FF28.

As part of the update the deprecated webdriver fn getInnerHtml has been replaced with getAttribute('innerHTML')
2016-12-07 23:05:50 +02:00
Georgios Kalpakas 1d2f5e41b7 test(ngMocks): prevent Safari 10+ optimization that breaks test 2016-12-07 21:37:36 +02:00
Peter Bacon Darwin 6b3da2ddfe test($log): fix up to work with Safari 9
On Safari 9.0.2, you are not allowed to write to `sourceUrl` or `line`
on a native Error object.

This commit uses a custom error instead.
2016-12-07 15:20:25 +02:00
Peter Bacon Darwin d556519548 docs(CHANGELOG): add release notes for 1.2.32 and 1.4.14 2016-10-11 22:53:31 +01:00
Peter Bacon Darwin 6a7d715944 test(input-hidden): fix linting issue v1.4.14 2016-10-11 14:11:08 +01:00
Peter Bacon Darwin 35f3a4a0e3 fix($compile): ensure that hidden input values are correct after history.back
Due to the nature of some browser's PageCache/BFCache, returning to an Angular
app sometimes causes `input[hidden]` elements to retain the last value
that was stored before the page was navigated away from previously.

This is particularly problematic if the input has an interpolated value.
E.g. `<input type="hidden" value="{{ 1 + 2 }}">` since when the browser
returns, instead of the original interpolation template, the HTML contains
the previous value `<input type="hidden" value="3">`.

This commit instructs the browser not to attempt to reinstate the previous
value when navigating back in history by setting `autocomplete="off"` on
the hidden input element element.
2016-10-11 13:37:27 +01:00
Peter Bacon Darwin ff74511291 revert:fix(input): ensure that hidden input values are correct after history.back
This reverts commit 693d133456.
There was a regression against angular-material that relied upon the input directive
having `link.pre` property.
2016-10-11 13:36:33 +01:00
Peter Bacon Darwin cb04cfcab0 docs(CHANGELOG): add 1.4.13 release info 2016-10-10 22:53:38 +01:00
Peter Bacon Darwin 693d133456 fix(input): ensure that hidden input values are correct after history.back
Due to the nature of some browser's PageCache/BFCache, returning to an Angular
app sometimes causes `input[hidden]` elements to retain the last value
that was stored before the page was navigated away from previously.

This is particularly problematic if the input has an interpolated value.
E.g. `<input type="hidden" value="{{ 1 + 2 }}">` since when the browser
returns, instead of the original interpolation template, the HTML contains
the previous value `<input type="hidden" value="3">`.

This commit instructs the browser not to attempt to reinstate the previous
value when navigating back in history by setting `autocomplete="off"` on
the hidden input element element.
v1.4.13
2016-10-10 22:02:52 +01:00
Martin Staffa 996c901ff9 docs(changelog, guide/migration): mention rare BC for ngInclude
See https://github.com/angular/angular.js/issues/13555#issuecomment-165118890
for detailed explanation.
v1.4.12
2016-06-07 10:44:56 +02:00
Georgios Kalpakas 6234cda41c docs(tutorial): add deprecation notice to v1.4.x tutorial and point to the correct branch
- Add a deprecation notice on the 'index' page.
- Hide the "Live Demo" buttons (since we don't have a live demo).
- Update the GitHub diff links to point to the `1.4-snapshot` angular-phonecat branch.
- Modify all git commangs to use the appropriate branch and tags (e.g. `1.4-step-*`).

Related to #14416.

Closes #14675
2016-05-31 12:48:16 +03:00
Martin Staffa f8103a82bf docs(changelog): update with changes for 1.4.11 2016-05-27 12:42:41 +02:00
Martin Staffa 0d764b581d fix(ngAnimate): safe-guard against missing document
In tests, the $document service might be mocked out without providing a real
document, which can lead to errors when the animator is attempting to read properties from it.

This commit provides an object {hidden: true}, if the $document service doesn't have 
a document. This will prevent the animation process from trying to run any animations.

This commit also changes the check for document.hidden slightly. It
should be accessed independently of the current animationsEnabled state.
Since animations are only enabled after two digests, it's possible that
some tests never reach the animationsEnabled = true state and therefore
aren't actually checking the document.hidden state, which means that
the previous fix only works if no more than two digests happen in the test.

(#14633)
v1.4.11
2016-05-24 16:44:11 +02:00
Igor Minar 57a37fcc20 fix(ngAnimate): guard $document[0].hidden access in case it was mocked out
Some tests mock out  and now that we always access the hidden property, existing
tests can get broken. This change keeps the existing tests working.
2016-05-17 12:52:01 -07:00
Sander Boom 7f6ba5534f docs(guide/$location): fix typo
Closes #14607
2016-05-14 01:55:18 +03:00
Martin Staffa b24bfae585 Revert: ngAnimate changes for listening on visibilitychange
Reverts d3e123b, bf1acf7 and aa28e48.
Backporting the changes is complicated because we don't destroy the rootScope
after each test in 1.4.x
(#14574)
2016-05-09 12:35:07 -07:00
Martin Staffa d3e123b0a6 test($$isDocumentHidden): really fix jasmine syntax 2016-05-06 17:12:17 +02:00
Martin Staffa bf1acf7b21 test($): fix jasmine syntax 2016-05-06 16:30:30 +02:00
Maksim Ryzhikov fdaf4d5e27 fix(ngAnimate): properly handle empty jqLite collections
Previously `stripCommentsFromElement()` would return an empty Array (instead of a jqLite collection)
which would cause an exception to be thrown: "element.parent not a function".
This commit fixes it, by ensuring that the returned value is always a jqLite collection.

Closes #14558

Closes #14559
2016-05-06 08:14:32 -06:00
FGasper 1c47abc462 docs($location): clarify return value for path method
docs for return of path() inaccurately describe the function’s return when a value is passed in.

Closes #14544
2016-05-06 15:56:24 +02:00
Stephen Barker 5222703444 docs(guide/decorators): add decorator guide
+ explain decorators and how they are implemented in angular
+ explain how different types of services can be selected
+ explain `$delegate` objects and how they differ between services
+ warn of the risks/caveats of `$delegate` modification
+ note the exposure of `decorator` through the module api
+ show an example of decorating a core service
+ show an example of decorating a core directive
+ show an example of decorating a core filter

Closes #12163
Closes #14372
2016-05-06 15:56:15 +02:00
Michael Warner 4b38b44c91 docs(ngRequired): add 'restrict' info
The Angular Docs do not show the restrictions

Closes #14541
2016-05-06 15:56:01 +02:00
Martin Staffa aa28e48e17 perf(ngAnimate): listen for document visibility changes
Accessing the document for the hidden state is costly for
platforms like Electron. Instead, listen for visibilitychange
and store the state.

Closes #14066
2016-05-06 15:54:49 +02:00
Martin Probst f31586db41 fix(ng-bind-html): watch the unwrapped value using $sce.valueOf() (instead of toString())
Custom `$sce` implementations might not provide a `toString()` method on the wrapped object, or it
might be compiled away in non-debug mode. Watching the unwrapped value (retrieved using
`$sce.valueOf()`) fixes the problem.

The performance of this should be equivalent - `toString()` on objects usually touches all fields,
plus we will also avoid the (potentially big) string allocation.

Fixes #14526
Closes #14527
2016-04-28 20:26:03 +03:00
Weijing Jay Lin 8337b9b2d4 docs(identity): add example
Closes #14528
2016-04-28 11:07:30 +03:00
Perry Hooker 85a53ea9cd fix($compile): properly handle setting srcset to undefined
Previously, calling `Attributes#$set('srcset', value)` on an `<img>` element would throw if `value`
were undefined, as it assumed `value` is always a string.
This commit fixes the issue, by skipping the unnecessary string manipulation when `value` is not
defined.

Closes #14470

Closes #14493
2016-04-26 09:20:54 +03:00
andrea 2d87ef8f23 docs(guide/index): fixed formatting with subtitles
The "Books" and "Videos" subtitles had no space between text and the '#' so it didn't render as a
subtitle.

Closes #14514
2016-04-26 08:34:11 +03:00
Tim van Dalen 3df8b637f3 docs($anchorScroll): fix link to HTML5 spec
Closes #14364
2016-04-26 00:31:52 +03:00
Georgios Kalpakas 28d3126fe5 test($templateRequest): fix code for jasmine 1.3 2016-04-25 22:14:41 +03:00
Raphael Jamet ad21f8feaf fix($templateRequest): trust empty templates in $templateCache as well
Implicitly trust empty templates added to `$templateCache` as is the case for all other templates.

Fixes #14479

Closes #14496
2016-04-25 20:22:54 +03:00
Georgios Kalpakas 7f2df141cd docs($interpolate): add known issue about end-symbol in expression
This has been discussed in #8642.

Closes #14494
2016-04-22 15:42:51 +03:00
Georgios Kalpakas 4e735e5363 fix(filters): always call splice() with 2 arguments or more
When calling `.splice()` without a 2nd argument (`deleteCount`), most browsers will splice to the
end of the array. As it turns out, this is the behavior specified in [ES2015][es6]. In [ES5][es5],
the spec seems to imply that nothing should happen.

To avoid inconsistent behavior among browsers implementing different versions of the EcmaScript
standart or when ES5 shims are included (e.g. https://github.com/es-shims/es5-shim/), this commit
ensures that all calls to `.splice()` provide at least two arguments.

[es5]: http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.12
[es6]: http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.splice

Fixes #14467

Closes #14489
2016-04-22 12:42:01 +03:00
cloverharvest a9db6073c9 docs($http): fix a typo (his --> this)
Closes #14430
2016-04-15 01:25:40 +03:00
Martin Staffa e48e27aa2b test(ngAnimate): fix jasmine syntax 2016-04-13 04:00:26 -07:00
Jason Bedard 832b383cbc perf($compile): use createMap() for directive bindings to allow fast forEach
Closes #12529
2016-04-13 12:06:55 +03:00
Martin Staffa c4bff290e5 fix(ngAnimate): fire callbacks when document is hidden
Since commit a3a7afd3aa, animations are not run
when the document is hidden (only their structural or class change effects are executed).
However, some libraries rely on the $animate.on() callbacks to be called even when no actual animation
runs.
This commit restores the behavior for the ngAnimate.$animate functions.
Note that callbacks still won't be called if animations are disabled, because this would be be a potential
breaking change, as some applications might rely on this implementation.

Fixes #14120
2016-04-12 20:42:30 +02:00
Martin Staffa 55b00148dd test(ngAnimate): test calling callbacks for various constellations 2016-04-12 20:42:30 +02:00
Martin Staffa 23550b5e27 fix(ngAnimate): fire callbacks in the correct order for certain skipped animations 2016-04-12 20:42:29 +02:00
Georgii Dolzhykov 97d2a08c5a docs(Module): fix parameter names for .decorator()
Closes #14413
2016-04-12 14:52:48 +03:00
aortyl 7f6efb2822 docs(guide/scope): add comma for readability
Closes #14411
2016-04-11 22:23:03 +03:00
David Rodenas Pico b50867001b fix(ngClass): fix watching of an array expression containing an object
Closes #14405
2016-04-11 12:41:29 +03:00
Gene McCulley 8b9ce885d3 docs(numberFilter): fix the description of the returned value
Closes #14408
2016-04-11 12:28:56 +03:00
Jurko Gospodnetić 56dae6fa1b fix(ngMock): fix collecting stack trace in inject() on IE10+, PhantomJS
Add support for collecting current stack trace information in browsers
(e.g. IE10+, PhantomJS) that do not automatically store the current stack trace
information in a newly created `Error` object's `stack` property, but
only add it there once the `Error` gets thrown.

The original implementation works fine in Firefox & Chrome, but fails on IE10+
and PhantomJS where it, for example, breaks Karma's error reporting in cases
when an exception is thrown in a test like the following:

```
it('the holy crusade', inject(function() {
  var x = {};
  x.holyGrail();
}));
```

In this case, the ngMock `inject()` implementation would incorrectly add the
word `undefined` at the end of the collected error stack trace information,
thus causing the main error description to be reported back to Karma as
`undefined`.

The added test makes sure this functionality:

- works as expected in browsers supporting JavaScript stack trace
  collection, e.g. Chrome, Firefox, IE10+, Opera & PhantomJS
- does not add any bogus stack track information in browsers that do
  not support JavaScript stack trace collection, e.g. IE9

Fixes #13591
Closes #13592

Closes #13593
2016-04-09 20:56:16 +03:00
cscport 611dcbc035 docs(angular.bootstrap): fix capitalization in error message
Closes #14325
2016-03-27 15:45:11 +03:00
Martin Staffa 2c9066e012 test(ngMessages): fix most recent call syntax 2016-03-24 11:10:32 +01:00
Martin Staffa 8ecc9357ef test(ngMessages): fix callThrough syntax 2016-03-24 01:08:28 +01:00
Martin Staffa 71dca7c4c2 fix(ngMessages): don't crash when nested messages are removed
Under specific circumstances, ngMessages would go into an infinite loop and crash the
browser / page:
- At least two ngMessage elements are wrapped inside another element (e.g. ngTransclude)
- The first message is currently visible
- The first message is removed (e.g. when the whole ngMessages element is removed by an ngIf)

When a message is removed, it looks for a previous message - in this specific case it would misidentify
the second message for a previous message, which would then cause the first message to be marked as the
second message's next message, resulting in an infinite loop, and crash.

This fix ensures that when searching for previous messages, ngMessage walks the DOM in a way so
that messages that come after the current message are never identified as previous messages.

This commit also detaches and destroys all child ngMessage elements when the ngMessages element is
destroyed, which should improve performance slightly.

Fixes #14183
Closes #14242
2016-03-24 00:15:35 +01:00