Commit Graph

2902 Commits

Author SHA1 Message Date
Julie Ralph
93510eb51b chore(tests): fix warning about a non-unique element locator in e2e tests 2014-07-08 16:26:47 -07:00
Lucas Galfaso
b8ae73e17c fix(select): auto-select new option that is marked as selected
When adding a new <option> element, if the DOM of this option element
states that the element is marked as `selected`, then select the new
<option> element

Closes #6828
2014-07-09 00:44:59 +02:00
Michał Gołębiowski
36831eccd1 refactor(jshint): reduce duplication & test all JS files 2014-07-08 15:49:25 +02:00
Brian Ford
b9fcf01731 feat(ngModel): bind to getters/setters
Closes #768
2014-07-08 02:54:08 -07:00
Brian Ford
3f2232b5a1 feat($controller): disable using global controller constructors
With the exception of simple demos, it is not helpful to use globals
for controller constructors. This adds a new method to `$controllerProvider`
to re-enable the old behavior, but disables this feature by default.

BREAKING CHANGE:
`$controller` will no longer look for controllers on `window`.
The old behavior of looking on `window` for controllers was originally intended
for use in examples, demos, and toy apps. We found that allowing global controller
functions encouraged poor practices, so we resolved to disable this behavior by
default.

To migrate, register your controllers with modules rather than exposing them
as globals:

Before:

```javascript
function MyController() {
  // ...
}
```

After:

```javascript
angular.module('myApp', []).controller('MyController', [function() {
  // ...
}]);
```

Although it's not recommended, you can re-enable the old behavior like this:

```javascript
angular.module('myModule').config(['$controllerProvider', function($controllerProvider) {
  // this option might be handy for migrating old apps, but please don't use it
  // in new ones!
  $controllerProvider.allowGlobals();
}]);
```
2014-07-08 02:00:21 -07:00
Brian Ford
d5305d5652 docs(select): update example to use a module 2014-07-08 02:00:21 -07:00
Brian Ford
a5f6a92c8c docs(linky): update example to use a module 2014-07-08 02:00:20 -07:00
Brian Ford
282ed94cf9 docs(angular.copy): update example to use a module 2014-07-08 02:00:20 -07:00
Brian Ford
7279452898 docs($sanitize): update example to use a module 2014-07-08 02:00:20 -07:00
Brian Ford
c0360890c5 docs($cookies): update examples to use modules 2014-07-08 02:00:19 -07:00
Brian Ford
dba8b7e958 docs($sce): update example to use array annotations 2014-07-08 02:00:19 -07:00
Brian Ford
b3da9467af docs(orderBy): update examples to use modules 2014-07-08 02:00:19 -07:00
Brian Ford
e89916cf0a docs(limitTo): update example to use a module 2014-07-08 02:00:19 -07:00
Brian Ford
ba2f606143 docs(ngTransclude): update example to use a module 2014-07-08 02:00:19 -07:00
Brian Ford
95c2738244 docs($log): update example to use a module 2014-07-08 02:00:19 -07:00
Brian Ford
e83c5ba68e docs(ngPluralize): update example to use a module 2014-07-08 02:00:19 -07:00
Brian Ford
474251928e docs(ngSwitch): update example to use a module 2014-07-08 02:00:19 -07:00
Brian Ford
aecdd9d630 docs(ngInit): update example to use a module 2014-07-08 02:00:18 -07:00
Brian Ford
1534529f8c docs(ngModelOptions): update examples to use modules 2014-07-08 02:00:18 -07:00
Brian Ford
0a1042535e docs(ngValue): update example to use a module 2014-07-08 02:00:18 -07:00
Brian Ford
39c7c909fb docs(ngList): update example to use a module 2014-07-08 02:00:18 -07:00
Brian Ford
d28a0bf49e docs(ngInclude): update example to use a module 2014-07-08 02:00:18 -07:00
Brian Ford
d35f50ee11 docs($interval): update example to use a module 2014-07-08 02:00:18 -07:00
Brian Ford
74014f57ed docs(filters): update examples to use modules 2014-07-08 02:00:18 -07:00
Brian Ford
0cddc5c7b4 docs(ngController): update examples to use modules 2014-07-08 02:00:18 -07:00
Brian Ford
f3567b257c docs($window): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
84dc989cf0 docs(ngSubmit): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
1bce5bb3bb docs(ngBind): update examples to use modules 2014-07-08 02:00:17 -07:00
Brian Ford
28310583a9 docs($http): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
7ccab812fd docs($document): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
e293975b1a docs(ngChange): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
86889b3b3c docs(ngModel): update examples to use modules 2014-07-08 02:00:17 -07:00
Brian Ford
b9faec0673 docs(formDirective): update example to use a module 2014-07-08 02:00:17 -07:00
Brian Ford
e1f3c0cce8 docs($compile): update example to use a module 2014-07-08 02:00:16 -07:00
Brian Ford
59c090127f docs($anchorScroll): update example to use a module 2014-07-08 02:00:11 -07:00
Shahar Talmi
a88c215f17 fix(input): escape forward slash in email regexp
This messed up with syntax coloring and variable hovering in chrome developer tools and made debugging really difficult.

