Tag: v1.4.11
-
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)
-
fix(ngAnimate): guard $document[0].hidden access in case it was mocke…
…d 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.
-
-
-
-
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
-
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
-
perf(ngAnimate): listen for document visibility changes
Narretz committedApr 26, 2016 Accessing the document for the hidden state is costly for platforms like Electron. Instead, listen for visibilitychange and store the state. Closes #14066
-
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
-
Closes #14528
-
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
-
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
-
fix(ngAnimate): fire callbacks when document is hidden
Since commit a3a7afd, 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
-
test(ngAnimate): test calling callbacks for various constellations
Narretz committedMar 14, 2016 -
fix(ngAnimate): fire callbacks in the correct order for certain skipp…
Narretz committedMar 14, 2016 …ed animations
-
fix(ngMock): fix collecting stack trace in `inject()` on IE10+, Phant…
…omJS 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
-
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