Commit Graph

7671 Commits

Author SHA1 Message Date
Martin Staffa a479e6543e docs(guide/accessibility): make jshint happy 2016-04-08 18:55:06 +02:00
Jason Bedard b89c2181a9 fix($compile): move check for interpolation of on-event attributes to compile time
This makes the two interpolation errors consistent and avoids checking the same thing per link
(which previously would log the same error per link).
The test changes are not necessary but do make them stricter and more like the selmulti error tests.

Closes #13267

BREAKING CHANGE:

Using interpolation in any on* event attributes (e.g. `<button onclick="{{myVar}}">`) will now throw
the "nodomevents" error at compile time.
Previously the nodomevents was thrown at link time. The new behavior makes it consistent with
the "selmulti" error.
The breaking change should be rare, as it relates to incorrect API use that should not make it to
production apps in the first place.
2016-04-08 18:38:14 +02:00
Pablo Iván G. Soto 6b57198cb4 docs(README): add https links, improve style 2016-04-08 18:21:35 +02:00
mohamed amr 9978de11b7 fix(ngAria): don't add roles to native control elements
prevent ngAria from attaching roles to textarea, button, select, summary, details, a, and input

Closes  #14076
Closes #14145

BREAKING CHANGE:

ngAria will no longer add the "role" attribute to native control elements
(textarea, button, select, summary, details, a, and input). Previously, "role" was not added to
input, but all others in the list.

This should not affect accessibility, because native inputs are accessible by default, but it might
affect applications that relied on the "role" attribute being present (e.g. for styling or as
directive attributes).
2016-04-08 17:41:58 +02:00
Martin Staffa d449ec83a6 docs(guide/Accessibility): fix markdown errors, tweak layout 2016-04-08 17:29:26 +02:00
mohamed amr ae0a716000 feat(ngAria): add support for aria-readonly based on ngReadonly
Closes #14140
Closes #14077
2016-04-08 17:28:24 +02:00
Martin Staffa eee2ef6e9d docs(ngComponentRouter): add note about shims needed for IE 2016-04-08 15:55:59 +02:00
Josh 0cbe7fbfc4 docs(ngComponentRouter): fix typo
Simple typo fix from `betweent he` to `between the`

Closes #14396
2016-04-08 15:45:33 +02:00
Martin Staffa f8e6a4bcba fix(ngAnimate): remove event listeners only after all listeners have been called
The fix for removing the event callbacks on destroy introduced in
ce7f400011 removed the events too early, so that the event callbacks
for the "close" phase in "leave" animations were not called.

This commit fixes the behavior so that the event callbacks are only removed during on('$destroy')
when no animation is currently active on the element. When an animation is active, the event callbacks
will be removed after all callbacks have run, and if the element has no parent (has been removed from
the DOM).

Closes #14321
2016-04-08 15:03:11 +02:00
Martin Staffa ea4120bf35 feat(ngAnimate): let $animate.off() remove all listeners for an element 2016-04-08 15:03:10 +02:00
Andrew c75fb80333 docs(guide/Components): fix small single letter typo
line 136: 'not' should be 'note'

Closes #14390
2016-04-08 01:31:26 +02:00
Martin Staffa 2b327f01be fix(ngAnimate): fire callbacks when document is hidden
Since commit a3a7afd3aa, animations are not run
when the document is hidden (only their structural or class change effects are executed).
However, some libraries rely on the $animate.on() callbacks to be called even when no actual animation
runs.
This commit restores the behavior for the ngAnimate.$animate functions.
Note that callbacks still won't be called if animations are disabled, because this would be be a potential
breaking change, as some applications might rely on this implementation.

Fixes #14120
2016-04-08 01:08:58 +02:00
Martin Staffa 19eca35c72 test(ngAnimate): test calling callbacks for various constellations 2016-04-08 01:08:56 +02:00
Martin Staffa eb2126a388 fix(ngAnimate): fire callbacks in the correct order for certain skipped animations 2016-04-08 01:08:51 +02:00
SHAHRUKH-KHAN 796c11116d docs(angular.equals): add example
This Pull requests improves the doc by adding a example to `angular.equals` function.

Closes #14232
2016-04-07 15:13:24 +02:00
glenr4 6df103591e docs(ngAnimate): fix toggle button in example
The toggle button code on line 153 only sets bool to true, rather than toggling it.
The proposed change fixes this.

Closes #14387
2016-04-07 14:10:58 +02:00
andykuszyk 441be9a102 docs(misc/Getting Started): fix markdown for headings
Closes #14353
2016-04-07 14:10:58 +02:00
Maciej Kołodziejczak 2d414fbaee docs(ngComponentRouter): fix a typo
Closes #14357
2016-04-07 14:10:58 +02:00
Andrew f056f5d1c5 docs(guide/Components): clarify output events with extra example and note
Add additional line from example which demonstrates using the snake cased attribute binding in
parent component template.
Add note clarifying camelCase to snake-case requirement to use the Output binding callback feature.

