Commit Graph

3392 Commits

Author SHA1 Message Date
Georgios Kalpakas
9f2ad53084 docs(ngMock.$log): fix typos and links
Closes #9313
2014-10-09 14:09:31 -07:00
Igor Minar
5030707e76 refactor($compile): use createMap shortcut 2014-10-09 13:57:00 -07:00
J. Michael Palermo IV
3f6b380bde docs(ngCsp): Universal Windows Apps added
It is necessary for this directive to be enabled when developing Universal Windows Apps written in JavaScript using Angular

Closes #9420
2014-10-09 13:56:20 -07:00
skwakman
7b9fddfe77 docs($compile): further clarify terminal parameter
Clarifies that the terminal parameter will also exclude execution of any directives and expressions in the directive's own template.
2014-10-09 13:42:06 -07:00
Ciro Nunes
a3f44ed1f0 docs(ngAria): correct wording and add resource 2014-10-09 13:00:45 -07:00
Jason Bedard
b0307a33eb refactor($parse): remove dead code
Closes #9489
2014-10-09 12:59:10 -07:00
Artem Chivchalov
40d4bb5863 docs(ngRepeat): fix wrong paragraph order
These paragraphes are related to `track by`, not to `as alias`.

Closes #9226
2014-10-09 12:40:31 -07:00
Shahar Talmi
9c9959059e fix($browser): do not decode cookies that do not appear encoded
Closes #9211
Closes #9225
2014-10-09 12:34:50 -07:00
Justin Walsh
ec88017944 docs($compile): add 'templateNamespace' to example
Closes #9522
2014-10-09 12:25:26 -07:00
Warlock
4568bc037d docs: update angular.extend() documentation
How to preserve original objects similar to jQuery.extend().

Closes #9087
2014-10-09 12:11:16 -07:00
Igor Minar
e07ebded23 docs($http): use .get and .post shortcut methods in examples 2014-10-09 12:00:34 -07:00
Guilherme de Souza
1f650bae4b docs(\$http): add POST request example
Closes #9046
2014-10-09 12:00:33 -07:00
Georgios Kalpakas
d1eec47cb8 refactor($location): remove redundant spaces 2014-10-09 11:59:45 -07:00
Georgios Kalpakas
a4db4e6187 docs($location): fix description for rewriteLinks 2014-10-09 11:59:45 -07:00
thorn0
58e8c02c14 docs(angular.injector): correct return type 2014-10-09 11:49:16 -07:00
Michał Gołębiowski
64241a57e2 chore($sniffer): Remove $sniffer.msie & $sniffer.msieDocumentMode
Since msie is now set to document.documentMode, it's not necessary to keep
the documentMode in a separate property.

Also, msie is a variable global to Angular source so there's no need to
replicate it in $sniffer.

Closes gh-9496
2014-10-09 10:56:15 -07:00
Shahar Talmi
2435e2b8f8 fix(select): manage select controller options correctly
This fixes a regression that was introduced in 2bcd02d. Basically, the problem was that render() removed the wrong option from the select controller since it assumed that the option that was removed has the same label as the excessive option in existingOptions, but this is only correct if the option was popped from the end of the array. We now remember for each label whether it was added or removed (or removed at some point and then added at a different point) and report to the select controller only about options that were actually removed or added, ignoring any options that just moved.

Closes #9418
2014-10-09 09:40:56 -07:00
Caitlin Potter
372fa6993b fix($injector): ensure $get method invoked with provider context
0d3b69a5f2 broke this by calling $get with an undefined
context, which in strict mode would be undefined. This fixes this by ensuring that the
provider is used as the context, as it was originally.

Closes #9511
Closes #9512
2014-10-09 08:04:18 -04:00
Jakub Zych
7b102323e9 style(filters) use consistent quote style and strict equality
before change quotes where mixed and one if contained equality operator instead of identity

Closes #9349
2014-10-09 07:10:43 -04:00
bullgare
c7a9009e14 fix($location): use clone of passed search() object
Fixes bug when $location.search() is not returning search part of current url.

Previously, the location's internal search object could be set by passing an object to the search()
method. Subsequent changes to the passed search object would be exposed when requesting the search
object, but those changes would not appear in the composed url.

Now, the object is cloned, so the result of location.search() should match the contents of
location.absUrl(), provided the object returned from location.search() is not changed.