Closes #8096
2014-07-07 16:26:00 -04:00
Julie Ralph
9b3961ce09 chore(tests): increase timeout for navigation in ng-href tests to avoid timeouts
Previously, the timeout for ng-href tests waiting for the url change after a link
was clicked was only 1000 ms. This was causing some flaky timeouts, so increasing
the wait to 5000 ms.
2014-07-07 11:21:07 -07:00
Kevin Brogan
af6f943a22 fix(input): modify email validation regexp to match rfc1035
Previously, domain parts which began with or ended with a dash, would be accepted as valid. This CL matches Angular's email validation with that of Chromium and Firefox.

Closes #6026
2014-07-07 13:48:42 -04:00
Caitlin Potter
cb42766a14 fix(parseKeyValue): ignore properties in prototype chain.
Previously, properties (typically functions) in the prototype chain (Object.prototype) would shadow
query parameters, and cause them to be serialized incorrectly.

This CL guards against this by using hasOwnProperty() to ensure that only own properties are a concern.

Closes #8070
Fixes #8068
2014-07-03 20:44:36 -04:00
Shahar Talmi
f3cb274116 fix(ngModel): test & update correct model when running $validate
If `$validate` is invoked when the model is already invalid, `$validate`
should pass `$$invalidModelValue` to the validators, not `$modelValue`.

Moreover, if `$validate` is invoked and it is found that the invalid model
has become valid, this previously invalid model should be assigned to
`$modelValue`.

Lastly, if `$validate` is invoked and it is found that the model has
become invalid, the previously valid model should be assigned to
`$$invalidModelValue`.

Closes #7836
Closes #7837
2014-07-03 22:07:37 +01:00
Peter Bacon Darwin
1a9cb0a258 docs($httpProvider): revert removal of comments
Related to #7782
2014-07-03 13:29:03 +01:00
Cory Boyd
6775972461 docs($httpProvider): add missing documentation
Add documentation for $httpProvider default values

Closes #7782
2014-07-03 13:25:25 +01:00
Mike Haas
543cf1803b docs($compile): fix minor typo
Closes #8048
2014-07-03 09:50:41 +01:00
Peter Bacon Darwin
2f34950176 docs($logProvider): debugEnabled is a method not a property
Closes #7824
2014-07-03 09:45:03 +01:00
Peter Bacon Darwin
39915836e0 docs($sce): fix code samples and example
The code samples were using `<pre>` tags rather than code fences (```) so they were
not being displayed correctly.

The inline code example (defined by a `<example>` element) had been placed in an
`@example` jsdoc tag, so rather than appearing inline at the declaration point in
the text, they were being appended to the end of the document in the `Example` section.

Closes #8053
2014-07-03 07:05:07 +01:00
Julie Ralph
63e89524f0 chore(e2e): update protractor to 1.0.0-rc2 and add more logging
Use the new options from the reporter to add more logging to end to end tests,
and increase the Jasmine test timeout from 30 seconds to 60 seconds to allow for
legitimately long-lasting tests.
2014-07-02 15:44:12 -07:00
Caitlin Potter
c90cefe161 feat(input): support constant expressions for ngTrueValue/ngFalseValue
ngTrueValue and ngFalseValue now support parsed expressions which the parser determines to be constant values.

BREAKING CHANGE:

Previously, these attributes would always be treated as strings. However, they are now parsed as
expressions, and will throw if an expression is non-constant.

To convert non-constant strings into constant expressions, simply wrap them in an extra pair of quotes, like so:

    <input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">

Closes #8041
Closes #5346
Closes #1199
2014-07-02 18:07:37 -04:00
jpsimons
894c7da2f3 docs($location): update $location.search() jsdoc signature
Closes #8050
2014-07-02 13:54:12 -07:00
Matias Niemelä
f07af61f05 fix($animate): ensure that parallel class-based animations are all eventually closed
When multiple classes are added/removed in parallel then $animate only closes off the
last animation when the fallback timer has expired. Now all animations are closed off.

Fixes #7766
2014-07-02 02:32:27 +03:00
Jason Bedard
b0ca5195e8 perf($compile): no longer need nodeType filter when setting $scope data
Closes #7887
2014-07-01 15:55:34 -07:00