Closes #14365
2016-04-07 14:10:58 +02:00
Artur d076a9b217 docs(guide/Components): fix typo, improve style
Closes #14384
2016-04-07 14:10:58 +02:00
Robin Janssens fd0b1ebfc7 docs($httpBackend): update response data types
Updated docs to reflect that response data can either be an array, object _or_ a string
Technically, response data can be anything that can be handled by angular.copy,
but since string and JSON data is most commonly mocked, the main types are sufficient.

Closes #14346
2016-04-07 14:10:58 +02:00
Michał Gołębiowski 038d990bc1 fix(travis): Don't run e2e tests with jQuery twice
The e2e tests were set up to be run twice; once with the latest supported
jQuery and once with jQuery 2.1. However, the latest jQuery was used in both
cases. The initial plan was to just run integration tests with the latest
jQuery and leave regression testing for jQuery 2.1 to unit tests as they're
way faster. This commit removes the jQuery 2.1 e2e tests entry.
2016-04-06 20:58:03 +02:00
Michał Gołębiowski ddad26402b refactor(jshint): don't assume browser-only globals
Fixes #13442
Closes #14345
2016-04-06 20:35:49 +02:00
Peter Bacon Darwin fad6c7c661 docs(componentRouter): add custom installation instructions 2016-04-05 21:07:50 +01:00
Peter Bacon Darwin 4b2bc60e43 feat($compile): put custom annotations on DDO
Closes #14369
Closes #14279
Closes #14284
2016-04-04 20:05:28 +01:00
Peter Bacon Darwin d27954575f fix($compile): don't throw if controller is named 2016-04-04 15:27:09 +01:00
Peter Bacon Darwin b54634d37b fix($compile): ensure that $onChanges hook is called correctly
Due to the way that we instantiate controllers, the `$onChanges` hook
was not always available at the time we were trying to trigger the initial
call to this hook. For instance, if the hook was actually defined inside
the constructor function.

This commit fixes that but also fixes the fact that the initial call was
being made in the postDigest anyway, which was incorrect because the
it should have been made before the `$onInit` call.

