aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive
AgeCommit message (Collapse)Author
2014-02-14fix($animate): ensure $animate doesn't break natural CSS transitionsMatias Niemelä
BREAKING CHANGE: ngClass and {{ class }} will now call the `setClass` animation callback instead of addClass / removeClass when both a addClass/removeClass operation is being executed on the element during the animation. Please include the setClass animation callback as well as addClass and removeClass within your JS animations to work with ngClass and {{ class }} directives. Closes #6019
2014-02-12fix(input): setViewValue on compositionendCaitlin Potter
Because of a4e6d962, model is not updated on input/change between the compositionstart and compositionend events. Unfortunately, the compositionend event does not always happen prior to an input/change event. This changeset calls the listener function to update the model after a compositionend event is received. Closes #6058 Closes #5433
2014-02-06fix(mocks): rename mock.animate to ngAnimateMock and ensure it contains all ↵Matias Niemelä
test helper code for ngAnimate Closes #5822 Closes #5917
2014-02-06fix(mocks): remove usage of $animate.flushNext in favour of queingMatias Niemelä
The flushNext method of testing is difficult and highly coupled with the behavior of ngAnimate's $animate workflow. It is much better instead to just queue all $animate animation calls into a queue collection which is available on the $animate service when mock.animate is included as a module within test code.
2014-01-22fix(a): don't preventDefault on click when SVGAElement has an xlink:href ↵Caitlin Potter
attribute Before this change, an SVGAElement with an xlink:href attribute and no href or name attribute which was compiled by the angular HTML compiler would never be clickable, due to the htmlAnchorDirective calling event.preventDefault() due to the missing href attribute. This change corrects this behaviour by also testing the xlink:href attribute if the element in question is determined to be an SVG anchor tag (with the href property having type SVGAnimatedString) Closes #5896 Closes #5897
2014-01-21fix(input): use Chromium's email validation regexpCaitlin Potter
This change uses the regexp from Chromium/Blink to validate emails, and corrects an error in the validation engine, which previously considered an invalid email to be valid. Additionally, the regexp was invalidating emails with capital letters, however this is not the behaviour recomended in the spec, or implemented in Chromium. Closes #5899 Closes #5924
2014-01-10feat(select): allow multiline ng-optionsAjay Roopakalu
This patch allows the ng-options value of a <select> element to span multiple lines, which would previously throw an error when used with filters. Closes #5602
2014-01-06chore(inputSpec): fixed typoBen Wiklund
2014-01-02fix(ngShow/ngHide, ngIf): functions with zero args should be truthyBrian Ford
Previously, expressions that were a function with one or more arguments evaluated to true, but functions with zero arguments evaluated to false. This behavior seems both unintentional and undesirable. This patch makes a function truthy regardless of its number of arguments. Closes #5414
2014-01-02fix(ngRepeat): allow for more flexible coding style in ngRepeat expressionGias Kay Lee
With this change it's possible to split the ng-repeat expression into multiple lines at any point in the expression where white-space is expected. Closes #5537 Closes #5598
2013-12-30fix(input): prevent double $digest when using jQuery trigger.Michał Gołębiowski
If an event was performed natively, jQuery sets the isTrigger property. When triggering event manually, the field is not present. Manually triggered events are performed synchronously which causes the "$digest already in progress" error. Closes #5293
2013-12-18fix(input): do not hold input for composition on androidChia-liang Kao
Workaround for chrome for android until #2129 is ready. Closes #5308, #5323
2013-12-17fix(select): invalidate when 'multiple`, `required` and model is `[]`Caitlin Potter
When `multiple` attribute is set on a `<select>` control and the model value is an empty array, we should invalidate the control. Previously, this directive was using incorrect logic for determining if the model was empty. Closes #5337
2013-12-16fix(ngRepeat): allow multiline expressionsRhys Brett-bowen
allow and pass through new line characters when checking passed in expression Closes #5000
2013-12-13perf(jqLite): implement and use the `empty` method in place of `html(‘’)`Michał Gołębiowski
jQuery's elem.html('') is way slower than elem.empty(). As clearing element contents happens quite often in certain scenarios, switching to using .empty() provides a significant performance boost when using Angular with jQuery. Closes #4457
2013-12-13perf(a): do not link when href or name exists in templateKarl Seamon
Change the a directive to link and hookup a click event only when there is no href or name in the template element. In a large Google app, this results in about 800 fewer registrations, saving a small but measurable amount of time and memory. Closes #5362
2013-12-12fix(ngInclude): Add template to DOM before linking other directivesTobias Bosch
The template needs to be added to the DOM before other directives at the same element as `ngInclude` are linked. Fixes #5247.
2013-12-05fix($compile): update cloned elements if the template arrives after the cloningTobias Bosch
If an element has a directive whose content is loaded using `templateUrl`, and the element is cloned using a linking function before the template arrives, the clone needs to be updated as well. This also updates `ngIf` and `ngRepeat` to keep the connection to the clone of a tranclude function, so that they know about the changes a directive with `templateUrl` does to the element in the future. Fixes to #4930.
2013-12-04fix(ngInit): evaluate ngInit before ngIncludeCaitlin Potter
The priority of ngInit is adjusted to occur before ngInclude, and after ngController. This enables ngInit to initiallize values in a controller's scope, and also to initiallize values before ngInclude executes. Closes #5167 Closes #5208
2013-12-04fix(input): ensure ngModelWatch() triggers second digest pass when appropriateDaniel Tabuenca
Due to an earlier change, ngModelWatch() no longer returns a value to the caller. This means the digest loop has no way to tell if the watch actually modified anything and so can not schedule another pass. This means any watches that watch form or model controller changes (e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch() will not be able to see any changes made therin. This commit fixes this behavior by returning the latest evaluated ng-model value. Closes #5258 Closes #5282
2013-11-25fix(ngAnimate): ensure animations are disabled upon bootstrap for structrual ↵Matias Niemelä
animations Closes #5130
2013-11-22fix(input): Support form auto complete on modern browserTobias Bosch
Although modern browser support the "input" event, they still only fire the "change" event when they auto complete form elements other than the currently selected one. Related to #1460
2013-11-21fix(ngInclude): Don't throw when the ngInclude element contains content with ↵Tobias Bosch
directives. Related to #5069
2013-11-21fix($compile): ensure CSS classes are added and removed only when necessaryMatias Niemelä
When $compile interpolates a CSS class attribute expression it will do so by comparing the CSS class value already present on the element. This may lead to unexpected results when dealing with ngClass values being added and removed therefore it is best that both compile and ngClass delegate addClass/removeClass operations to the same block of code.
2013-11-21fix(ngController): fix issue with ngInclude on the same elementAndrew Silluron-Gonzalez
This changes the priority of ngController to 500 so that it takes precedence over ngInclude. Closes #4431, #4521
2013-11-21feat(input): hold listener during text compositionChia-liang Kao
When composing text in CJKV, intermediate buffer for unfinished text should not be updating the bound scope variables. Closes #4684
2013-11-20fix(ngClass): ensure that ngClass only adds/removes the changed classesMatias Niemelä
ngClass works by removing all the former classes and then adding all the new classes to the element during each watch change operation. This may cause transition animations to never render. The ngClass directive will now only add and remove the classes that change during each watch operation. Closes #4960 Closes #4944
2013-11-20fix(ngInclude): allow ngInclude to load scripts when jQuery is includedBrian Ford
In 1.2, the behavior of ngInclude was modified to use DOM APIs rather than jqLite. This means that even when jQuery was loaded, ngInclude was not calling into it, and thus scripts were not eval'd as they had been before. Although the use of ngInclude to eval scripts as a lazy-loading strategy was never an intentional feature, this patch restores the ability to do so. Closes #3756
2013-11-14fix($compile): accessing controllers of transcluded directives from childrenTobias Bosch
Additional API (backwards compatible) - Injects `$transclude` (see directive controllers) as 5th argument to directive link functions. - `$transclude` takes an optional scope as first parameter that overrides the bound scope. Deprecations: - `transclude` parameter of directive compile functions (use the new parameter for link functions instead). Refactorings: - Don't use comment node to temporarily store controllers - `ngIf`, `ngRepeat`, ... now all use `$transclude` Closes #4935.
2013-11-11fix(ngIf): don't create multiple elements when changing from a truthy to ↵Tobias Bosch
another thruthy value. Fixes #4852.
2013-11-08fix(ngClassSpec): clear animation enable fn from postDigestQueuePete Bacon Darwin
2013-11-06fix(ngInclude): only run anchorScroll after animation is donePete Bacon Darwin
We need to wait until animations have added the content to the document before trying to `autoscroll` to anchors that may have been inserted. Fixes #4723
2013-11-04fix(ngModel): deregister from the form on scope not DOM destructionIgor Minar
Due to animations, DOM might get destroyed much later than scope and so the element $destroy event might get fired outside of $digest, which causes changes to the validation model go unobserved until the next digest. By deregistering on scope event, the deregistration always happens in $digest and the form validation model changes will be observed. Closes #4226 Closes #4779
2013-11-04fix(ngIf): destroy child scope when destroying DOMIgor Minar
2013-10-30fix(ngIf): ngIf removes elements dynamically added to itBrian Ford
When using ngIf with ngInclude on the same element, ngIf previously did not remove elements added by ngInclude. Similarly, when using ngIfStart/End, ngIf will miss elements added between the start/end markers added after ngIf is linked. This commit changes the behavior of ngIf to add a comment node at the end of its elements such that elements between the starting comment and this ending comment are removed when ngIf's predicate does not hold.
2013-10-24fix(input): keep track of min/max attars on-the-flyDmitry Shirokov
Now input[type=button] keeps track of both min and max attrs even if they change over time.
2013-10-18fix(csp): fix csp auto-detection and stylesheet injectionIgor Minar
When we refactored , we broke the csp mode because the previous implementation relied on the fact that it was ok to lazy initialize the .csp property, this is not the case any more. Besides, we need to know about csp mode during bootstrap and avoid injecting the stylesheet when csp is active, so I refactored the code to fix both issues. PR #4411 will follow up on this commit and add more improvements. Closes #917 Closes #2963 Closes #4394 Closes #4444 BREAKING CHANGE: triggering ngCsp directive via `ng:csp` attribute is not supported any more. Please use data-ng-csp instead.
2013-10-11fix($compile): abort compilation when duplicate element transclusionIgor Minar
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See #4357. Closes #3893 Closes #4217 Closes #3307
2013-10-09feat(ngRepeat): use block separator commentsjankuca
Issue: multi-elements ng-repeat (ng-repeat-start, ng-repeat-end) can contain elements with a trancluding directive. This directive changes content of the row (template) and ng-repeat does not work correctly (when removing/moving rows), because ng-repeat works with the original template (elements). This changes ng-repeat behavior to traverse the DOM to find current elements everytime we are moving/removing rows (if the template has multiple elements). Closes #3104
2013-10-07fix(input): `false` is no longer an empty value by defaultPete Bacon Darwin
`checkboxInputType` and `ngList` directives need to have special logic for whether they are empty or not. Previously this had been hard coded into their own directives or the `ngRequired` directive. This made it difficult to handle these special cases. This change factors out the question of whether an input is empty into a method `$isEmpty` on the `ngModelController`. The `ngRequired` directive now uses this method when testing for validity and directives, such as `checkbox` or `ngList` can override it to apply logic specific to their needs. Closes #3490, #3658, #2594
2013-10-07fix(*): protect calls to hasOwnProperty in public APIPeter Bacon Darwin
Objects received from outside AngularJS may have had their `hasOwnProperty` method overridden with something else. In cases where we can do this without incurring a performance penalty we call directly on Object.prototype.hasOwnProperty to ensure that we use the correct method. Also, we have some internal hash objects, where the keys for the map are provided from outside AngularJS. In such cases we either prevent `hasOwnProperty` from being used as a key or provide some other way of preventing our objects from having their `hasOwnProperty` overridden. BREAKING CHANGE: Inputs with name equal to "hasOwnProperty" are not allowed inside form or ngForm directives. Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added to the scope. Now a badname exception is thrown. Using "hasOwnProperty" for an input name would be very unusual and bad practice. Either do not include such an input in a `form` or `ngForm` directive or change the name of the input. Closes #3331
2013-09-25fix(ngRepeat): correctly track elements even when the collection is ↵jankuca
initially undefined Previously if the collection model was set to undefined on the first digest, the repeater would get confused and not use the correct tracking function for associating model with dom elements in the repeater. Closes #4145 Closes #3964
2013-09-20test(ng-non-bindable): test sibling bindingsChirayu Krishnappa
Ref: https://github.com/angular/angular.dart/blob/master/test/directives/ng_non_bindable_spec.dart
2013-09-20fix(ng-bind-html): watch string value instead of wrapperChirayu Krishnappa
Ref: https://github.com/angular/angular.js/pull/4045 I have this sinking feeling that support this use case sort of encourages binding to function that blindly trust some html. For now, I'm fixing the issue while I think about the use cases some more. In the case of a function that performs any non-trivial work before wrapping the value (e.g. the showdown filter in issue #3980, or the binding to a simply wrapper function in issue #3932 if it did anything meaty), this fix makes it "work" - but performance is going to suck - you should bind to some other thing on scope that watches the actual source and adjusts itself when that changes (e.g. the showdown filter.) For the case of the wrapper in #3932, if one isn't performing sanitization or some such thing - then you the developer has insight into why that value is safe in that particular context - and it should be available simply by name and not as a result of a function taking any arbitrary input to make auditing of security a little saner. Closes #3932, #3980
2013-09-20fix(ngInclude): don't break attribute bindings on ngInclude-ed elementBrian Ford
BREAKING CHANGE: ngInclude's priority is now set to 1000 It's quite rare for anyone to depend on explicity directive priority, but if a custom directive that needs to run before ngInclude exists, it should have its priority checked and adjusted if needed. Closes #3793
2013-09-17fix(test): fixed toThrow usageChirayu Krishnappa
2013-09-13fix(ngOptions): ignore object properties which start with $Gowtam Lal
2013-09-03fix(ngAnimate): ensure that ngClass is always compiled before enter, leave ↵Matias Niemelä
and move animations Closes #3727 Closes #3603
2013-09-03fix(ngAnimate): cut down on extra $timeout callsMatias Niemelä
2013-08-19revert(ngInclude): remove ngInclude manual transclusion systemMatias Niemelä