httpBackend with ngMock browser.defer could never cancel the first deferredFn
because the timeoutId returned by defer for the first fn is a zero value.
Compare timeoutId with undefined fix this issue.
Closes#10177
Email addresses can (under certain restrictions) include double quote
characters. See http://tools.ietf.org/html/rfc3696#section-3.
For example, `"Jo Bloggs"@abc.com` is a valid email address.
When serializing emails to the `href` attribute of an anchor element,
we must HTML encode these double quote characters. See
http://www.w3.org/TR/html-markup/syntax.html#syntax-attr-double-quoted
This commit does not attempt to improve the functionality (i.e. regex)
that attempts to identify email addresses in a general string.
Closes#8945Closes#8964Closes#5946Closes#10090Closes#9256
This commit tried to create consistency by ensuring that `$isEmpty` is not
called on both model and view values but it chose to only use `$modelValue`,
which is not actually correct.
`$isEmpty` is designed to compute whether the `$viewValue` is empty. In
practice this is the only part of the parse/format system that the
directive has control over. We can't rely on the `$modelValue` being in
any particular format since other directives can add in their own formatters
and parsers to completely change this.
(reverted from commit 3e51b84bc1)
This commit adds to the unit testing guide:
- an explicit section on additional libraries: Karma, Jasmine and
angular-mocks and link to the docs for those projects too. Explain the
benefit and use case for each of these libaries
- fully featured test examples and add more documentation
around them, in particular the controller test
- a clear separation between the section on principles of testing
and the actual tutorial on writing a test
Closes#8220
Many thanks to @NevilleS and @jbedard for collaborating with me on a solution to this!
Closes#9394Closes#9865
BREAKING CHANGE: previously, ngModel invoked getter/setters in the global context.
For example:
```js
<input ng-model="model.value" ng-model-options="{ getterSetter: true }">
```
would previously invoke `model.value()` in the global context.
Now, ngModel invokes `value` with `model` as the context.
It's unlikely that real apps relied on this behavior. If they did they can use `.bind` to explicilty
bind a getter/getter to the global context, or just reference globals normally without `this`.
Currently, providing '' to $location#url will only reset the hash, but otherwise has no effect. This
change brings the behaviour of $location#url more inline with window.location.href, which when
assigned to an empty string loads the page's base href.
Before:
$location.url() // http://www.example.com/path
$location.url('') // http://www.example.com/path
After:
$location.url() // http://www.example.com/path
$location.url('') // http://www.example.comFixes#10063Closes#10064
Previously, setting the maxlength to a negative number, would make all
input values invalid (since their length should be less than maxlength,
which is impossible).
This commit changes the behaviour of maxlength/ngMaxlength, effectively
disabling the maxlength validation (always returning true) when maxlength
is set to a negative number. This is more inline to how the HTML5
`maxlength` attribute works (both in browsers and according to the spec:
http://dev.w3.org/html5/spec-preview/attributes-common-to-form-controls.html#attr-fe-maxlength).
Related to #9874Closes#9995
Previously, when (automatically) redirecting from path that fetured a
trailing slash and optional or "eager" parameters, the resulting path
would (incorrectly) contain the special characters (`?`,`*`) along with
the parameter values.
Closes#9819Closes#9827
The ngAnimate makes reference to a function `$animateProvider.classNamePrefix`
that does not exist, the correct function is `$animateProvider.classNameFilter`
Closes#10142
The wordings in setDirty etc. were specific to inputs, but ngModelCtrl
is agnostic to this and the preferred term is 'control'. I also
added some more info about this to the description, and linked to
the example that now lives at the bottom of the page.
- extract existing functionality to public method: $setDirty
- add tests to corresponding changes
- refactor code to use extracted method
Closes#10038Closes#10049