aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
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-21fix($resource): Always return a resource instance when calling class methods ↵Tobias Bosch
on resources. Previously, calling `MyResource.save(myResourceInstance)`returned a promise, in contrast to the docs for `$resource`. However, calling `MyResource.save({name: 'Tobias"})`already correctly returned a resource instance. Fixes #4545. Closes #5061.
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(ngAnimate): use a fallback CSS property that doesn't break existing stylesMatias Niemelä
The clip property seems to remove the box-shadow property when an absolute positioned animation is ongoing. This fix changes the property to be border-spacing which is also very underused. The border-spacing CSS property is only visible when border-collapse is set to separate. Closes #4902 Closes #5030
2013-11-20refactor($sce): Use $sniffer instead of $document for feature detection.Tobias Bosch
Also adds `$sniffer.msieDocumentMode` property. Closes #4931 Closes #5045
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($animate): ensure the DOM operation isn't run twiceMatias Niemelä
Depending on the animations placed on ngClass, the DOM operation may run twice causing a race condition between addClass and removeClass. Depending on what classes are removed and added via $compile this may cause all CSS classes to be removed accidentally from the element being animated. Closes #4949
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-13feat($parse): revert hiding "private" propertiesVojta Jina
Hiding `_*` properties was a feature primarily for developers using Closure compiler and Google JS style. We didn't realize how many people will be affected by this change. We might introduce this feature in the future, probably under a config option, but it needs more research and so I'm reverting the change for now. This reverts commit 3d6a89e8888b14ae5cb5640464e12b7811853c7e. Closes #4926 Closes #4842 Closes #4865 Closes #4859 Closes #4849 Conflicts: src/ng/parse.js
2013-11-13fix(urlUtils): made removal of windows drive from path saferJeff Cross
Prior to this fix, the urlResolve method would automatically strip the first segment of a path if the segment ends in a colon. This was to correct undesired behavior in the $location service using the file protocol on windows in multiple browsers (see #4680). However, there could be cases where users intentionally have first path segments that end in a colon (although this conflicts with section 3.3 of rfc3986). The solution to this problem is an extra check to make sure the first path segment of the input url does not end with a colon, to make sure we're only removing undesired path segments. Fixes #4939
2013-11-13docs($httpBackendSpec): fix typo in spy nameBen Wiklund
Closes #4830
2013-11-12fix(urlUtils): urlUtils doesn't return right path for file:// on winROUL
Chrome and other browsers on Windows often append the drive name to the pathname, as described in #4680. This would cause the location service to browse to odd URLs, such as /C:/myfile.html, when opening apps using file://. Fixes #4680
2013-11-12fix($compile): correctly handle interpolated style in replace templatesTobias Bosch
A directive with a template with `replace: true` and an interpolated style at the root element should work correctly. Closes #4882.
2013-11-11fix(ngIf): don't create multiple elements when changing from a truthy to ↵Tobias Bosch
another thruthy value. Fixes #4852.
2013-11-11fix($resource): don't use $parse for @dotted.memberChirayu Krishnappa
params and paramDefaults support looking up the parameter value from the data object. The syntax for that is `@nested.property.name`. Currently, $resource uses $parse to do this. This is too liberal (you can use values like `@a=b` or `@a | filter` and have it work - which doesn't really make sense). It also puts up a dependency on $parse which is has restrictions to secure expressions used in templates. The value here, though a string, is specified in Javascript code and shouldn't have those restrictions.
2013-11-08fix(animateSpec): run digest to enable animations before testsPete Bacon Darwin
2013-11-08fix(ngClassSpec): clear animation enable fn from postDigestQueuePete Bacon Darwin
2013-11-07feat(jqLite): expose isolateScope() getter similar to scope()Igor Minar
See doc update in the diff for more info. BREAKING CHANGE: jqLite#scope() does not return the isolate scope on the element that triggered directive with isolate scope. Use jqLite#isolateScope() instead.
2013-11-07fix($compile): don't leak isolate scope state when replaced directive is ↵Igor Minar
used multiple times When an isolate scope directive is also a "replace" directive and at the root of its template it has other directives, we need to keep track remember to use isolate scope when linking these. This commit fixes the leakage of this state when this directive is used again later inside or outside of the isolate directive template.
2013-11-07fix($compile): correct isolate scope distribution to controllersIgor Minar
Fixes an issue when we didn't share the isolate scope with the controller of the directive from the isolate directive's template when this directive was replaced onto the isolate directive element.
2013-11-07fix($compile): replaced element has isolate scopeMisko Hevery
2013-11-07fix($compile): only pass isolate scope to children that belong to the ↵Vojta Jina
isolate directive I had to fix one unit test, as it assumed the broken behavior, where application template gets the isolate scope of other (isolate) directive, rather than the regular scope. BREAKING CHANGE: Child elements that are defined either in the application template or in some other directives template do not get the isolate scope. In theory, nobody should rely on this behavior, as it is very rare - in most cases the isolate directive has a template.
2013-11-07fix($compile): make isolate scope truly isolateVojta Jina
Fixes issue with isolate scope leaking all over the place into other directives on the same element. Isolate scope is now available only to the isolate directive that requested it and its template. A non-isolate directive should not get the isolate scope of an isolate directive on the same element, instead they will receive the original scope (which is the parent scope of the newly created isolate scope). Paired with Tobias. BREAKING CHANGE: Directives without isolate scope do not get the isolate scope from an isolate directive on the same element. If your code depends on this behavior (non-isolate directive needs to access state from within the isolate scope), change the isolate directive to use scope locals to pass these explicitly. // before <input ng-model="$parent.value" ng-isolate> .directive('ngIsolate', function() { return { scope: {}, template: '{{value}}' }; }); // after <input ng-model="value" ng-isolate> .directive('ngIsolate', function() { return { scope: {value: '=ngModel'}, template: '{{value}} }; }); Closes #1924 Closes #2500
2013-11-06fix(ngView): only run anchorScroll after animation is doneJeff Cross
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-06fix($animate): only apply the fallback property if any transition animations ↵Matias Niemelä
are detected
2013-11-05feat($animate): ensure CSS transitions can work with inherited CSS class ↵Matias Niemelä
definitions BREAKING CHANGE ngAnimate addClass / removeClass animations are now applied right away. This means that as soon as the animation starts the class will be added (addClass) or removed (removeClass) to the element being animated instead of after the -add-active / -remove-active animations are completed. This allows for animations outside of ngAnimate to not conflict with $animate. This commit introduces beforeAddClass and beforeRemoveClass animation event functions and executes any addClass and removeClass event functions AFTER the class has been added or removed (this is opposite functionality of how ngAnimate used to work when performing JS-enabled animations addClass / removeClass animations). If your animation code relies on any animations being performed prior to the class change then simply use the new beforeAddClass and beforeRemoveClass animation event functions. Finally, when animating show and hide animations using CSS transitions or keyframe animations, ng-hide-remove doesn't require `display:block!important` for ng-hide-add anymore.
2013-11-05chore(animateSpec): provide meaningful CSS class names in animation testsMatias Niemelä
2013-11-05fix($animate): avoid hanging animations if the active CSS transition class ↵Matias Niemelä
is missing Closes #4732 Closes #4490
2013-11-05fix($animate): ensure staggering animations understand multiple delay valuesMatias Niemelä
2013-11-05fix($animate): ensure the active class is not applied if cancelled during reflowMatias Niemelä
Closes #4699
2013-11-05chore($sniffer): make msie variable publicMatias Niemelä
The msie variable is a global variable used within the ng core which contains the version number for the current Internet Explorer browser that is rendering the application. Other modules outside of the ng core could make use of this variable instead of having to rollout duplicate detection code. This code makes it easy to reuse this simple property within the $sniffer service.
2013-11-05chore(ngAnimate): ensure elapsedTime values are in seconds and millsecondsMatias Niemelä
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-30feat($parse): secure expressions by hiding "private" propertiesChirayu Krishnappa
BREAKING CHANGE: This commit introduces the notion of "private" properties (properties whose names begin and/or end with an underscore) on the scope chain. These properties will not be available to Angular expressions (i.e. {{ }} interpolation in templates and strings passed to `$parse`) They are freely available to JavaScript code (as before). Motivation ---------- Angular expressions execute in a limited context.  They do not have direct access to the global scope, Window, Document or the Function constructor.  However, they have direct access to names/properties on the scope chain.  It has been a long standing best practice to keep sensitive APIs outside of the scope chain (in a closure or your controller.)  That's easier said that done for two reasons: (1) JavaScript does not have a notion of private properties so if you need someone on the scope chain for JavaScript use, you also expose it to Angular expressions, and (2) the new "controller as" syntax that's now in increased usage exposes the entire controller on the scope chain greatly increaing the exposed surface.  Though Angular expressions are written and controlled by the developer, they (1) typically deal with user input and (2) don't get the kind of test coverage that JavaScript code would.  This commit provides a way, via a naming convention, to allow publishing/restricting properties from controllers/scopes to Angular expressions enabling one to only expose those properties that are actually needed by the expressions.
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-28fix($animate): use direct DOM comparison when checking for $rootElementMatias Niemelä
Closes #4679
2013-10-28fix($animate): ensure former nodes are fully cleaned up when a follow-up ↵Matias Niemelä
structural animation takes place Closes #4435
2013-10-28fix($animate): ensure enable/disable animations work when the document node ↵Matias Niemelä
is used Closes #4669
2013-10-28feat(ngAnimate): provide support for staggering animations with CSSMatias Niemelä
2013-10-28fix($compile): don't instantiate controllers twice for element transclude ↵Igor Minar
directives This is a fix for regression introduced last week by faf5b980. Closes #4654
2013-10-28style(compileSpec): reorder and cleanup tests for $compile's transclusion ↵Igor Minar
feature
2013-10-25fix($compile): attribute bindings should not break due to terminal directivesIgor Minar
Recently we changed the priority of attribute interpolation directive to -100 to ensure that it executes early in the post linking phase. This causes issues with when terminal directives are placed on elements with attribute bindings because the terminal directive will usually have 0 or higher priority which results in attr interpolation directive not being applied to the element. To fix this issue I'm switching the priority back to 100 and making moving the binding setup into the pre-linking function. This means that: - terminal directives with priority lower than 100 will not affect the attribute binding - if a directive wants to add or alter bindings it can do so in the pre-linking phase, as long as the priority of this directive is more than 100 - all post-linking functions will execute after the attribute binding has been set up - all pre-linking functions with directive priority lower than 100 will execute after the attribute bindings have been setup BREAKING CHANGE: the attribute interpolation (binding) executes as a directive with priority 100 and the binding is set up in the pre-linking phase. It used to be that the priority was -100 in rc.2 (100 before rc.2) and that the binding was setup in the post-linking phase. Closes #4525 Closes #4528 Closes #4649
2013-10-25style(injectorSpec): fix typo in "it" descriptionArun Israel
Closes #4483
2013-10-24fix($animate): skip unnecessary addClass/removeClass animationsMatias Niemelä
Skip addClass animations if the element already contains the class that is being added to element. Also skip removeClass animations if the element does not contain the class that is being removed. Closes #4401 Closes #2332
2013-10-24fix($compile): instantiate controlers when re-entering compilationIgor Minar
When we re-enter compilation either due to async directive templates or element transclude directive we need to keep track of controllers to instantiate during linking. This piece of info was missing when re-entering compilation and that's what this commit fixes. I also reordered the properties in the previousCompileContext object. Closes #4434 Closes #4616
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-23fix(ngView): ensure the new view element is placed after the old view elementMatias Niemelä
Closes #4362