Commit Graph

2576 Commits

Author SHA1 Message Date
Igor Minar
2b84f43a6d style(ngMocks): remove ws 2014-03-18 15:54:17 -07:00
Caio Cunha
d6cfcacee1 feat(ngMock.$httpBackend): added support for function as URL matcher
It's now possible to pass a function to match the URL in $httpBackend mocked
expectations. This gives a more sophisticate control over the URL matching
without requiring complex RegExp mantainance or the workaround of creating
an object with a `test` function in order to mimic RegExp interface.

This approach was suggested in [this
thread](https://groups.google.com/d/msg/angular/3QsCUEvvxlM/Q4C4ZIqNIuEJ)

Closes #4580
2014-03-18 15:19:26 -07:00
Caio Cunha
299b220f5e feat($compile): add support for $observer deregistration
In order to make the behavior compatible with $rootScope.$watch and $rootScope.$on methods, and
make it possible to deregister an attribute observer, Attributes.$observe method now returns a
deregistration function instead of the observer itself.

BREAKING CHANGE: calling attr.$observe no longer returns the observer function, but a
    deregistration function instead.

    To migrate the code follow the example below:

    Before:

```
    directive('directiveName', function() {
      return {
        link: function(scope, elm, attr) {
          var observer = attr.$observe('someAttr', function(value) {
            console.log(value);
          });
        }
      };
    });
```

    After:

```
    directive('directiveName', function() {
      return {
        link: function(scope, elm, attr) {
          var observer = function(value) {
            console.log(value);
          };

          attr.$observe('someAttr', observer);
        }
      };
    });
```

Closes #5609
2014-03-18 13:44:16 -07:00
Igor Minar
78057a945e fix(Scope): $watchCollection should call listener with oldValue
Originally we destroyed the oldValue by incrementaly copying over portions of the newValue
into the oldValue during dirty-checking, this resulted in oldValue to be equal to newValue
by the time we called the watchCollection listener.

The fix creates a copy of the newValue each time a change is detected and then uses that
copy *the next time* a change is detected.

To make `$watchCollection` behave the same way as `$watch`, during the first iteration
the listener is called with newValue and oldValue being identical.

Since many of the corner-cases are already covered by existing tests, I refactored the
test logging to include oldValue and made the tests more readable.

Closes #2621
Closes #5661
Closes #5688
Closes #6736
2014-03-18 12:00:50 -07:00
Siddique Hameed
748a6c8d9d fix(angular.bootstrap): only allow angular to load once
This is hard to test as a unit-test, since it involves the actual loading
of angular, but it turns out that it is easy to test using a protractor
e2e test.

Closes #5863
Closes #5587
2014-03-18 12:02:19 +00:00
Caitlin Potter
f8f97f8b61 style($templateCache): remove trailing whitespace
This was introduced by 2ca6d650e8, somewhat inexplicably as I had run
grunt ci-checks locally. But regardless, this should fix this up.
2014-03-17 21:47:25 -04:00
Jesse Palmer
2ca6d650e8 docs($templateCache): use GFM example format rather than <pre> tags
Updated example formatting.

Closes #6068
2014-03-17 20:12:00 -04:00
Edward Brey
547871e779 docs(loader): add annotations to example 2014-03-17 16:38:10 -07:00
Tyler Kellogg
a4b70cfd71 docs($cookies): cookies serializer only supports strings
Closes #6705
2014-03-17 16:29:10 -07:00
unicodesnowman
68e84acec9 docs(ngView): remove global controller definitions
instead use angular modules
also fix formatting
2014-03-17 14:55:00 -07:00
Sekib Omazic
9202767f41 docs(booleanAttrs): fix typo 2014-03-17 14:19:40 -07:00
David Rogers
c995b09b77 docs(ngForm): remove duplicate @param annotation
When the example for `ngAnimate` was added in commit:3344396, the `@param name` annotation was unintentionally duplicated. Remove this duplicate.

Closes #6720
2014-03-17 17:05:57 -04:00
Caitlin Potter
8a96f317e5 fix(jqLite): traverse host property for DocumentFragment in inheritedData()
If dealing with a document fragment node with a host element, and no parent, use the host
element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
to lookup parent controllers.

Closes #6637
2014-03-17 16:52:48 -04:00
Mark Jones
d3aa14bc11 docs(ngInclude): make the quote type explicit 2014-03-17 13:20:06 -07:00
linclark
cd49876e34 docs($http): update shortcut method description
Update docs to reflect that $http no longer requires passing in an HTTP method, as changed in #6401.
2014-03-17 13:07:15 -07:00
bradwheel
55a0bc453c docs(ngRoute): remove global controller syntax in the example 2014-03-17 12:50:14 -07:00
Bruno Baia
b8cc71d476 fix($http): allow sending Blob data using $http
Closes #5012
2014-03-15 19:41:07 +01:00
Pawel Kozlowski
56e73ea355 fix($http): don't covert 0 status codes to 404 for non-file protocols
PR #5547 introduced conversion of all 0 status codes to 404 for cases
where no response was recieved (previously this was done for the
file:// protocol only). But this mechanism is too eager and
masks legitimate cases where status 0 should be returned. This commits
reverts to the previous mechanism of handling 0 status code for the
file:// protocol (converting 0 to 404) while retaining the returned
status code 0 for all the protocols other than file://

Fixes #6074
Fixes #6155
2014-03-14 13:44:56 -07:00
Matias Niemelä
7b5e019981 fix($$rAF): always fallback to a $timeout incase native rAF isn't supported
Closes #6654
2014-03-14 12:42:07 -04:00
Tomer Chachamu
129e2e021a fix(ngAnimate): setting classNameFilter disables animation inside ng-if
Closes #6539
2014-03-14 12:40:40 -04:00
Nick Heiner
79592ce9e2 docs(ngMock): grammar nitpick. 2014-03-13 16:52:59 -07:00
Wesley Cho
91ef3a31a0 docs($resource): fix example using promise 2014-03-13 16:33:38 -07:00
Thomas Belin
cea44b3e86 fix (ngAnimate): fix requestAnimationFrame for old version of Firefox
The recent $$RAFProvider which is a wrapper for the native
requestAnimationFrame method doesn't use the mozRequestAnimationFrame.
Old versions of FF (20 for example) crash if ngAnimate is included

No breaking changes and fix issue https://github.com/angular/angular.js/issues/6535

Closes #6535
Closes #6540
2014-03-13 16:31:11 -07:00
Louis Haußknecht
d6419d0aff docs(route.js): changed html entities lt gt to < and > 2014-03-10 15:37:44 -07:00
Basem Mostafa
55848a9139 docs(ngRepeat): Separate animation class in new lines
Moving to new lines & making it bold to avoid confusion
when they r all in same line without any separation

Closes #6633
2014-03-10 15:34:16 -07:00
doodeec
0d8de2d3ea docs($route): change routes property to correct type
change $route.routes property type to Object, property is marked incorrectly as an Array

Closes #6552
2014-03-10 02:19:57 -07:00
Igor Minar
47ab8df455 feat(): whitelist blob urls for sanitization of data-bound image urls
Closes #4623
2014-03-10 01:39:15 -07:00
Sekib Omazic
4bab3d8227 docs($sce): correct typo
`consititute` -> `constitute`

Typo fixed

Closes #6607
2014-03-07 18:12:40 -05:00
Sekib Omazic
9c353b4f17 docs(ngBind): fix typo
`preferrable` -> `preferable`

Typo fixed

Closes #6606
2014-03-07 17:55:10 -05:00
Peter Bacon Darwin
dc57fe97e1 style(jsdoc tags): remove/ammend invalid tags
As highlighted by the new sterner dgeni.
2014-03-07 20:05:59 +00:00
Lucas Galfasó
53ec5e13e5 fix($compile): support templates with thead and tfoot root elements
If the first element in a template is a <thead> or a <tfoot>, then
use the existing logic to handle table elements compilation.

Closes #6289
2014-03-07 10:06:12 -08:00
Peter Bacon Darwin
0e066693f2 docs($route): fix formatting of example code 2014-03-07 11:19:17 +00:00
Ben Lesh
46bd6dc88d feat(input): support types date, time, datetime-local, month, week
On older browser that don't support the new HTML5 inputs
and display a text input instead, the user is required to enter
the data in the corresponding ISO format. The value in `ng-model`
will always be a date.

E2e tests contain a workaround to a bug in webdriver,
see https://github.com/angular/protractor/issues/562.

Also adds weeks as format to the `dateFilter`.

Related to #757.
Closes #5864.
2014-03-06 12:21:15 -08:00
Sekib Omazic
0609453e1f fix(style): expressions in style tags
Enable data-binding for style tags.

Note: this feature does not work on IE8.

Closes #2387
Closes #6492
2014-03-06 02:19:30 -08:00
Timothée Jeannin
9335378602 style: enable jscs requireLeftStickedOperators rule
Closed #6544.
2014-03-05 16:30:51 -08:00
Ole Michaelis
bf82c8a708 docs(loader): remove duplicate "the"
Typo fixup

Closes #6521
2014-03-02 19:25:19 -05:00
Gronblom Sam
d5f2084883 docs(ngView): rename controller suffix in ngView example
- According to
  5bf81bc111/docs/content/guide/controller.ngdoc (L166)
  Ctrl should be the suffix for a controller

Closes #5817
2014-03-02 22:37:29 +01:00
MikeMcElroy
9bffccd935 docs($interval): cancel() takes a promise not a number
Closes #6485
2014-03-02 16:07:44 +00:00
Peter Bacon Darwin
e89139dc9d docs(*): ensure jsdoc type expressions are valid 2014-03-02 15:02:29 +00:00
Paolo Moretti
bf01ab2a13 docs(loader): change 'MyModule' -> 'myModule'
Closes #5393
2014-03-02 14:18:42 +01:00
thenickcox
3248233f5e docs(ngMock): fixes in flush() documentation
The docs for the `flush()` method contained a few grammatical
errors and were awkwardly worded. Change the explanation of
the method to remove errors and read more naturally.

Closes #4886
2014-03-02 13:55:51 +01:00
Igor Minar
d3fbc25be2 style: enable jscs requireRightStickedOperators rule 2014-02-28 16:47:21 -08:00
Matias Niemelä
0d034a98ec docs(forms): generated CSS classes for forms and inputs must have a ng prefix 2014-02-28 14:59:12 -05:00
Jason Winnebeck
0c8a88ba09 docs(input): update $parsers NgModelController doc
Make it clear that the result of the $parsers pipeline is what goes to the model value.

Closes #5708
2014-02-28 20:09:30 +01:00
nosideeffects
9aab5bfc03 docs(ngAnimate): add missing 'super' to addClass 2014-02-28 11:37:57 -05:00
Matias Niemelä
18c41af065 fix($animate): delegate down to addClass/removeClass if setClass is not found
Closes #6463
2014-02-28 01:34:57 -05:00
Yves Brissaud
33443966c8 feat($animate): animate dirty, pristine, valid, invalid for form/fields
Add css animations when form or field status change to/from dirty,
pristine, valid or invalid. This works like animation system present
with ngClass, ngShow, etc.

Closes #5378
2014-02-28 01:01:34 -05:00
linclark
8794a173f9 docs(core): update fromJson return values
Dates are not returned, so remove Date from list of return values.

Closes #3070
2014-02-27 16:13:52 -08:00
Pawel Kozlowski
4e73c80b17 fix(jqLite): properly toggle multiple classes
Fixes #4467
Closes #6448
2014-02-27 19:44:57 +01:00
Lajos Veres
c34602007c chore(animate): fix typo in a comment 2014-02-27 01:44:25 -08:00