Closes #9445
2014-10-09 05:32:42 -04:00
Peter Bacon Darwin
e15d2fd472 refact($anchorScroll): use Array.some for better performance 2014-10-09 07:24:20 +01:00
Jeff Cross
daf37375d3 docs(select): fix formatting of and placement of selectAs/trackAs explanation 2014-10-08 16:39:23 -07:00
Shahar Talmi
0563a0a636 refactor(formController): remove redundant methods from nullFormCtrl 2014-10-08 15:35:55 -07:00
Tobias Bosch
f4ff11b01e feat($route): ability to cancel $routeChangeStart event
Calling `preventDefault()` on a `$routeChangeStart` event will
prevent the route change and also call `preventDefault` on the `$locationChangeStart` event, which prevents the location change as well.

BREAKING CHANGE:

Order of events has changed.
Previously: `$locationChangeStart` -> `$locationChangeSuccess`
  -> `$routeChangeStart` -> `$routeChangeSuccess`

Now: `$locationChangeStart` -> `$routeChangeStart`
  -> `$locationChangeSuccess` ->  -> `$routeChangeSuccess`

Fixes #5581
Closes #5714
Closes #9502
2014-10-08 15:35:04 -07:00
Caitlin Potter
0d3b69a5f2 fix($injector): throw when factory $get method does not return a value
BREAKING CHANGE:

Previously, not returning a value would fail silently, and an application trying to inject the
value owuld inject an undefined value, quite possibly leading to a TypeError. Now, the application
will fail entirely, and a reason will be given.

Closes #4575
Closes #9210
2014-10-08 16:49:38 -04:00
Matias Niemelä
39d0b36826 fix($animate): ensure hidden elements with ngShow/ngHide stay hidden during animations
Prior to this fix if an element that contained ng-show or ng-hide was in its hidden state
then any other animation run on the same element would cause the animation to appear despite
the element itself already being hidden. This patch ensures that NO animations are visible
even if the element is set as hidden.

Closes #9103
Closes #9493
2014-10-08 13:48:25 -07:00
Matias Niemelä
035ffb82c4 chore($animate): enable temporary classes to be applied during an animation
Closes #9493
2014-10-08 13:48:12 -07:00
Igor Minar
d5445c601f fix($anchorScroll): don't scroll to top when initializing and location hash is empty
Closes #8848
Closes #9393
2014-10-08 13:40:46 -07:00
Matias Niemelä
df1a00b11a fix($animate): permit class-based animations for leave operations if ngAnimateChildren is enabled
Prior to this fix, $animate.leave placed a disabled animation on the element
which prevented ngAnimateChildren from properly working. This patch now
addresses that issue.

Closes #8092
Closes #9491
2014-10-08 13:37:54 -07:00
Sean Griffin
b3e09be589 feat($location): allow automatic rewriting of links to be disabled
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.

Closes #5487
2014-10-08 13:11:52 -07:00
Caitlin Potter
0c2378de79 refactor(ngAnimate): remove unneeded comparison
It was supposed to be removed in 22358cf9c7, but was not.
2014-10-08 16:05:13 -04:00
Jeff Cross
30996f82af fix(select): throw for selectAs and trackBy
trackBy and selectAs have never worked together, and are fundamentally
incompatible since model changes cannot deterministically be
reflected back to the view. This change throws an error to help
developers better understand this scenario.
2014-10-08 12:46:26 -07:00
Tobias Bosch
aad60953ce refactor(select): reduce duplication and reorder functions 2014-10-08 12:27:15 -07:00
Jeff Cross
ab354cf04e fix(select): make ngOptions support selectAs and trackBy together
This commit implements two functions, "isSelected()" and "getViewValue()"
to properly compute an option's selected state and the model controller's
viewValue respectively. These functions give proper precedence to "track by"
and "select as" parts of the ngOptions comprehension expression, which were
previously inconsistent and incompatible.

