9074 Commits

Author SHA1 Message Date
Jason Bedard de0aad8984 fix(ngRepeat): fix reference to last collection value remaining across linkages
Ref #16776
2018-12-05 19:40:01 -08:00
Jason Bedard 3ea8c2b880 fix(ngRepeat): fix trackBy function being invoked with incorrect scope
Also fixes a leak of that scope across all further instances of the
repeated element.

Fixes #16776
Closes #16777
2018-12-05 19:40:01 -08:00
Joseph Jacobs a0c4e25a01 docs(tutorial/step_3): clarify how components are mapped to HTML elements
Closes #16768
2018-12-05 18:56:08 +02:00
Anthony X fa8fe1f739 docs(tutorial/step_6): fix experiment description
In the experiments section, it is suggested to add a `-` symbol to
`<option value="age">Oldest</option>`. This change is made to reverse
the sort order when selecting the `age` option.

However, this change affects the default `$ctrl.orderProp` that we had
set in `phone-list.component.js`. After making the change, our default
when refreshing the page is "Sort by: [blank]".

This commit adds some additional documentation to clarify that this
behavior makes sense and that the reader should try and fix this within
`phone-list.component.js`.

Closes #16781
2018-12-05 17:20:09 +02:00
Martin Staffa 0637a2124c perf(input): prevent multiple validations on initialization
This commit updates in-built validators with observers to prevent
multiple calls to $validate that could happen on initial linking of the directives in
certain circumstances:

- when an input is wrapped in a transclude: element directive (e.g. ngRepeat),
the order of execution between ngModel and the input / validation directives changes so that
the initial observer call happens when ngModel has already been initalized,
leading to another call to $validate, which calls *all* defined validators again.
Without ngRepeat, ngModel hasn't been initialized yet, and $validate does not call the validators.

When using validators with scope expressions, the expression value is not available when
ngModel first runs the validators (e.g. ngMinlength="myMinlength"). Only in the first call to
the observer does the value become available, making a call to $validate a necessity.

This commit solves the first problem by storing the validation attribute value so we can compare
the current value and the observed value - which will be the same after compilation.

The second problem is solved by parsing the validation expression once in the link function,
so the value is available when ngModel first validates.

Closes #14691 
Closes #16760
2018-12-05 14:06:43 +01:00
Martin Staffa d855b74095 chore(Saucelabs): increase max session duration
We have amassed so many e2e tests, that the default 30 minute
Saucelabs session limit is often not enough, especially during
the week, when the VMs are under heavy load.
2018-12-05 08:30:40 +01:00
Eirik Blakstad 0cdff42737 fix(aria/ngClick): check if element is contenteditable before blocking spacebar
`ngAria`'s `ngClick` blocks spacebar keypresses on non-blacklisted
elements, which is an issue when the element is `contenteditable`.

Closes #16762
2018-12-02 13:15:39 +02:00
Martin Staffa a5a98d36c0 chore(travis): put unit module tests into separate job
They take a lot of time since we created different karma jobs for them
2018-11-23 14:06:30 +01:00
Martin Staffa 15d4dd3cca chore(saucelabs): always test 2 latest Safari versions
Safari 10 does not finish the tests, but Safari 11 and 12 do
2018-11-23 14:06:30 +01:00
Martin Staffa ab36c4b487 revert: fix(Angular): add workaround for Safari / Webdriver problem
This reverts commit 6b915ad9db.
Karma has this workaround built in since 3.1.0:
https://github.com/karma-runner/karma/commit/873e4f9
2018-11-23 14:06:30 +01:00
Martin Staffa e77a74472a chore(*): update karma
This allows us to remove the workaround added in #16645
2018-11-23 14:06:30 +01:00
Jason Bedard 4a3ae43407 fix($browser): normalize inputted URLs
Calls to `$browser.url` now normalize the inputted URL ensuring multiple
calls only differing in formatting do not force a browser `pushState`.