Closes #14355
Closes #14359
2016-04-01 17:41:07 +01:00
Georgios Kalpakas fa79eaa816 test($browser): fix typo in property name (histroy --> history)
(The semantics of the test aren't affected, because we just needed a falsy value.)
2016-03-31 13:25:46 +03:00
Michał Gołębiowski 1964620e95 chore(*): Remove duplicate globals in .jshintrc files 2016-03-30 13:57:36 +02:00
Martin Staffa 3b05c484af fix(ngOptions): set select value when model matches disabled option
When ngModel is set to a value that matches a disabled option, ngOptions will now select the option
in the select element, which will set select.val() to the option hash value and visually
show the option value / label as selected in the select box. Previously, disabled
options forced the unknown value.
The previous behavior is inconsistent with both default HTML behavior and select with
ngModel but without ngOptions. Both allow disabled values to be selected programmatically.

A common use case for this behavior is an option that was previously valid, but has
been disabled, and cannot be selected again.

This commit removes a duplicate test, and all other tests that previously checked that disabled
options are not set have been adjusted to the ensure the opposite.

Fixes #12756
2016-03-29 20:35:48 +02:00
Lucas Mirelmann 71cf28cf06 refactor(ngResource): handle success and error callbacks using the same promise 2016-03-27 15:07:56 +02:00
Lucas Mirelmann c9dffde1cb feat($q): report promises with non rejection callback
Rejected promises that do not have a callback to handle the rejection report
this to $exceptionHandler so they can be logged to the console.

BREAKING CHANGE

Unhandled rejected promises will be logged to $exceptionHandler.

Tests that depend on specific order or number of messages in $exceptionHandler
will need to handle rejected promises report.

Closes: #13653
Closes: #7992
2016-03-27 15:07:37 +02:00
cscport 0ece2d5e0b docs(angular.bootstrap): fix capitalization in error message
Closes #14325
2016-03-27 15:42:47 +03:00
Lucas Mirelmann 3968a8f8cc docs(ngParseExt): Fix package name 2016-03-26 23:59:38 +01:00
Peter Bacon Darwin a6a4b23517 feat($compile): add isFirstChange() method to onChanges object
Closes #14318
Closes #14323
2016-03-26 20:05:07 +00:00
Lucas Mirelmann bd0915c400 feat(ngParseExt): New ngParseExt module
New ngParseExt module

Including this module into an application will extend $parse to allow identifiers
following ES6 identifiers
2016-03-26 20:39:19 +01:00
Lucas Mirelmann ad298947a0 feat($parse): Add the ability to define the identifier characters
Add the ability to define the identifier starts and identifier continue characters
2016-03-26 20:39:08 +01:00
Lucas Mirelmann fadea2c81f chore(bower): Add parse-ext repository 2016-03-26 20:36:36 +01:00
thorn0 5ceb5dbfa6 perf(injector): cache the results of the native class detection check
Closes: #14322
2016-03-26 16:01:43 +01:00
Lucas Mirelmann bd7d5f6345 perf($parse): Inline constants
Inline constants definitions in function calls, array definitions
and object values.

For the expression [1, {foo: "bar"}, 1 + 2] it changes it from

```js
// After some reordering and cleanup
var v1 = 1;
var v2 = "bar";
var v3 = {foo: v2};
var v4 = 1;
var v5 = 2;
var v6 = plus(v4, v5);
var v7 = [v1, v3, v6];
return v7;
```

to

```js
return [1, {foo: "bar"}, plus(1, 2)];
```

Expression parts that are not constants did not change, and still generate a lot
of intermediate variables.

Closes: #14293
2016-03-26 12:31:39 +01:00
Peter Bacon Darwin 3cd00fa3dd docs(CHANGELOG): add 1.5.3 release notes 2016-03-25 20:02:41 +00:00
Martin Staffa 90cb24e781 chore: add jshint eqeqeq for src/ files
Add jshint "eqeqeq" and "eqnull" rules (to allow == null comparisons).
Only adds it to files under src/, because we these files are unit-tested.
Files in src/ngLocale are excluded, because the code is imported.

Closes #14287
2016-03-25 14:44:12 +01:00
Martin Staffa 4487d4a8a4 fix: make files in src/ jshint: eqeqeq compatible
Add exceptions to the rule in input, ngAria, and parse.
For input and ngAria, the exception is to prevent a breaking change in the radio directive.
A test for the input behavior has been added.
For parse, the exception covers non-strict expression comparison.
2016-03-25 14:44:12 +01:00
Peter Bacon Darwin 874c0fdcdd feat($compile): add more lifecycle hooks to directive controllers
This change adds in the following new lifecycle hooks, which map in some
way to those in Angular 2:

 * `$onChanges(changesObj)` - Called whenever one-way bindings are updated. The `changesObj` is a hash whose keys
   are the names of the bound properties that have changed, and the values are an object of the form
   `{ currentValue: ..., previousValue: ... }`. Use this hook to trigger updates within a component such as
   cloning the bound value to prevent accidental mutation of the outer value.
 * `$onDestroy` - Called on a controller when its containing scope is destroyed. Use this hook for releasing
   external resources, watches and event handlers.
 * `$postLink` - Called after this controller's element and its children been linked. Similar to the post-link
   function this hook can be used to set up DOM event handlers and do direct DOM manipulation.
   Note that child elements that contain `templateUrl` directives will not have been compiled and linked since
   they are waiting for their template to load asynchronously and their own compilation and linking has been
   suspended until that occurs.

Closes #14127
Closes #14030
Closes #14020
Closes #13991
Closes #14302
2016-03-25 12:54:50 +00:00
Martin Staffa 7489d56687 docs(ngAnimate): fix anchoring example
Example must be updated for the default ngRoute hash prefix.

Closes #14312
2016-03-24 11:34:31 +01:00
Martin Staffa cc1de81f5e fix(ngAnimate): run structural animations with cancelled out class changes
When multiple animations on the same element are queued before a $digest passes,
the animator tries to create as few actual animations as possible by joining / canceling
redundant animations. Class-based animations for example are cancelled when the classes that
are added and removed are the same, and the result is no class-change. This however must only
happen if there's no structural animation currently queued.

Fixes #14249
2016-03-24 00:13:30 +01:00
Martin Staffa cbd048d893 fix(ngMessages): don't crash when nested messages are removed
Under specific circumstances, ngMessages would go into an infinite loop and crash the
browser / page:
- At least two ngMessage elements are wrapped inside another element (e.g. ngTransclude)
- The first message is currently visible
- The first message is removed (e.g. when the whole ngMessages element is removed by an ngIf)

When a message is removed, it looks for a previous message - in this specific case it would misidentify
the second message for a previous message, which would then cause the first message to be marked as the
second message's next message, resulting in an infinite loop, and crash.

This fix ensures that when searching for previous messages, ngMessage walks the DOM in a way so
that messages that come after the current message are never identified as previous messages.

This commit also detaches and destroys all child ngMessage elements when the ngMessages element is
destroyed, which should improve performance slightly.

Fixes #14183
Closes #14242
2016-03-24 00:13:30 +01:00
Alex Chuev 67784531c2 docs(guide/component): add missing closing bracket
Closes #14299
2016-03-23 23:57:08 +02:00
pmadruga f01d6f2788 docs(error/$compile.baddir): mention "components" in directive name error
Closes #14212
2016-03-23 21:57:28 +02:00
Daniel Herman e34ef23ab8 fix($compile): workaround a GC bug in Chrome < 50
In the version of V8 used in Chrome < 50, the parent of template nodes for
`transclude: "element"` directives would be improperly garbage collected
despite still having been referenced via `parentNode`.

This bug surfaced due to the introduction of lazy transclusion (652b83e),
and appears under certain circumstances when using directive start and end elements.

It should be removed some time after Chrome 50 has been released.

Fixes #14041
Closes #14286
2016-03-22 19:13:37 +01:00