Fixes #6564
2014-10-08 12:27:15 -07:00
Caitlin Potter
208114c2b2 chore(AngularPublic): remove $$hasClass from angular exports
It was previously used for ngAnimate, but is no longer needed
2014-10-08 14:56:50 -04:00
Caitlin Potter
22358cf9c7 perf($animate): access DOM less in resolveElementClasses
Previously we were reading DOM attributes frequently, now we can do it just once.
2014-10-08 14:56:49 -04:00
Caitlin Potter
003c44ecee perf($animate): don't join classes before it's necessary in resolveElementClasses
In ngAnimate, we can't do this because the behaviour is exposed via the API. But
in core, we can avoid a bit of work.
2014-10-08 14:56:49 -04:00
Caitlin Potter
9e4701a5ab chore(ngAnimate): add TODO messages indicating desire to remove hack 2014-10-08 14:56:49 -04:00
Caitlin Potter
cae01f4941 refactor($compile): use labaled variables to represent nodeType values
This also does some cleanup in $animate
2014-10-08 14:56:49 -04:00
Caitlin Potter
667183a8c7 fix(ngAnimate): defer DOM operations for changing classes to postDigest
When ngAnimate is used, it will defer changes to classes until postDigest. Previously,
AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM
operations.

Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a
digest, class manipulation is deferred. This helps reduce jank in browsers such as
IE11.

BREAKING CHANGE:

The $animate class API will always defer changes until the end of the next digest. This allows ngAnimate
to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than
many. This prevents jank in browsers such as IE, and is generally a good thing.

If you're finding that your classes are not being immediately applied, be sure to invoke $digest().

Closes #8234
Closes #9263
2014-10-08 14:56:49 -04:00
Izhaki
323862ff63 docs($compile): note template is ignored with element transclusion 2014-10-08 11:27:45 -07:00
Michał Gołębiowski
e63f670ff2 docs(content): update Angular 1.2 mentions to Angular 1.3
Angular 1.3 docs now describe the process of using this version instead of
the older 1.2 that is the latest stable version.

Also, update jQuery 1.10.x mentions to 2.1.x.
2014-10-08 10:59:54 -07:00
Jesse Palmer
6b786dcb57 docs(ngIf): update out-of-date link 2014-10-08 10:42:41 -07:00
Michał Gołębiowski
1beebee968 chore($sniffer): Remove $sniffer.hashchange
The hashchange event is not supported only in ancient browsers like Android<2.2
and IE<8. Angular never really supported IE7 and in 1.3 where support for IE8
is dropped it makes even less sense to check for hashchange support.
2014-10-08 17:36:44 +02:00
Caitlin Potter
74a214c043 chore(ngScenario): make jshint happy
Someone accidentally removed an important keyword which prevented a variable from being added to the global object

Closes #9484
2014-10-07 22:54:44 -04:00
Matias Niemelä
c93924ed27 fix($animate): ensure that class-based animations only consider the most recent DOM operations
Prior to this fix $animate would maintain a count of each time a class was
added and removed within $animate. With this fix, $animate instead only cares
about the most recent addClass or removeClass operation and will only perform
that operation (depending on what was last called).

```
// before
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +2
removeClass => +1
// this will cause an addClass animation

// now
addClass    => add
removeClass => remove
addClass    => add
addClass    => add
removeClass => remove
// this will cause a removeClass animation
```

Closes #8946
Closes #9458
2014-10-07 16:21:56 -07:00
Igor Minar
a84480affb refactor: use document.documentMode to determine msie version
Closes #9398
2014-10-07 16:09:50 -07:00
Michał Gołębiowski
6fd36deed9 feat($location): add support for History API state handling
Adds $location state method allowing to get/set a History API state via
pushState & replaceState methods.

Note that:
- Angular treats states undefined and null as the same; trying to change
one to the other without touching the URL won't do anything. This is necessary
to prevent infinite digest loops when setting the URL to itself in IE<10 in
the HTML5 hash fallback mode.
- The state() method is not compatible with browsers not supporting
the HTML5 History API, e.g. IE 9 or Android < 4.0.

Closes #9027
2014-10-07 15:48:10 -07:00
Tobias Bosch
8ee1ba4b94 fix($browser): Cache location.href only during page reload phase
Adds caching for url changes while a reload is happening,
as browsers do not allow to read out the new location the browser
is navigating to.

Removes unnecessary caching from $browser, as IE7-IE9 all
have the new hash value in `location.href` after changing it.
There was a wrong assumption in the previous version of this code
introduced by dca23173e2 and d70711481e.

Adds more tests for #6976
Fixes #9235
Closes #9455
2014-10-07 11:20:33 -07:00
Ben Harold
ab240196bf docs($injector): fix syntax error
There was a missing parenthesis in $injector test example

Closes #9469
2014-10-07 13:39:09 -04:00