5608 Commits

Author SHA1 Message Date
Igor Minar
77350209aa fix(ngRepeat): preserve original position of elements that are being animated away
During the recent refactoring a typo was made that broke code that detects if we are
already removed from the DOM (animation has completed).

Closes #8918
2014-09-09 13:39:52 +02:00
Igor Minar
ea19d1f11e chore(testabilityPatch): fix the dump fn so that it works with karma's debug.html 2014-09-09 13:35:32 +02:00
Igor Minar
d3bf2561f6 test(animateSpec): remove unused variables 2014-09-09 13:35:32 +02:00
Igor Minar
624bb8a8b9 test(ngRepeat): move an existing test into the right describe block 2014-09-09 02:16:45 +02:00
Jason Bedard
9ce4029430 perf($parse): remove getterFn wrapper for internal use
Closes #8901
2014-09-09 02:10:55 +02:00
Jason Bedard
10b09dfc8a test($parse): adding benchmark for execution of $parse()ed expressions
Part of #8901
2014-09-09 02:10:55 +02:00
Tobias Bosch
6046e14bd2 refactor(ngModelController,formController): centralize and simplify logic
The previous logic for async validation in
`ngModelController` and `formController` was not maintainable:
- control logic is in multiple parts, e.g. `ctrl.$setValidity`
  waits for end of promises and continuous the control flow
  for async validation
- logic for updating the flags `ctrl.$error`, `ctrl.$pending`, `ctrl.$valid`
  is super complicated, especially in `formController`

This refactoring makes the following changes:
- simplify async validation: centralize control logic
  into one method in `ngModelController`:
  * remove counters `invalidCount` and `pendingCount`
  * use a flag `currentValidationRunId` to separate
    async validator runs from each other
  * use `$q.all` to determine when all async validators are done
- centralize way how `ctrl.$modelValue` and `ctrl.$invalidModelValue`
  is updated
- simplify `ngModelController/formCtrl.$setValidity` and merge
  `$$setPending/$$clearControlValidity/$$clearValidity/$$clearPending`
  into one method, that is used by `ngModelController` AND
  `formController`
  * remove diff calculation, always calculate the correct state anew,
    only cache the css classes that have been set to not
    trigger too many css animations.
  * remove fields from `ctrl.$error` that are valid and add private `ctrl.$$success`:
    allows to correctly separate states for valid, invalid, skipped and pending,
    especially transitively across parent forms.
- fix bug in `ngModelController`:
  * only read out `input.validity.badInput`, but not
    `input.validity.typeMismatch`,
    to determine parser error: We still want our `email`
    validator to run event when the model is validated.
- fix bugs in tests that were found as the logic is now consistent between
  `ngModelController` and `formController`

BREAKING CHANGE:
- `ctrl.$error` does no more contain entries for validators that were
  successful.
- `ctrl.$setValidity` now differentiates between `true`, `false`,
  `undefined` and `null`, instead of previously only truthy vs falsy.

Closes #8941
2014-09-08 15:10:02 -07:00
Tobias Bosch
2a5af502c5 docs($location): clarify guide regarding link handling
The trick with setting `<base href=".">` has not worked since Angular 1.2.0.
It is also misleading that it talks about `$routeProvider.otherwise`
which is not important in this case.

Related to #8869
Closes #8908
2014-09-08 10:40:20 -07:00
Jason Bedard
9bedeb3353 perf(extend): remove use of forEach to remove calls/closures/passing arguments
Closes #8898
2014-09-08 17:15:02 +02:00
Jason Bedard
df9e60c8e7 feat(angular.forEach): add the array/object as the 3rd param like the native array forEach
Closes #7902
2014-09-08 17:06:16 +02:00
Igor Minar
41cec4d680 refactor(select): remove code duplication 2014-09-08 16:58:47 +02:00
Peter Bacon Darwin
0f3ea45d73 docs($filter): remove duplicate documentation of register method 2014-09-08 12:05:11 +01:00
Peter Bacon Darwin
cddd48fe20 docs(form): move param tag outside of main description 2014-09-08 12:05:11 +01:00
Peter Bacon Darwin
be3b62cd09 chore(bower): refactor bower usage
The gulp bower task in the docs app was never actually running since it couldn't
find the bower.json file and was silently failing. Updating to a newer bower
highlighted this issue.

