aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
AgeCommit message (Collapse)Author
2013-12-18fix(forEach): allow looping over result of querySelectorAll in IE8Tobias Bosch
In IE8 the result object of calling `node.querySelectorAll` does not have a `hasOwnPropery` function. However, it should be usable with `forEach`. Related to #5400.
2013-12-17perf: use faster check for $$ prefixKarl Seamon
Use two calls to charAt instead of substr to detect a $$prefix in the shallowCopy functions. This makes shallowCopy 25-50% faster (depending on which browser is used). http://jsperf.com/angular-shallow-copy Closes #5457
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: use call and === instead of apply and == in type check functionsKarl Seamon
Updates isDate et al to use call instead of apply and === instead of ==. The change to call brings minor performance improvement and === is just better practice than ==. http://jsperf.com/call-vs-apply-tostring Closes #5295
2013-12-06revert: chore(Angular.js): Use call and === instead of apply and == in type ↵Matias Niemelä
check functions
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-05fix(isElement): return boolean value rather than `truthy` value.Caitlin Potter
angular.isElement currently returns a truthy object/function, or false. This patch aims to correct this behaviour by casting the result of the isElement expression to a boolean value via double-negation. Closes #4519 Closes #4534
2013-12-05chore(Angular.js): Use call and === instead of apply and == in type check ↵Karl Seamon
functions Updates isDate et al to use call instead of apply and === instead of ==. The change to call brings minor performance improvement and === is just better practice than ==. http://jsperf.com/call-vs-apply-tostring Closes #5295
2013-12-03style(Angular.js): fix typo in commentIgor Minar
2013-11-26refactor(angular.js): improve trim performancesunnylost
According to Flagrant Badassery's blog http://blog.stevenlevithan.com/archives/faster-trim-javascript and this comparison http://jsperf.com/trim-function, this trim method is faster. Closes #4406
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-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-18docs(ngApp): improve description and examplePete Bacon Darwin
2013-11-08fix($animate): don't force animations to be enabledIgor Minar
The way that enabling of animations was set up, made it impossible to inject a module into the bootstrap to disable animations for things like end 2 end tests. Now animations are temporarily blocked by setting the animation state to RUNNING during bootstrap, which allows the developer to permanently disable at any point by calling $animate.enabled(false).
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-07docs(guide/filter): Refactor filter guide docsTobias Bosch
This refactors the filter guide docs into a single file. Also removes out of date references to the fact that Angular used to enhance Arrays while evaluating expressions.
2013-10-30chore: move getBlockElements to Angular.jsBrian Ford
2013-10-26docs(Angular.js): angular.equals calls itself recursively on objectsthorn0
Closes #4622
2013-10-22style: make jshint happyVojta Jina
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-08docs(angular.equals): fix simple typoMarc Tamlyn
- JavasScript -> Javascript Closes #4323
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-10-03docs(angular.bind): clarify that bind is partial applicationJoe Hanink
The `angular.bind` function reflects the definition of "partial application", which reduces a function's arity rather than transforming a function with n args into a chain of n functions, each having a single arg. curry : f(x,y,z) -> f(x)(y)(z) partial application : f(x,y,z) -> f(x)(y,z) Closes #4239
2013-10-02fix(isArrayLike): correctly handle string primitivesDaniel Luz
Closes #3356
2013-09-30docs(angular.copy): add an example with the two possible argumentsUri Goldshtein
Closes #4179
2013-09-23refactor(angular.toJson): use charAt instead of regexpBoris Serdyuk
Provides a performance improvement when serializing to JSON strings. Closes #4093
2013-09-19doc(ngApp): fix grammarDave Peticolas
2013-09-10docs(angular.copy): clarify corner casesjakub-bochenski
The behaviour when null or undefined was passed was not clear. The exception thrown when source == destination was not documented. Closes #3946
2013-09-05docs(angular.bootstrap): clarify modules parameterPete Bacon Darwin
It was not clear what you could pass to specify modules to load in the `module` parameter of this function. The `modules` parameter takes an array. The main case is to provide a String, which is the name of a "predefined" angular module. The side cases are to provide a Function (or an annotated function in the form of an Array), which will be invoked by the injector as a run block. It is not possible to "define" new modules via this parameter. Closes #3692
2013-08-29fix(core): parse IE11 UA string correctlyChirayu Krishnappa
It's great that IE11 wants to be compatible enough that it doesn't want to be special cased and treated differently. However, as long as one has to have a different code path for IE than for the other supported browsers, we still need to detect and special case it. For instance, our URL parsing code still needs the same workaround the we used for IE10. We still see the same Access denied / TypeError exceptions when setting certain values. FYI, Angular doesn't generally blindly test for IE – we also check the version number. Thanks to modern.ie for the free IE11 test VM. Closes #3682
2013-08-09fix(re-bootstrap): Throw an error when bootstrapping a bootstrapped element.Jeff Cross
Nothing would prevent a user from accidentally calling angular.bootstrap on an element that had already been bootstrapped. If this was done, odd behavior could manifest in an application, causing different scopes to update the same DOM, and causing debugger confusion. This fix adds a check inside of angular.bootstrap to check if the passed-in element already has an injector, and if so, will throw an error.
2013-08-08fix(angular.copy): change angular.copy to correcly clone RegExpAndy Hitchman
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-07-31fix(isArrayLike) Correctly detect arrayLike itemsDaniel Herman
Change the implementation of isArrayLike to use one heavily based on the implementation in jQuery in order to correctly detect array-like objects, that way functionality like ngRepeat works as expected.
2013-07-27docs(*): fixed typos and ngdoc parameter namesCarl Danley
2013-07-26feat(ngAnimate): complete rewrite of animationsMatias Niemelä
- ngAnimate directive is gone and was replaced with class based animations/transitions - support for triggering animations on css class additions and removals - done callback was added to all animation apis - $animation and $animator where merged into a single $animate service with api: - $animate.enter(element, parent, after, done); - $animate.leave(element, done); - $animate.move(element, parent, after, done); - $animate.addClass(element, className, done); - $animate.removeClass(element, className, done); BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
2013-07-24fix(equals): {} and [] should not be considered equivalentBrenton
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-07-23docs(bootstrap): Note that ngScenario requires ngAppBraden Shepherdson
ngScenario expects an ngApp directive to be used, and doesn't work for manually bootstrapped apps. The failure mode is to hang on navigation. Trying to make this wont-fix bug less obscure by documenting it. Eventually Protractor will replace ngScenario and fix this.
2013-07-13fix(angular.equals): add support for regular expressionsBen Ripkens
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
2013-07-12feat(Angular.js): skip JSON.stringify for undefinedGreg Thornton
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-11refactor(Angular.js): remove code duplicationEric Subach
Closes #2890
2013-07-09docs(angular.identity): fix missing 'angular' in identity functionMarco Vito Moscaritolo
2013-07-08fix(angular.equals): do not match keys defined in the prototype chainDaniel Luz
Merely testing for object[key] will give incorrect results on keys defined in Object.prototype. Note: IE8 is generally broken in this regard since `for...in` never returns certain property keys even if they are defined directly on the object. See #2141 - partially merges this PR
2013-07-03refactor(core): use native String.prototype.trim if availableSebastian Müller
2013-07-01fix(Angular.js): handle duplicate params in parseKeyValue/toKeyValuejoshkurz
parseKeyValue and toKeyValue can now handle duplicate values in the query. ``` ?x=1&x=2 <-> {x:[1,2]} ``` The algorithm looks like: 1)parseKeyValue looks for presence of obj[key] 2)detects and replaces obj[key] with [obj[key],val] 3)then pushes more duplicates if necessary 4)toKeyValue decodes array correctly 5)(not changed)$location.search({param: 'key'}) still replaces if necessary 6)(not changed)$location.search({param: ['key1', 'key2']}) sets the url with duplicates BREAKING CHANGE: Before this change: - `parseKeyValue` only took the last key overwriting all the previous keys; - `toKeyValue` joined the keys together in a comma delimited string. This was deemed buggy behavior. If your server relied on this behavior then either the server should be fixed or a simple serialization of the array should be done on the client before passing it to $location.
2013-07-01docs(Angular.js): explain that toJson strips $... propertiesSpencer Applegate
In Angular.toJson, any properties with a leading '$' character will be stripped from the resulting string since angular uses this notation internally for services. There have been complaints of not knowing about this functionality until it breaks within their code.
2013-06-24fix($parse): move global getter out of parse.jsChirayu Krishnappa
2013-06-20refactor(angular.bootstrap): rename internal functionPete Bacon Darwin
2013-06-20fix(Angular.js): don't crash on invalid query parametersPete Bacon Darwin
2013-06-19feat(jqLite): switch bind/unbind to more recent jQuery on/offMichał Gołębiowski
jQuery switched to a completely new event binding implementation as of 1.7.0, centering around on/off methods instead of previous bind/unbind. This patch makes jqLite match this implementation while still supporting previous bind/unbind methods.
2013-06-17chore(minErr): replace ngError with minErrKen Sheedlo