Normalization is done the same as the browser location URL and may
differ per browser and may be changed by browsers. Today no browsers
fully normalize URLs so this does not fix all instances of this issue.

See #16100
Closes #16606
2018-11-21 15:08:42 -08:00
Jason Bedard dc90cbf6db test($browser): update MockWindow to normalize URLs similar to real window.location 2018-11-21 15:08:42 -08:00
Pete Bacon Darwin 622d32e805 fix(interpolate): do not create directives for constant media URL attributes
By creating attribute directives that watch the value of
media url attributes (e.g. `img[src]`) we caused a conflict
when both `src` and `data-src` were appearing on the
same element. As each directive was trying to write to the
attributes on the element, where AngularJS treats `src` and
`data-src` as synonymous.

This commit ensures that we do not create create such directives
when the media url attribute is a constant (no interpolation).

Because of this (and because we no longer sanitize URLs in the
`$attr.$set()` method, this commit also updates `ngHref` and
`ngSrc` to do a preliminary sanitization of URLs in case there
is no interpolation in the attribute value.

Fixes #16734
2018-11-20 14:10:03 +00:00
Volker Braun 2dfb6b4af6 fix($q): allow third-party promise libraries
For testing, it can be useful to overwrite `$q` with other promise
implementions, such as Bluebird + angular-bluebird-promises. This broke
in v1.6.x with "TypeError: Cannot set property 'pur' of undefined".

Closes #16164

Closes #16471
2018-11-15 17:37:38 +02:00
Alejandro López 318e6ceea3 test(e2e): replace the deprecated browser.getLocationAbsUrl() with browser.getCurrentUrl()
According to angular/protractor#3969, `browser.getLocationAbsUrl()` is
now deprecated and `browser.getCurrentUrl()` should be used instead.

Closes #16053
2018-11-15 17:13:18 +02:00
George Kalpakas 4f2b2b61c5 docs(tutorial): mention that Protractor might need upgrading
Since Protractor requires specific WebDriver versions and these are only
compatible with specific browser version ranges, it is often necessary
to upgrade Protractor just so that it picks up a more recent WebDriver
version.
Related: #16739

Closes #16753
2018-11-15 16:45:11 +02:00
George Kalpakas 67263f2bd0 docs(tutorial): explain how to upgrade dependencies
Related: angular/angular-seed#439
2018-11-15 16:45:09 +02:00
George Kalpakas a48c47fec0 docs(tutorial): replace getLocationAbsUrl() with getCurrentUrl()
Protractor's `browser.getLocationAbsUrl()` has been deprecated and
`browser.getCurrentUrl()` is the recommended alternative.
Related: angular/angular-phonecat#430
2018-11-15 16:45:08 +02:00
George Kalpakas b77f058505 docs(tutorial): switch from bower to npm and upgrade AngularJS to 1.7.x
Related: angular/angular-phonecat#430
2018-11-15 16:45:07 +02:00
George Kalpakas 1a14b58c6e docs(tutotial): switch all links to https 2018-11-15 16:44:59 +02:00
teresy 362dd1786f refactor(production): remove duplicate expression
Remove a duplicate expression (the left and right sides both check `versionInfo.currentVersion.version`). [48f0957](https://github.com/angular/angular.js/blob/48f0957dde728b050e2d8f76db81cbf12cffd42a/docs/config/services/deployments/production.js#L18) is the most recent commit I found where these expressions differ. My best guess is the duplicated expression can be removed.

Closes #16738
2018-11-15 15:10:53 +02:00
George Kalpakas 736e299ef3 test(ngOn*): add tests for binding to camelCased event names
Closes #16757
2018-11-12 13:15:57 +02:00
George Kalpakas 06d154f91c test($compile): fix incorrect markup in tests 2018-11-12 13:15:51 +02:00
George Kalpakas ba4d903586 chore(i18n): fix UCD extraction for Node 10.x
Previously (e.g. Node.js 8.x), the 3rd argument to `fs.writeFile()`
(i.e. the callback) could be undefined. On Node.js 10.x, this throws an
error.

This commit fixes it by switching to `fs.writeFileSync()` which seems to
have been the original intention (based on the sorrounding code).
2018-11-12 13:15:51 +02:00
George Kalpakas 7240f31824 chore(docs): fix rendering of methods' this type 2018-11-12 13:15:51 +02:00
George Kalpakas c3f6123de9 chore(package): fix scripts for Node 10.x on Windows 2018-11-12 13:15:51 +02:00
Daniel Breen 4e372d9314 docs(guide/migration): fix typos, change 'ctrk' to 'ctrl'
Closes #16754
2018-11-02 19:34:55 +02:00
Daniel Breen 3df4ee421c docs(changelog): fix typos, change 'ctrk' to 'ctrl' 2018-11-02 19:34:45 +02:00
Pete Bacon Darwin 258713a77d chore(package): update protractor & webdriver dependencies 2018-10-31 11:19:54 -07:00
Jason Bedard 6e3bbfc744 fix(input): prevent browsers from autofilling hidden inputs
Autofilling with previous values (which will then be `$interpolate`ed) could lead to XSS or errors
2018-10-31 11:19:54 -07:00
Hallstein Brøtan 09751be9bc docs(guide/Developer Guide): correct broken link
The blog post "Creating multilingual support using AngularJS" has moved. Corrected the URL.

Closes #16746
2018-10-29 10:56:32 +02:00
Michał Gołębiowski-Owczarek b4e409bf6c fix(urlUtils): make IPv6 URL's hostname wrapped in square brackets in IE/Edge
IE 9-11 and Edge 16-17 (fixed in 18 Preview) incorrectly don't wrap IPv6
addresses' hostnames in square brackets when parsed out of an anchor element.

Fixes #16692
Closes #16715
2018-10-18 11:45:09 +02:00
George Kalpakas 3e380325d8 fix(ngAnimateSwap): make it compatible with ngIf on the same element
Previously, both `ngAnimateSwap` and `ngIf` had a priority of 600, which
meant that (while both are [terminal directives][1]) they were executed
on top of each other (essentially messing each other's comment node).

This commit fixes it, by giving `ngAnimateSwap` a priority of 550, which
is lower than `ngIf` but still higher than other directives.

For reference, here is a list of built-in directive per priority:

```
-400: ngInclude, ngView
  -1: ngRef
   1: ngMessage, ngMessageDefault, ngMessageExp, ngModel, select
  10: ngModelOptions
  99: ngHref, ngSrc, ngSrcset
 100: attr interpolation, ngChecked, ngDisabled, ngList, ngMax,
      ngMaxlength, ngMin, ngMinlength, ngModel (aria), ngMultiple,
      ngOpen, ngPattern, ngProp*, ngReadonly, ngRequired, ngSelected,
      ngStep, ngValue, option
 400: ngInclude, ngView
 450: ngInit
 500: ngController
 600: ngAnimateSwap, ngIf
1000: ngNonBindable, ngRepeat
1200: ngSwitchDefault, ngSwitchWhen
```

[1]: https://docs.angularjs.org/api/ng/service/$compile#-terminal-

Fixes #16616

Closes #16729
2018-10-15 23:18:59 +03:00
George Kalpakas fd28edfc50 refactor(ngAnimateSwap): remove unnecessary inject() from tests 2018-10-15 23:18:47 +03:00
Martin Staffa 393072081c test(modules): properly isolate module tests
Closes #16712
2018-10-15 15:10:10 +02:00
Martin Staffa 52ad819d2f docs(ngMock/ngMockE2E.$httpBackend): fix method name to matchLatestDefinitionEnabled
See #16702
2018-10-15 13:14:36 +02:00
Martin Staffa d86f6be57b fix(ngMock): make matchLatestDefinitionEnabled work
Fixes #16702
2018-10-15 13:14:36 +02:00
Michał Gołębiowski-Owczarek 100cf7245e chore(*): update Sauce Connect from 4.4.12 to 4.5.1
Sauce Connect 4.5.0 fixes "a major bug in connection state logic that caused
clients to exit prematurely".
See https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy+Change+Logs
This will possibly improve the stability of our test runs.

Closes #16730
2018-10-15 11:05:14 +02:00
Michał Gołębiowski-Owczarek 0a5e58dacb chore(*): update minimum Yarn version, do some Yarn-related cleanups
Included changes:

*Update minimum Yarn version from 1.3.2 to 1.10.1*

Yarn 1.10 added the integrity field to the lockfile, making newer Yarn users
have their lockfile changed a lot if they run `yarn`. This commit updates the
required Yarn version to be at least 1.10.1 and changes Travis & Jenkins to use
Yarn 1.10.1

*Change the package.json's engines grunt field to grunt-cli*

The grunt field suggested it's the grunt package version we're checking while
we check the grunt-cli version instead.

*Stop separating Yarn script arguments from script names via " -- "*

The " -- " separator is necessary in npm but not in Yarn. In fact, it's
deprecated in Yarn and some future version is supposed to start passing this
parameter directly to the scripts which may break them.

*Don't install grunt-cli globally during the build*

It's enough to use `yarn grunt` instead of `grunt` and the global grunt-cli
installation is no longer needed.

*Use `yarn grunt` instead of `yarn run grunt`*

The former form is shorter.

*Don't define the `grunt` Yarn script*

As opposed to npm, `yarn binName` invokes a binary named `binName` exposed
by the respective package so the `grant` Yarn script is no longer needed.

*Allow Node versions newer than 8; bump the minimum*

Closes #16714
2018-10-11 16:35:57 +02:00
itchyny bb5a7e39ba fix(ngStyle): skip setting empty value when new style has the property
Previously, all the properties in oldStyles are set to empty value once.
Using AngularJS with jQuery 3.3.1, this disables the CSS transition as
reported in jquery/jquery#4185.

Closes #16709
2018-10-04 16:46:41 +02:00
Pete Bacon Darwin 33f801e7c2 docs(changelog): add 1.7.5 release notes 2018-10-04 15:23:34 +01:00
George Kalpakas 26ddc5f830 fix(ngClass): do not break on invalid values
Previously, when an `ngClass` expression evaluated to something that was
not a string, array or object (and was truthy), an error would be thrown
while trying to call `.split()` on a non-string value. This error was
not very helpful for the user to identify the root cause of the problem.

This commit fixes it by ensuring such values are converted to string.

Fixes #16697

Closes #16699
2018-09-20 12:02:19 +03:00
Sibiraj eb0ccc625f docs(*): update LTS information in README.md and docs landing page
Closes #16688
2018-09-10 20:58:41 +03:00
Pete Bacon Darwin e25f84296f docs(changelog): add 1.7.4 release notes 2018-09-07 09:59:03 +01:00
Martin Staffa 8082d5eae0 fix(ngAria.ngClick): preventDefault on space/enter only on non-interactive elements
Fixes #16664
Closes #16680
2018-09-06 15:53:33 +02:00
Michał Gołębiowski-Owczarek c42cadd4ed docs(version-support-status): remove outdated info, resolve inconsistencies
Closes #16684
2018-09-06 10:11:33 +02:00
Martin Staffa 44cc823092 fix(ngAnimate): remove prepare classes with multiple structural animations
Closes #16681
Closes #16677
2018-09-06 09:47:12 +02:00
Craig Johnson f010d6c00f docs(guide): grammar correction in security guide
Closes #16683
2018-09-05 19:34:58 +02:00
George Kalpakas a5537359c5 refactor(ngMocks): simplify routeToRegExp by assuming path has query/hash stripped off
Closes #16672
2018-08-25 23:38:51 +03:00