This commit moves the docs app specific bower components into the docs folder.
There are only jquery and closure compiler related components in the project
folder now.

It also improves the gulp bower task to provide better feedback of progress
and errors.
2014-09-08 12:05:11 +01:00
Peter Bacon Darwin
40308e5935 chore(package.json): tidy up dependencies
Sorted dependencies into alphabetic order. If we can keep them like this
it will be much easier to keep track of version changes.

Updated bower and gulp to newer versions.
2014-09-08 12:05:11 +01:00
Jason Bedard
f6aa1c5561 perf(jQuery): only trigger $destroy if a handler exists
Speeds up largetable destruction by 30% (500ms) when jQuery 2.1.1 is present.

Closes #8859
2014-09-07 23:56:11 +02:00
Jason Bedard
43c67ccd16 perf($parse): removing references to Parser/Lexer from parsed expressions
This allows the parser and lexer objects to get GC-ed once the expression
is parsed.

Part of #8901
2014-09-07 23:02:31 +02:00
Jason Bedard
1cfd49ddf0 refactor($parse): simplifying some while(true) loops
Part of #8901
2014-09-07 22:55:33 +02:00
Jason Bedard
907b8c1675 perf($parse): calculate array lengths once at start of loop
Part of #8901
2014-09-07 22:53:16 +02:00
Jason Bedard
432aa9e4e4 refactor($parse): adding function names for easier debugging
Part of #8901
2014-09-07 22:52:00 +02:00
Jason Bedard
b95dabb881 refactor($parse): simplifying multi-statement execution
Part of #8901
2014-09-07 22:42:05 +02:00
Pawel Kozlowski
0f3adece3b refactor($http): simplify buildUrl function
Closes #8955
2014-09-05 20:21:00 -04:00
Shahar Talmi
e322cd9b3b fix(ngModelOptions): do not trigger digest on setViewValue if debouncing
Note that this change means that anyone watching `$viewValue` will have to
wait for a new digest before they are aware that it has been updated.

Closes #8814
Closes #8850
Closes #8911
2014-09-05 20:15:34 +01:00
Caitlin Potter
b3b672130d fix(ngAnimate): support removing classes from SVG elements when using jQuery
Fixes a regression in ngAnimate introduced in 2f4437b3, whereby SVG elements would not be able to
have classes removed by ngAnimate methods when jQuery was loaded (without also including libraries
which patch jQuery to support SVG elements, such as jquery-svgdom.js).

This fix exports jqLiteHasClass as a private method `$$hasClass` on the `angular` global object,
which enables ngAnimate to use this SVG-safe method for testing if the class is available.

Closes #8872
Closes #8893
2014-09-05 13:51:17 -04:00
Julie Ralph
8b5d33dab8 chore(tests): update Protractor to v1.2.0 2014-09-05 10:49:18 -07:00
Vitali Tsevan
cbdaabfb59 fix(orderBy): allow arrayLike objects to be ordered
Closes #8944
2014-09-05 11:56:09 +01:00
Rouven Weßling
3471fedfbc refactor(indexOf) Remove a now unused copy of the indexOf function
This was missed in 300bffc4fe

Closes #8939
2014-09-05 10:23:52 +01:00
Jeff Cross
c3a58a9f34 fix($location): don't call toString on null values 2014-09-04 17:16:11 -07:00
thorn0
99d95f1639 fix($location): remove an unused parameter of $location.url 2014-09-04 15:09:18 -07:00
John Reilly
48e66cff40 docs($location): update search description to include number param 2014-09-04 14:49:52 -07:00
Pawel Kozlowski
adb5c6d6cc fix($location): allow numeric location setter arguments
Fixes #7054
2014-09-04 09:55:03 -07:00
Peter Bacon Darwin
b01a03c1b9 docs(guide): add sortOrder to each page
Finally we can control the order of the guide pages
2014-09-04 16:49:25 +01:00
Peter Bacon Darwin
43e0dc2dfe chore(docs): enable page ordering by @sortOrder tag 2014-09-04 16:49:25 +01:00
Matias Niemelä
976da56d50 test(ngModel): add missing tests for ngMin/ngMax for date inputs 2014-09-04 11:46:05 -04:00
Matias Niemelä
088545c185 fix(ngModel): properly parse min/max date values as strings for date inputs
Due to the nature of how date objects are rendered when JSON.stringify
is called, the resulting string contains two sets of quotes surrounding
it. This commit fixes that issue.

Closes #6755
2014-09-04 11:45:59 -04:00
Matias Niemelä
b350283503 fix(ngModel): revalidate the model when min/max expression values change for date inputs
Closes #6755
2014-09-04 11:45:53 -04:00
Matias Niemelä
25541c1f87 fix(ngModel): consider ngMin/ngMax values when validating number input types
With this fix ngModel will treat ngMin as a min error and ngMax as a max error.
This also means that when either of these two values is changed then ngModel will
revaliate itself.
2014-09-04 11:45:46 -04:00
Matias Niemelä
7b273a2c97 fix(ngModel): revalidate the model when min/max expression values change for number inputs
As of this fix if the max or min value is changed via scope or by another ngModel
then it will trigger the model containing the min/max attributes to revalidate itself.

Closes #2404
2014-09-04 11:45:36 -04:00
Peter Bacon Darwin
3952408cf1 chore(docs): improve searching by member
The keywords processor now also extracts the members (i.e. method, properties
and events) into its own search term property. These are then used in the lunr
search index with higher weighting that normal keywords to push services that
contain the query term as a member higher up the search results.

Closes #7661
2014-09-04 14:23:04 +01:00
Peter Bacon Darwin
02bada130e refact(ngSwitch): don't create extra function in for loop
Closes #8927
2014-09-04 13:17:21 +01:00
The Big Red Geek
712299c2a2 fix(ngSwitch): ensure correct iterator is passed to async function
Closes #8833
2014-09-04 12:49:14 +01:00
Peter Bacon Darwin
6d1e7cdc51 fix($compile): render nested transclusion at the root of a template
Closes #8914
Closes #8925
2014-09-04 12:30:09 +01:00
Peter Bacon Darwin
86c6be82e5 docs($http): clarify overriding of default transformations
Closes #8590
2014-09-04 12:28:18 +01:00
Smitha Milli
ae952fbf0b fix(numberFilter): format numbers that round to zero as nonnegative
Previously when a negative number was rounded to 0 by the number filter
it would be formated as a negative number.  This means something like
{{ -0.01 | number: 1 }} would output -0.0.  Now it will ouput 0.0
instead.

Closes #8489
2014-09-03 14:59:53 -07:00
thorn0
73157b0a0b docs(docs.css): improve comma spacing in TOC on mobile 2014-09-03 13:57:49 -07:00
Juampy
0ee0ce18c1 docs($sce:unsafe): fix link to $sce docs
The second link to Strict Contextual Escaping (SCE) points to a 404.

Closes #8514
2014-09-03 16:31:06 -04:00
thorn0
7f87988e41 docs(README): fix 'Contribution guidelines' link
The current link leads to a page 'Building and Testing AngularJS'.
This same link is also included in the 'Building AngularJS' section
of the README where it's more relevant.
2014-09-03 13:24:56 -07:00
TLChan
9a09f1d96d docs(tutorial/step_05): improve formatting of code identifier
Closes #8557
2014-09-03 16:24:06 -04:00
Zach Pomerantz
e96be5bfb8 docs(interpolate): fix link text 2014-09-03 13:17:46 -07:00
Vic Metcalfe
095627ad17 docs(ngBlur): explain blur events 2014-09-03 13:04:50 -07:00