Compare commits

..

3768 Commits

Author SHA1 Message Date
Mike Brocchi d8f77817eb chore: update post LTS links (#17187)
Co-authored-by: Mike Brocchi <brocco@users.noreply.github.com>
2024-04-12 11:43:13 -06:00
Jeremy Elbourn 47bf11ee94 docs(changelog): fix wrong date in changelog for 1.8.3 2022-04-12 08:48:22 -07:00
Jeremy Elbourn b5aa42586e docs(changelog): fix typo in changelog for 1.8.3 2022-04-11 13:26:36 -07:00
Jeremy Elbourn cf16b241e1 docs(changelog): add release notes for 1.8.3
We're doing this final release to update poackage README files for npm.
2022-04-07 09:13:37 -07:00
Jeremy Elbourn 757d56ea9c docs(*): update end-of-life messages (#17177)
* Docs homepage
* Docs banner
* Security and support pages
* GitHub README
* CHANGELOG
2022-03-18 12:04:55 -07:00
Ed Clement f3624374e4 docs(eol): add EOL options text and link to template header used in every page
Closes #17164
2021-12-10 01:00:31 +02:00
Ed Clement fb04e424bb test(Angular): fix angularInit() tests on Safari v15+
Previously, the `angularInit()` tests assumed that the Safari browser
uses the `safari-extension:` protocol for browser extension URLs. This
is true for versions <15. However, since v15, Safari on iOS only
recognizes the `chrome-extension:` protocol, which causes the tests to
fail ([example failure][1]).

This commit updates the tests to use the correct protocol according to
the version of Safari used.

NOTE:
On macOS, Safari v15+ recognizes both `safari-extension:` and
`chrome-extension:`, so it is OK to always use the later with Safari
v15+ (regardless of the platform).

[1]: https://circleci.com/gh/angular/angular.js/3527

Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>

Closes #17166
2021-12-09 22:20:18 +02:00
Ed Clement 6a52c4f90c test(input): fix tests on Firefox v93+
Since version 93, Firefox started more closely following the spec on
formatting `datetime-local` input values by removing trailing zeros from
the string representation of the value. This causes some of our tests to
fail ([example failure][1]).

For example, a value is reported by Firefox as `2009-01-06T16:25` while
the tests expect `2009-01-06T16:25:00.000`. I.e. Firefox started leaving
out seconds/milliseconds if they are zero.

According to [MDN][2], this is the correct behavior according to the
spec. Indeed the spec says that [if the value of the element is a valid
local date and time string, then it must be set to a **valid normalized
local date and time string**][3], where **valid normalized local date
and time string** is [defined as consisting of][4]:
> - A valid date string representing the date.
> - A U+0054 LATIN CAPITAL LETTER T character (T).
> - A valid time string representing the time, expressed as the
>   **shortest possible string** for the given time (e.g. **omitting the
>   seconds component** entirely if the given time is zero seconds past
>   the minute).

This commit fixes the relevant tests by explicitly specifying non-zero
values for seconds and milliseconds.

[1]: https://circleci.com/gh/angular/angular.js/3527
[2]: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats
  #local_date_and_time_strings
[3]: https://html.spec.whatwg.org/multipage/input.html
  #local-date-and-time-state-(type=datetime-local)
[4]: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html
  #concept-datetime-local

Co-authored-by: George Kalpakas <kalpakas.g@gmail.com>
2021-12-09 22:19:58 +02:00
Gage Guzman ed30c4d0ea docs(README.md): add wiki link to MVC
Add a wiki link to MVC in case people have not heard of it before and
want to read about it more.

Closes #17152
2021-08-24 11:24:46 +03:00
dependabot[bot] 4032655100 chore(deps): bump js-yaml from 3.5.5 to 3.14.1
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.5.5 to 3.14.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.5.5...3.14.1)

Closes #17147
2021-06-12 16:25:47 +03:00
dependabot[bot] 47f8c65aca chore(deps): bump normalize-url from 4.5.0 to 4.5.1
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

Closes #17145
2021-06-12 15:26:29 +03:00
Michael Prentice 56b0ee3275 chore(e2e): run tests against Chrome 91 on macOS Catalina
Closes #17144
2021-06-12 15:25:34 +03:00
Michael Prentice 58cd897420 chore(e2e): run tests against Firefox 85 on macOS Catalina
Closes #17142
2021-06-12 15:22:18 +03:00
Michael Prentice c3769a6b5b chore(functions): support NodeJS LTS v14. fix audit issues
- update firebase scripts
- from: 6 vulnerabilities found - Severity: 6 High
- to: 0 vulnerabilities found

Closes #17140
2021-06-07 20:02:55 +03:00
Michael Prentice c140d89583 chore(build): support NodeJS LTS v14. fix audit issues
- from:483 vulnerabilities found - 273 Low | 38 Moderate | 168 High | 4 Critical
- to: 389 vulnerabilities found - 259 Low | 28 Moderate | 98 High | 4 Critical

Closes #17139
2021-06-05 20:46:59 +03:00
Michael Prentice 1a5b0517d0 docs(misc/Version Support Status): update URL for XLTS.dev
- the subdomain was switched to a path many months ago
- the angularjs.xlts.dev site will soon be used for hosting something else
  and the redirect removed (ASAP)

Closes #17136
2021-06-01 16:23:10 +03:00
Ikko Ashimine e29900c78f docs($parse): fix typo in parse.js
Propogate -> Propagate
2021-04-22 09:49:07 +01:00
dependabot[bot] 02545a8bab chore(deps): bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17122
2021-03-31 19:45:19 +03:00
Ikko Ashimine 9bff2ce8fb docs($parse): fix typo in lval.ngdoc
assigment -> assignment

Closes #17120
2021-03-09 13:27:46 +02:00
dependabot[bot] d463206d0a chore(deps): bump elliptic from 6.5.3 to 6.5.4
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17119
2021-03-09 13:25:06 +02:00
dependabot[bot] ae8e903edf chore(deps): bump bl from 1.2.2 to 1.2.3
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17116
2021-02-06 21:31:35 +02:00
dependabot[bot] 89c7794b21 chore(deps): bump https-proxy-agent from 2.2.1 to 2.2.4
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17115
2021-02-06 21:30:54 +02:00
dependabot[bot] 8a941b8ea9 chore(deps): bump ini from 1.3.4 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.4 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.4...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17099
2021-02-06 21:30:11 +02:00
George Kalpakas 30a4424da2 chore(ci): only run deploy-code-firebase on master
Previously, the `deploy-code-firebase` CI job was run on any build
corresponding to a git tag, the master branch or the stable branch.
Given that all runs of `deploy-code-firebase` deploy to the same
Firebase project (and overwrites previous deployments), there is no
point in deploying from multiple branches/tags.

This commit fixes this by ensuring that we only run the
`deploy-code-firebase` job on builds for the master branch, which
contains the most up-to-date code/configuration.
2021-02-06 19:46:27 +02:00
George Kalpakas a6fa1ce76e chore(ci): fix failing deploy-code job
In #17114, the `deploy-code` CI job was modified to also run some
commands via `yarn`. It turns out that this breaks on CI, because the
`deploy-code` job uses the `cloud-sdk` executor that does not have
`yarn` installed. ([Example failure][1])

This commit fixes this by splitting the `deploy-code` job into two jobs:
- `deploy-code-files` uses the `cloud-sdk` and uploads the files to
  Google Cloud.
  (This is essentially the `deploy-code` job from before #17114.)
- `deploy-code-firebase` uses the `default` executor (which has `yarn`
  installed) and deploys to Firebase.
  (This essentially includes the new bits added in #17114.)

[1]: https://circleci.com/gh/angular/angular.js/2712
2021-02-06 13:42:28 +02:00
George Kalpakas 63d613fccf fix(code.angularjs.org): correctly re-construct paths on Windows in sendStoredFile()
Previously, the `sendStoredFile()` Firebase function used `.split('/')`
to split the request path into segments and later used `path.join()` to
join them back together. This worked fine on *nix based systems, which
use `/` as the path separator. On Windows, however, where `\` is the
path separator, the re-constructed paths could not be retrieved from the
Google Cloud Storage bucket. This prevented the Firebase emulators from
working correctly when testing the function locally on Windows.

This commit fixes the issue by using `.join('/')` to join the path
segments back together.

Closes #17114
2021-02-06 11:50:11 +02:00
George Kalpakas ed7d506b7d chore(build): update Firebase dependencies to latest versions
This commit updates `firebase-admin`, `firebase-functions` and
`firebase-tools` to latest versions to take advantage of the most recent
fixes and improvements.
2021-02-06 11:50:06 +02:00
George Kalpakas 12df4d6a00 chore(build): use Node.js v12 for Firebase functions on {code,docs}-angularjs-org 2021-02-06 11:50:06 +02:00
George Kalpakas 4267ad65a5 chore(ci): use default project from config when deploying to Firebase
Previously, when deploying `scripts/{code,docs}.angularjs.org-firebase/`
to Firebase, we explicitly specified the target projects. Since the
project IDs are also specified in the respective `.firebaserc` files,
this was unnecessary (and meant we had multiple places to update if the
IDs changed).

This commit simplifies the process by automatically targeting the
default projects (as configured in the `.firebaserc` files) when
deploying to Firebase in CI.
2021-02-06 11:50:06 +02:00
George Kalpakas 66ada20d1b chore(ci): also deploy code-angularjs-org to Firebase
Previously, we only deployed the built files to Google Cloud Storage for
the `code-angularjs-org` Firebase project. This meant that the other
Firebase services (such as functions, hosting, storage) were not updated
when we made changes to their source code or configuration.
(This isn't a problem at the moment, since the code/configuration for
these service changes infrequently, but could bite us in the future.)

This commit fixes this by ensuring that we deploy to all enabled
Firebase services (currently functions, hosting and storage).
2021-02-06 11:50:06 +02:00
George Kalpakas c7d68fa044 chore(ci): also deploy Firebase functions to docs-angularjs-org
Previously, we only deployed to Firebase hosting for the
`docs-angularjs-org` Firebase project. This meant that the deployed
functions used an old version of Node.js and started failing once
support was dropped for that version. See #17111 for details.

This commit fixes this by ensuring that we deploy to all enabled
Firebase services (currently functions and hosting).

Fixes #17111
Fixes angular/angularjs.org#251
2021-02-06 11:50:06 +02:00
George Kalpakas 667ff87ab5 chore(ci): deploy to docs.angularjs.org from within the corresponding directory
Previously, in order to deploy to Firebase from
`scripts/docs.angularjs.org-firebase/`, we had to copy the
`firebase.json` file to the repository root and adjust the contained
paths accordingly.

By running the `firebase` CLI directly (instead of via `yarn`), we are
able to deploy from `docs.angularjs.org-firebase/` directly. This
simplifies the deployment (and local testing) process and paves the way
for also deploying from `code.angularjs.org-firebase/` in a subsequent
commit.
2021-02-06 11:50:06 +02:00
George Kalpakas b481a16576 chore(ci): copy deployment files inside the respective Firebase directories
We have the `scripts/{code,docs}.angularjs.org-firebase/` directories,
which contain the necessary code and config for deploying built files to
the `code-angularjs-org` and `docs-angularjs-org` Firebase projects
respectively.

Previously, some of the files that needed to be deployed to Firebase (or
Google Cloud) were placed outside these directories (e.g. in
`deploy/{code,docs}/`).

Since these files are only used for deploying to Firebase/Google Cloud,
this commit changes the deployment process to instead copy the files
inside the directories. In a subsequent commit, this will allow
simplifying the deployment process, by running it from inside each
directory instead of having to copy the `firebase.json` files to the
repository root (and adjust the paths).

These are the destination directory changes:

| Before       | After                                       |
|--------------|---------------------------------------------|
| deploy/code/ | scripts/code.angularjs.org-firebase/deploy/ |
| deploy/docs/ | scripts/docs.angularjs.org-firebase/deploy/ |
2021-02-06 11:50:06 +02:00
George Kalpakas 6e052a4243 chore(code.angularjs.org): check in yarn.lock file (and remove package-lock.json)
Since we are using `yarn` to install dependencies, it makes sense to use
`yarn.lock` as the lockfile (and get rid of the unused
`package-lock.json`).
2021-02-06 11:50:05 +02:00
George Kalpakas 2e72ea13fa docs(changelog): fix typos in 1.8.1/1.8.2 notes
- Remove stray backtick.
- Add missing preposition (`identical` --> `identical to`).
- Remove 1.8.1 change from the 1.8.2 section.

Closes #17093
2020-10-25 11:42:13 +02:00
Pete Bacon Darwin 9b3b6f7f79 docs(changelog): add release notes for 1.8.2 2020-10-21 12:48:47 +01:00
George Kalpakas e41f018959 fix($sceDelegate): make resourceUrlWhitelist() is identical trustedResourceUrlList()
In commit a206e2675c, `$sceDelegateProvider`'s
`resourceUrlWhitelist()` was deprecated in favor of the new
`trustedResourceUrlList()`. However, although both properties were
assigned the same value, it was possible for an app to break if one of
the properties was overwritten in one part of the app (or a 3rd-party
library) while another part of the app interacts with the other,
non-overwritten property.

This commit fixes it by making `resourceUrlWhitelist()` a getter/setter
that delegates to `trustedResourceUrlList()`, ensuring that the two
properties will remain in sync. This, also, makes it consistent with
other similar deprecated properties, such as `$sceDelegateProvider`'s
`resourceUrlBlacklist()`.

Closes #17090
2020-10-14 15:44:24 +03:00
George Kalpakas 71d19f120a docs(*): fix docs on recently deprecated properties/methods
In commits 9679e58ec4e9d9e4b743..3dd42cea688a7b6f7789, some properties
and methods names including the terms whitelist/blacklist were
deprecated in favor of new ones not including the terms.

This commit fixes some typos in docs related to these changes and adds
links to the new properties/methods in the changelog for easier access.

Fixes #17088
2020-10-14 15:44:24 +03:00
frosty 8aa3389ed6 docs(version-support-status): add link to extended long term support 2020-10-08 19:16:57 +01:00
Pete Bacon Darwin bb480064b9 docs(changelog): add release notes for 1.8.1 2020-10-05 14:04:33 +01:00
George Kalpakas 6b86a888cb chore(CircleCI): fix deploy-docs job
Since #17039, our docs Firebase functions' `package.json` specifies a
`node` engine version. This is required for configuring which version of
Node.js should Firebase use to execute the functions. However, since
Firebase is using an older version of Node.js than the one we use to
build the AngularJS project, yarn would error due to incompatible
Node.js engine versions ([example failure][1]).

This commit avoids the error by running yarn with the `--ignore-engines`
option.

[1]: https://app.circleci.com/pipelines/github/angular/angular.js/214/
     workflows/ad2e9baf-7249-467d-bc71-bd98e6cd922c/jobs/2247
2020-10-01 02:15:59 +03:00
dependabot[bot] f17c7d8f66 chore(deps): bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17073
2020-10-01 00:54:33 +03:00
dependabot[bot] e7c105c592 chore(deps): bump node-fetch
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17072
2020-10-01 00:53:44 +03:00
dependabot[bot] d0e7dc14bb chore(deps): bump node-fetch
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17071
2020-10-01 00:52:21 +03:00
dependabot[bot] 0a746a2521 chore(deps): bump http-proxy from 1.16.2 to 1.18.1
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.16.2 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.16.2...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17070
2020-10-01 00:50:49 +03:00
Michael Prentice 2f73f6a8c0 chore(copyright): update to Google LLC
- fix minor typo in comment

Relates to angular/angular#27880

Closes #17062
2020-10-01 00:49:43 +03:00
George Kalpakas e1ecd184c5 chore(SauceLabs): update sauce-connect to version 4.6.2
Closes #17078
2020-10-01 00:47:23 +03:00
Martin Staffa abff650016 chore(ci): add engines to docs firebase deployment
According to the Firebase docs, this field is necessary: https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
It's also a good idea to set it because NodeJS 8 is end-of-life, and Firebase will require Node 10 for all functions by  March 15, 2021.
2020-09-30 19:41:06 +01:00
dependabot[bot] b96a1de842 chore(deps): bump is-my-json-valid from 2.15.0 to 2.20.5
Bumps [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) from 2.15.0 to 2.20.5.
- [Release notes](https://github.com/mafintosh/is-my-json-valid/releases)
- [Commits](https://github.com/mafintosh/is-my-json-valid/compare/v2.15.0...v2.20.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-30 19:35:46 +01:00
Michael Prentice b42ab51ad9 docs(security): add SECURITY.md 2020-09-30 19:34:45 +01:00
Joey Perrott 3dd42cea68 refactor(misc): remove usages of whitelist and blacklist
Remove miscellaneous usages and references to usages of whitelist and blacklist
throughout the repository.
2020-09-30 18:46:45 +01:00
Joey Perrott 767381020d refactor(SanitizeUriProvider): remove usages of whitelist
Changes aHrefSanitizationWhitelist to aHrefSanitizationTrustedUri and imgSrcSanitizationWhitelist
to imgSrcSanitizationTrustedUri updating references to use the new symbols.

For the purposes of backward compatibility, the previous symbols are aliased to
the new symbols.
2020-09-30 18:46:45 +01:00
Joey Perrott c953af6b8c refactor(httpProvider): remove usages of whitelist and blacklist
Changes xsrfWhitelistedOrigins to xsrfTrustedOrigins updating references to use
this new symbol.

For the purposes of backward compatibility, the previous symbol is aliased to
the new symbol.
2020-09-30 18:46:45 +01:00
Joey Perrott a206e2675c refactor(sceDelegateProvider): remove usages of whitelist and blacklist
Changes resourceUrlWhitelist to trustedResourceUrlList and resourceUrlBlacklist
to bannedResourceUrlList, updating references to use this new symbol.

For the purposes of backward compatibility, the previous symbols are aliased to
their new symbol.
2020-09-30 18:46:45 +01:00
George Kalpakas 9679e58ec4 chore(ci): correctly compute $DIST_TAG in the deploy-code CI job
Previously, the `DIST_TAG` environment variable was failing to be
computed correctly in the `deploy-code` CI job, because it relied on the
non-existent `node` executable. It worked with the default executor
(which includes `node`), but not with the `cloud-sdk` executor used in
`deploy-code`, resulting in the following error:

```sh
./.circleci/env.sh: line 59: node: command not found
DIST_TAG=
```

You can see an example failure in the "Set up environment" step logs in
https://app.circleci.com/pipelines/github/angular/angular.js/
170/workflows/32fcacf9-c89b-4020-b3eb-15debe18bb67/jobs/1793

This commit fixes it by computing `$DIST_TAG` using unix tools (`cat`,
`grep`, `sed`) that _are_ available on the docker images of all
executors.

Closes #17067
2020-08-22 22:03:58 +03:00
George Kalpakas 26e13e5797 chore(ci): fix docs deployment to Firebase (deploy-docs CI job)
Previously, the command used to deploy the docs to Firebase (as part of
the `deploy-docs` CI job) would fail, because no target project was
specified (either directly in the command or indirectly via a
`.firebaserc` file in the working directory).

Example failure:
https://app.circleci.com/pipelines/github/angular/angular.js/
166/workflows/34c692ec-18d4-4422-a1cf-108a91219fa5/jobs/1744

This commit fixes the command by specifying the project via the
`--project` cli argument. It also adds the commit SHA as message to make
it easier to associate a deployment with the corresponding commit.

Closes #17066
2020-08-22 18:50:06 +03:00
George Kalpakas 4428dd0c0f chore(ci): correctly compute the DIST_TAG environment variable
Previously, the `DIST_TAG` environment variable was failing to be
computed correctly, because it was using the non-existent `jq` tool. In
the past (when running on TravisCI), `jq` used to be available, but it
is not on the currently used CircleCI docker image, resulting in the
following error:

```sh
./.circleci/env.sh: line 59: jq: command not found
DIST_TAG=
```

You can see an example failure in the "Set up environment" step logs in
https://app.circleci.com/pipelines/github/angular/angular.js/
166/workflows/34c692ec-18d4-4422-a1cf-108a91219fa5/jobs/1742

This commit fixes it by using `node` (which _is_ available on the docker
image) to compute `$DIST_TAG`.
2020-08-22 18:50:05 +03:00
George Kalpakas a6a6c16195 chore(ci): avoid deploying if linting fails
Previously, the `prepare-deployment` CI job, which requires all unit and
e2e test jobs to have succeeded before running, was ignoring the `lint`
job. As a result, deployments might happen even when there were linting
issues. This looks like an oversight.

This commit ensures that, in addition to unit and e2e tests passing,
linting must also pass before deploying the code or documentation.

Closes #17063
2020-08-21 17:32:55 +03:00
George Kalpakas 744862ac31 chore(ci): fix deploy-docs CI job
One step in the `deploy-docs` CI job contains a typo that causes it to
fail: `yarn -cwd ...` instead of `yarn --cwd ...`
This has been broken since a0488b30a7, but
has not been noticed because the job was not running. #17060 configured
the job to run as necessary, which brought up the error.

Example failure:
  - On v1.8.x:
    https://app.circleci.com/pipelines/github/angular/angular.js/
    153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606

This commit fixes the typo in the command.
2020-08-21 17:32:25 +03:00
George Kalpakas 3e62832680 chore(ci): fix deploy-code CI job
In #17060, the `deploy-code` job was updated to [include][1] the
`init_environment` custom command. This caused the job to start failing,
because  the `init_environment` command was not compatible with the
`cloud-sdk` executor used in `deploy-code`. There were two problems:

1. The `init_environment` command assumes that the working directory is
   `~/ng`. The `cloud-sdk` executor [did not specify][2] a working
   directory.
   Example failures:
     - On master:
       https://app.circleci.com/pipelines/github/angular/angular.js/
       152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594
     - On v1.8.x:
       https://app.circleci.com/pipelines/github/angular/angular.js/
       153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607

2. The `install_java` step, which is part of the `init_environment`
   command, relies on `sudo`, which is not available in the `cloud-sdk`
   executor.
   Example failure:
   - [On a PR]:
     https://app.circleci.com/pipelines/github/angular/angular.js/
     160/workflows/2eed5cfa-751c-44ba-b825-1d6cd5ba3406/jobs/1660

This commit fixes the issues by:
1. Specifying a working directory for the `cloud-sdk` executor. It also
   updates paths used in other steps of the `deploy-code` job to take
   the working directory into account.
2. Removing the `install_java` step from the `init_environment` command
   and adding it explicitly to jobs than require it.

[1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359
[2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
2020-08-21 17:32:25 +03:00
George Kalpakas 83f084e5db chore(ci): avoid unnecessarily running grunt prepareDeploy in deploy-docs CI job
Previously, the `grunt prepareDeploy` command was run in both the
`prepare-deployment` and `deploy-docs` CI jobs. The reason was that not
all files affected by `grunt prepareDeploy` were persisted to the
workspace across jobs.

More specifically, the command would affect files in the `deploy/` and
`scripts/docs.angularjs.org-firebase/` directories and also create a
`firebase.json` file at the root directory, but only the `deploy/`
directory was [persisted to the workspace][1].

This commit avoids unnecessarily running the `grunt prepareDeploy`
command in the `deploy-docs` CI job by ensuring that all affected files
will be persisted to the workspace in the `prepare-deployment` CI job,
which always runs before `deploy-docs`.

[1]: https://github.com/angular/angular.js/blob/295213df953766625462/.circleci/config.yml#L265

Closes #17060
2020-08-13 14:57:18 +03:00
George Kalpakas 046887048a chore(ci): correctly deploy code and docs on version branches and tags
Previously, the generated build artifacts and docs were only deployed
for builds associated with the master branch. There was also a `latest`
branch mentioned in the config, but there is normally no such branch, so
this had no effect.

This commit fixes the rules so that deployments happen when necessary.
More specifically:
- The `deploy-code` job now runs for builds associated with:
  - The master branch.
  - The stable branch (i.e. the branch from which the version tagged as
    `@latest` on npm is released).
  - Tags of the form `v1.X.Y(-Z)`. (This also required configuring
    CircleCI to run builds for git tags, which does not happen by
    default.)
- The `deploy-docs` job now runs for builds associated with:
  - The stable branch (i.e. the branch from which the version tagged as
    `@latest` on npm is released).

The new rules for when deployments should take place are based on the
logic previously in [.travis.yml][1] and [scripts/travis/build.sh][2]
(from before we switched from Travis to CircleCI).

[1]: https://github.com/angular/angular.js/blob/974700af7c1/.travis.yml#L54-L103
[2]: https://github.com/angular/angular.js/blob/974700af7c1/scripts/travis/build.sh#L66-L101
2020-08-13 14:56:34 +03:00
George Kalpakas f9b5cbfcf7 chore(package.json): update docs app to use version 1.8 of AngularJS
As mentioned in `RELEASE.md`, now that the [CDN][1] has been updated
with the 1.8.0 version, it is safe to bump the value of the
`branchVersion` property in `package.json` to `^1.8.0`. This will cause
the docs app to use the latest version, namely 1.8.0.

[1]: https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/angular.js
2020-08-13 14:56:34 +03:00
dependabot[bot] 0d14993d75 chore(deps): bump elliptic from 6.3.3 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.3.3 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.3.3...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Closes #17059
2020-07-30 18:44:04 +03:00
Ewa G 5541828ff4 docs(misc/Version Support Status): mention LTS extension by 6 months due to COVID
Due to COVID-19 affecting teams migrating from AngularJS, the Long Term Support period has been
extended by 6 months (until the end of 2021). See announcement on Twitter:
https://twitter.com/angular/status/1287780634572857357

This commit updates the "Version Support Status" page to also mention the extension.

Partially addresses #17058.
2020-07-30 12:25:28 +03:00
George Kalpakas 4099279426 fix(doc-gen): use the correct lodash method in dgeni processor (indexBy --> keyBy)
The `indexBy()` method was renamed to `keyBy()` in lodash v4 (see
lodash/lodash@b1d52ccd82). This commit
updates all usages of `indexBy()` to `keyBy()`.
2020-07-16 19:32:02 +03:00
dependabot[bot] 01ed44efd6 chore(deps-dev): bump lodash from 2.4.2 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 2.4.2 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/2.4.2...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 19:32:02 +03:00
dependabot[bot] 49655fac26 chore(deps): bump lodash
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 15:48:27 +03:00
dependabot[bot] 42abc8270a chore(deps): bump lodash
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 12:15:17 +03:00
dependabot[bot] d6ae0ee772 Merge pull request #17043 from angular/dependabot/npm_and_yarn/scripts/docs.angularjs.org-firebase/functions/websocket-extensions-0.1.4
chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4 in /scripts/docs.angularjs.org-firebase/functions
2020-06-11 11:47:40 +01:00
dependabot[bot] 94dc1d0e6d chore(deps): bump websocket-extensions
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-11 11:46:25 +01:00
Harri Lehtola 2fab3d4e00 fix($sanitize): do not trigger CSP alert/report in Firefox and Chrome
If `ngSanitize` is added as a module dependency and a Content-Security-Policy
is set that does not allow inline styles then Firefox and Chrome show the
following message:

> Content Security Policy: The page’s settings observed the loading of a
resource at self (“default-src”). A CSP report is being sent.

This message is caused because AngularJS is creating an inline style tag
to test for a browser bug that we use to decide what sanitization strategy
to use, which causes CSP violation errors if inline CSS is prohibited.

This test is no longer necessary, since the `DOMParser` is now safe to use
and the `style` based check is redundant.

In this fix, we default to using `DOMParser` if it is available and fall back
to `createHTMLDocument()` if needed. This is the approach used by DOMPurify
too.

The related unit tests in `sanitizeSpec.js`, "should not allow JavaScript
execution when creating inert document" and "should not allow JavaScript
hidden in badly formed HTML to get through sanitization (Firefox bug)", are
left untouched to assert that the behavior hasn't changed in those scenarios.

Fixes #16463.
2020-06-11 11:41:27 +01:00
Pete Bacon Darwin 72fbd48f2a chore: update changelog with vulnerability credits 2020-06-05 13:35:32 +01:00
Pete Bacon Darwin e55d352e94 docs(*): update changelog for 1.8.0 2020-06-04 16:12:37 +01:00
Pete Bacon Darwin 78ab691072 chore(*): prep for 1.8.0 2020-06-04 16:11:00 +01:00
Eran Nussbaum 59b5651d82 docs(ngRepeat): missing closing backtick 2020-06-02 14:52:51 +03:00
Michał Gołębiowski-Owczarek c8b7c16b78 fix(jqLite): improve documentation 2020-05-26 22:21:32 +02:00
Michał Gołębiowski-Owczarek 05cf60677b fix(jqLite): apply suggestions from code review
Co-authored-by: Michael Prentice <splaktar@gmail.com>
2020-05-26 22:08:46 +02:00
Michał Gołębiowski-Owczarek 2df43c0777 fix(jqLite): prevent possible XSS due to regex-based HTML replacement
This also splits the wrapping logic to one for modern browsers & one for IE 9
as IE 9 has restrictions that make it impossible to make it as secure.
2020-05-26 18:58:01 +02:00
George Kalpakas 295213df95 chore(*): clean up package.json and CircleCI config
This is a follow-up to #16915, cleaning up `package.json` and
`.circleci/config.yml` and making release scripts executable.
2020-05-26 17:39:51 +03:00
George Kalpakas a31c207bf1 chore(docs-app): remove document.write() from docs index.html
Previously, the docs app used `document.write()`, causing the following
warning on Chrome:

```
A parser-blocking, cross site (i.e. different eTLD+1) script,
https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js, is
invoked via document.write. The network request for this script MAY be
blocked by the browser in this or a future page load due to poor network
connectivity.
```

In the past, `document.write()` seems to have been used in order for
browsers (such as Firefox) to work correctly with our dynamically set
`<base>` tag and relative style/script URLs.

This commit replaces `document.write()` with regular
`<style>`/`<script>` tabs to avoid the warning (and potential issues due
to poor network connectivity). It seems that the latest versions of
Chrome, Firefox and IE can handle this fine (without naticeable delays).

Fixes #15396
2020-05-25 16:41:54 +01:00
Krzysztof Kotowicz 2518966153 fix(grunt-utils): insert the core CSS styles without using innerHTML
Create style elements and modify their text content instead of using
innerHTML to create the whole `<style>` element with its content.
That way style insertion done at bootstrap time doesn't interfere with
Trusted Types restrictions in Chrome (https://bit.ly/trusted-types).

Remove the type attribute - `text/css` is default:
https://html.spec.whatwg.org/#update-a-style-block.

Closes #17014
2020-05-25 11:17:53 +03:00
Pete Bacon Darwin 7de25c8e41 chore(ci): ensure that deployment files are ready for deployment 2020-05-24 19:57:58 +01:00
Pete Bacon Darwin 566a552645 chore(ci): update and deploy firebase function for code.angularjs.org 2020-05-24 19:57:57 +01:00
Pete Bacon Darwin 3c75a89906 chore(ci): attempt to fix up code deployment 2020-05-24 07:19:13 +01:00
Pete Bacon Darwin d9e68b157b chore(ci): use correct executor for deploying code 2020-05-23 14:57:48 +01:00
Pete Bacon Darwin a0488b30a7 chore(ci): move over to CircleCi config
This commit gets rid of all references to Travis and, belatedly, Jenkins.
Now all CI is done on CircleCI and releases are run locally.

The CI no longer updates the docs and code.angularjs.org for jobs that are
not on the `master` branch.

During releases, the docs and code should be uploaded manually.
2020-05-23 13:22:56 +01:00
Pete Bacon Darwin 974700af7c test(*): fix up some tests for Firefox 2020-05-22 18:09:15 +01:00
Pete Bacon Darwin 9c810ebb2c chore(*): update saucelabs browsers 2020-05-22 18:09:15 +01:00
Pete Bacon Darwin c4b79d59b4 chore(*): update protractor to latest version 2020-05-22 18:09:07 +01:00
Michał Gołębiowski-Owczarek 43c3e5b11b chore(*): update Node.js from 8 to 12, update some dependencies
Node.js 8 ends its support at the end of 2019. Node 12 will be supported
until April 2022 which is way past AngularJS end of support.

Some dependencies needed to be updated to make them work in Node.js 12.
2020-05-22 18:08:04 +01:00
Michał Gołębiowski-Owczarek 8e941f42e4 chore(*): update jQuery from 3.4.0 to 3.5.1 2020-05-20 05:17:05 +01:00
George Kalpakas 418355f1cf chore(docs.angularjs.org): upgrade Firebase libraries 2020-04-14 16:12:17 +03:00
George Kalpakas 94c288b125 chore(code.angularjs.org): upgrade Firebase libraries 2020-04-14 16:11:59 +03:00
Nishant Mittal 123c5a0a3e docs(misc/Version Support Status): Minor Typo Fix
Closes #17012
2020-04-13 15:48:57 +03:00
Sam Katakouzinos f6986f8e52 docs(developers): commit message format typo
Any line of the commit message cannot be longer *than* 100 characters!

Closes #17006
2020-03-11 13:29:49 +02:00
Chives ff963de73a docs($aria): get the docs working for the service
Closes #16945
2020-02-07 16:23:12 +02:00
comet 2b28c540ad docs(*): fix spelling errors
Closes #16942
2020-02-02 11:28:55 +02:00
George Kalpakas 68701efb9e chore(*): fix serving of URI-encoded files on code.angularjs.org
The files served for the various versions on https://code.angularjs.org/
are retrieved by a Firebase function from a Firebase Storage bucket
(where they are deployed to from Travis CI). The files are stored
exactly as they are named on disk.

It turns out that some of the files have names with special characters
that get URI-encoded when sent to the Firebase function. For example,
`input[text].html` becomes `input%5Btext%5D.html`. As a result, the
actual file cannot be retrieved from the Storage bucket (since the name
does not match) and `index.html` is returned instead. Apparently, this
never worked, but nobody noticed or reported it until recently.

An example of a failing URL is:
https://code.angularjs.org/1.7.9/docs/api/ng/input/input%5Btext%5D

(NOTE: https://docs.angularjs.org/ works correctly, since the files are
deployed to Firebase hosting directly and not to a Storage bucket.)

This commit fixes the problem by decoding the request path before trying
to retrieve the corresponding file from the Storage bucket.

Closes #16943
2020-02-02 11:19:17 +02:00
George Kalpakas c8a6e8450f chore(package): fix scripts for latest Node 10.x on Windows 2020-02-02 11:19:11 +02:00
thatshubham 0cd592f49f docs(angular.errorHandlingConfig): fix typo (wether --> whether)
Closes #16935
2020-01-14 12:22:44 +02:00
thatshubham a4daf1f767 docs(angular.copy): fix getter/setter formatting
Fix the formatting of `getter`/`setter` in the known limitations section
of the `angular.copy()` docs.

Closes #16934
2020-01-14 12:19:52 +02:00
Angel_Kitty be6a6d80e0 chore(*): update copyright year to 2020
Closes #16930
2020-01-14 12:16:06 +02:00
Pete Bacon Darwin 36f17c9262 docs: add mention to changelog 2019-11-19 14:37:18 +00:00
Pete Bacon Darwin ff5f782b20 docs: add mention to changelog 2019-11-19 14:35:59 +00:00
Pete Bacon Darwin 27460db1db docs: release notes for 1.7.9 2019-11-19 08:23:28 +00:00
Pete Bacon Darwin add78e6200 fix(angular.merge): do not merge __proto__ property
By blocking `__proto__` on deep merging, this commit
prevents the `Object` prototype from being polluted.
2019-11-07 15:39:21 +00:00
George Kalpakas 060bcdeeb9 chore(saucelabs): switch to latest version of desktop Safari
The currently latest-1 version of desktop Safari (v12.0) on SauceLabs is
completely unstable. Switching to the latest version (currently v12.1),
which works fine.

Closes #16888
2019-07-24 15:53:19 +03:00
George Kalpakas 881167d7bd chore(saucelabs): upgrade SauceConnect to 4.5.4 2019-07-24 15:52:07 +03:00
George Kalpakas 1147f0e213 docs($compile): fix typos and incorrect example 2019-07-21 18:00:47 +03:00
byronigoe 825e25b095 docs(guide/migration): fix typo (misceallenous --> miscellaneous)
Closes #16876
2019-05-28 21:15:25 +03:00
George Kalpakas 10d1b19737 fix(ngStyle): correctly remove old style when new style value is invalid
Since d6098eeb1, old styles were not removed if `newStyles` specified an
invalid value for the style (e.g. `false`). The assumption was that the
new style would overwrite the old style value, but using an invalid
value made browsers ignore the new value and thus keep the old style.
This would typically happen when guarding a style with a boolean flag;
e.g.: `ng-style="{backgroundColor: isError && 'red'}"`

This commit essentially revers commit d6098eeb1, whose main purpose was
to work around jquery/jquery#4185. The jQuery issue has been fixed in
3.4.0, so that should not be a problem any more.

Fixes #16860

Closes #16868
2019-05-09 21:24:02 +03:00
Michał Gołębiowski-Owczarek c8d985a0f3 chore(*): update jQuery from 3.2.1 to 3.4.0
This updates jQuery to 3.4.0 to ensure future security fixes won't break it.

Closes #16863
2019-04-12 11:27:25 +02:00
askhalil 55075b840c docs(DEVELOPERS): remove git revert misleading information
Closes #16857
2019-03-26 13:35:18 +02:00
JandersonConstantino c8980099dc chore(*): update copyright year 2019-03-22 07:27:46 +00:00
Pete Bacon Darwin e629fe4a78 docs(CHANGELOG): add 1.7.8 release notes 2019-03-11 11:58:29 +00:00
Martin Staffa 6959bc297f fix(required): correctly validate required on non-input element surrounded by ngIf
Closes #16830
Closes #16836
2019-03-06 18:08:05 +01:00
Ashish Kamble a1d15649ed docs(guide/di): clarify example description
Closes #16833
2019-03-05 21:59:32 +02:00
Pete Bacon Darwin cbf35f04f3 chore(github): update Issue template with LTS info 2019-02-27 09:30:13 +00:00
Pete Bacon Darwin f768023698 chore(github): update PR template to highlight LTS mode 2019-02-27 09:12:34 +00:00
Pete Bacon Darwin 587843bca0 chore(scripts): use https for git repo URLs 2019-02-04 13:35:37 +00:00
Pete Bacon Darwin 94582f0def docs(CHANGELOG): update with 1.7.7 release notes 2019-02-04 13:06:49 +00:00
Pete Bacon Darwin fffe7d1979 docs(RELEASE): store release instructions 2019-02-04 13:05:43 +00:00
Martin Staffa 005dd97255 fix(ngRequired): set error correctly when inside ngRepeat and false by default
Previously, in the required validator, we would read the required setting directly
from attr.required, where it is set by ngRequired.

However, when the control is inside ngRepeat, ngRequired sets it only after a another digest has
passed, which means the initial validation run of ngModel does not include the correct required
setting. (Before commit 0637a2124c this would not have been a problem,
as every observed value change triggered a validation).

We now use the initially parsed value from ngRequired in the validator.

Fixes #16814
Closes #16820
2019-01-26 11:31:25 +01:00
Martin Staffa 9f7144b035 docs(angular.copy): fix list of unsupported types 2019-01-21 20:35:53 +01:00
Martin Staffa 65f800e19e docs(angular.merge): add notes about support and lodash compatibility
Closes #16187
Closes #14512
2019-01-21 15:40:22 +01:00
Martin Staffa 63796d3f98 docs(angular.copy): list object types / features that are not supported
Closes #5085
Closes #13193
Closes #14352
Closes #15904
Closes #16055
Closes #16061
Closes #16067
2019-01-21 15:40:22 +01:00
Martin Staffa 2d8b34670b docs(angular.copy): add note about destination and source compatibility
Closes #15444
Closes #15462
2019-01-21 15:40:22 +01:00
Martin Staffa fbc83f00c7 docs(ngParseExt): note limitations with ngOptions and ngRepeat
Closes #15954
Closes #15926
2019-01-21 15:40:22 +01:00
Martin Staffa 0633d8f2b0 docs(input[email]): note limitations with IPv6 addresses
Closes #16599
2019-01-21 15:40:22 +01:00
Martin Staffa 7825772925 docs(ngDisabled): remove restriction to input element
Disabled can be set on many different elements, and might also be used
on custom controls, so it's better to remove the restriction completely

Closes #16775
2019-01-21 12:49:42 +01:00
Pete Bacon Darwin c7671edbfd chore(*): update CHANGELOG with release notes for 1.7.6 2019-01-17 09:22:16 +00:00
Jason Bedard 8b973e04ca fix($compile): fix ng-prop-* with undefined values
Fixes #16797
Closes #16798
2019-01-10 18:37:21 -08:00
George Kalpakas be45d3c208 chore(saucelabs): remove SL_Safari from browser list
Closes #16806
2019-01-10 21:38:56 +02:00
George Kalpakas 53ff4487e7 chore(saucelabs): add SL_EDGE-1 to browser list 2019-01-10 21:38:41 +02:00
George Kalpakas 7944b0c98f chore(travis): suppress verbose log output and allow error logging
Based on angular/angular#27657.
2019-01-10 21:38:41 +02:00
George Kalpakas 195756b45c chore(package): upgrade to latest karma-sauce-launcher
Based on angular/angular#27634.
2019-01-10 21:38:41 +02:00
George Kalpakas 940c1abf86 chore(package): upgrade to latest karma
This includes a Karma fix that affects CI flakiness.
Based on angular/angular#27735.
2019-01-10 21:38:41 +02:00
George Kalpakas 4584f0c37d chore(saucelabs): use 'websocket' for transmission when possible 2019-01-10 21:38:41 +02:00
George Kalpakas 7448d8748c chore(saucelabs): upgrade to latest SauceConnect 2019-01-10 21:38:41 +02:00
George Kalpakas 915939396a test(ngHref): only run Edge-specific test on relevant Edge versions 2019-01-10 21:38:41 +02:00
Bernhard Kiselka 1e8a3de15d docs(guide/Conceptual Overview): use exchangeratesapi.io
As fixer.io introduced an API key and thus a limitation of calls
(see https://github.com/fixerAPI/fixer#readme ),
change https://api.fixer.io to https://api.exchangeratesapi.io instead,
which is "designed and tested to handle thousands of request per second"
and has "built in Fixer.io compatibility so you can keep all the libraries you already like
and use daily" (from https://api.exchangeratesapi.io ).
The idea is from https://github.com/fixerAPI/fixer/issues/107

fixes  #16807

Closes #16808
2019-01-07 13:07:27 +02:00
Julien RAJERISON 2580bde8ac docs(ISSUE_TEMPLATE.md): add Opera to browser list
Opera is indirectly supported, although not explicitly tested on (see
[here](https://docs.angularjs.org/misc/faq#what-browsers-does-angularjs-work-with-)
for more info), so it doesn't hurt adding it to the list of browsers.

Closes #16801
2018-12-29 12:43:39 +02:00
Frederik Prijck 98d9143f0d chore(package): rename to angular to match npm
Previously, angularjs was used as the name inside the package.json file.
However, angularjs is published to npm using angular.
To avoid conflicts, the name is updated to reflect the same name as being published on npm.

Fixes #16799

Closes #16800
2018-12-27 20:27:36 +02:00
Pete Bacon Darwin 9ae51d751b test(ngAnimate): ensure that blockTransitions can be spied upon
Previously the test was assuing that this function was attached to
the window, which is not the case in production, nor in the isolated
module tests.
2018-12-11 15:40:15 +00:00
Pete Bacon Darwin 264819a308 chore(modules): execute modules unit tests in one karma run
SauceLabs  is struggling to keep connecting and disconnecting
for each of the modules unit test runs. This commit puts most of
the module tests into IIFEs so that they can be run in one go.

* ngMock is still tested separately since unlike the other tests
it doesn't want to have a pre-built version of ngMock available.

* ngAnimate is still tested separately because it does some funny
things with globals that were difficult to isolate in the main modules
test run.
2018-12-11 15:40:15 +00:00
Pete Bacon Darwin 5f1cf11e23 chore(utils): do not mutate source arrays 2018-12-10 19:11:59 +00:00
Pete Bacon Darwin 04ae4e5b47 test(*): isolate cache leaks from subsequent tests 2018-12-10 16:57:20 +00:00
Michał Gołębiowski-Owczarek e7e8dad3b3 test(ngSanitize): disable a failing Edge test in all versions, including 18
It's been only disabled on Edge 16/17 so far which made it fail in Edge 18.

Closes #16786
2018-12-09 03:23:09 +01:00
Michał Gołębiowski-Owczarek 09f013ae92 fix(compile): properly handle false value for boolean attrs with jQuery
jQuery skips special boolean attrs treatment in XML nodes for historical reasons
and hence AngularJS cannot freely call `.attr(attrName, false) with such
attributes. To avoid issues in XHTML, call `removeAttr` in such cases instead.

Ref jquery/jquery#4249
Fixes #16778
Closes #16779
2018-12-06 10:07:55 +01:00
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
George Kalpakas 99ad41fa3f refactor(ngMocks): clean up MockHttpExpectation 2018-08-25 23:38:47 +03:00
George Kalpakas 132344c867 refactor(ngMocks): ignore query/hash when extracting path params for MockHttpExpectation 2018-08-25 23:38:46 +03:00
George Kalpakas 321ee99647 refactor(ngMocks): clean up MockHttpExpectation#params() 2018-08-25 23:38:45 +03:00
George Kalpakas 9824c59dca refactor(ngRoute): do not unnecessarily return originalPath in routeToRegExp 2018-08-25 23:38:43 +03:00
George Kalpakas 506fe73a4a test(ngMocks): use correct method name in $httpBackend test 2018-08-25 23:38:41 +03:00
Susisu 510404e5b3 fix($route): correctly extract path params if path contains question mark or hash
The `routeToRegExp()` function, introduced by 840b5f0, could not extract
path params if the path contained question mark or hash. Although these
characters would normally be encoded in the path, they are decoded by
`$location.path()`, before being passed to the RegExp returned by
`routeToRegExp()`.

`routeToRegExp()` has to be able to deal with both encoded URL and
decoded path, because it is being shared between `ngRoute` and
`ngMocks`.

This commit fixes the issue, by introducing an `isUrl` option that
allows creating an appropriate RegExp for each usecase.
2018-08-25 23:38:40 +03:00
George Kalpakas 937fb891fa chore(doc-gen): upgrade dgeni-packages to 0.26.5
Related: #16671, angular/dgeni-packages#271
2018-08-23 15:07:18 +03:00
George Kalpakas aecd551bde docs(angular.copy): fix formatting
Using `<br>` messes formatting (due to a bug in
`dgeni`/`dgeni-packages`). This started breaking in c387e0d79.

Fixes #16671
2018-08-21 11:43:18 +03:00
Martin Staffa 837e519acc fix(ngHref): allow numbers and other objects in interpolation
Interpolated content in ngHref must be stringified before being passed to $$sanitizeUri by $sce. Before 1.7.x, the sanitization had happened on the already interpolated value inside $compile.

Closes #16652
Fixes #16626
2018-08-20 20:04:28 +02:00
John Mantas ad7ea95386 docs(ngRepeat): redundant "and" on line 77
Closes #16657
2018-08-07 16:20:40 +03:00
George Kalpakas fd4a284c85 docs(guide/migration): fix typos, format inline code 2018-08-06 15:51:03 +03:00
Martin Staffa 79ca0f1e91 fix(select): allow to select first option with value undefined
Previously, the value observer incorrectly assumed a value had changed even if
it was the first time it was set, which caused it to remove an option with
the value `undefined` from the internal option map.

Fixes #16653
Closes #16656
2018-08-06 12:47:43 +02:00
Martin Staffa 848c9b51f1 docs(select): remove solved known issue
The issue in question has been resolved some time in 2017.
The bug report is still open, but the behavior has changed:
https://bugzilla.mozilla.org/show_bug.cgi?id=126379

Let's hope they have tests for this!
2018-08-03 18:16:19 +02:00
Martin Staffa 16b0692885 docs(CHANGELOG.md): add changes for 1.7.3 2018-08-03 13:36:59 +02:00
Martin Staffa af3b71ef46 docs(\$compile): add docs for ngProp and ngOn bindings
The docs are written as if ngProp and ngOn were regular directives,
which makes them easier to find.

Closes #16627
2018-08-03 12:17:03 +02:00
Jason Bedard dedb10c0b8 feat($compile): add support for arbitrary DOM property and event bindings
Properties:

Previously only arbitrary DOM attribute bindings were supported via interpolation such as
`my-attribute="{{expression}}"` or `ng-attr-my-attribute="{{expression}}"`, and only a set of
distinct properties could be bound. `ng-prop-*` adds support for binding expressions to any DOM
properties. For example `ng-prop-foo="x"` will assign the value of the expression `x` to the
`foo` property, and re-assign whenever the expression `x` changes.

Events:

Previously only a distinct set of DOM events could be bound using directives such as `ng-click`,
`ng-blur` etc. `ng-on-*` adds support for binding expressions to any DOM event. For example
`ng-on-bar="barOccured($event)"` will add a listener to the "bar" event and invoke the
`barOccured($event)` expression.

Since HTML attributes are case-insensitive, property and event names are specified in snake_case
for `ng-prop-*` and `ng-on-*`. For example, to bind property `fooBar` use `ng-prop-foo_bar`, to
listen to event `fooBar` use `ng-on-foo_bar`.

Fixes #16428
Fixes #16235
Closes #16614
2018-08-01 17:50:25 -07:00
Jason Bedard 88a12f8623 refactor($compile): move img[srcset] sanitizing to helper method 2018-08-01 17:50:25 -07:00
Georgii Dolzhykov ebeb1c9491 fix(ngMock): pass failed HTTP expectations to $exceptionHandler
This was only partially fixed in f18dd2957.

Closes #16644
2018-07-31 14:35:39 +03:00
George Kalpakas 864c7f00c4 fix($location): avoid unnecessary $locationChange* events due to empty hash
Fixes #16632

Closes #16636
2018-07-30 23:36:31 +03:00
George Kalpakas 2907798ca5 test($location): add assertion 2018-07-30 23:36:12 +03:00
George Kalpakas 8562a62197 refactor($browser): correctly export helper used in specs
The helper is used in `fakeWindow.location.hash`. ATM, no test is using
the `hash` getter, so there were no errors.
2018-07-30 23:36:12 +03:00
George Kalpakas fdfba097da refactor($location): remove unnecessary capturing group in RegExp 2018-07-30 23:36:12 +03:00
George Kalpakas a07191727d refactor($location): minor changes (unused deps, exported globals, unused deps, etc) 2018-07-30 23:36:12 +03:00
George Kalpakas c133ef8360 fix($animate): avoid memory leak with $animate.enabled(element, enabled)
When disabling/enabling animations on a specific element (via
`$animate.enabled(element, enabled)`), the element is added in a map to
track its state. Previously, the element was never removed from the map,
causing AngularJS to hold on to the element even after it is removed
from the DOM, thus preventing it from being garbage collected.

This commit fixes it by removing the element from the map on `$destroy`.

Fixes #16637.

Closes #16649
2018-07-27 20:46:25 +03:00
Martin Staffa aa7d45e804 fix($compile): use correct parent element when requiring on html element
Fixes #16535
Closes #16647
2018-07-27 17:10:25 +02:00
Martin Staffa 6b915ad9db fix(Angular): add workaround for Safari / Webdriver problem
Closes #16645
2018-07-26 10:43:14 +02:00
Martin Staffa a42f8a0d5b fix(ngEventDirs): pass error in handler to $exceptionHandler when event was triggered in a digest
This ensures that the error handling is the same for events triggered inside and outside a digest.
2018-07-25 12:43:14 +02:00
Mark Gardner 6b0193e4d9 fix(ngEventDirs): don't wrap the event handler in $apply if already in $digest
Digest cycle already in progress error can inadvertently be caused when triggering an
element's click event while within an active digest cycle. This is due to the ngEventsDirs
event handler always calling $rootScope.$apply regardless of the status of $rootScope.$$phase.
Checking the phase and calling the function immediately if within an active digest cycle
will prevent the problem without reducing current functionality.

Closes #14673
Closes #14674
2018-07-25 12:43:14 +02:00
George Kalpakas e500fb6ddb fix(angular.element): do not break on cleanData() if _data() returns undefined
This shouldn't happen in supported jQuery versions (2+), but if someone
uses the unsupported 1.x version the app will break. The change that
causes this new behavior was introduced in b7d396b8b.

Even though jQuery 1.x is not supported, it is worth avoiding the
unnecessary breakage (given how simple).

Fixes #16641

Closes #16642
2018-07-23 14:20:31 +03:00
George Kalpakas 204f9ffebe docs(browserTrigger): document eventData.data property 2018-07-22 19:09:19 +03:00
George Kalpakas 7eee0c2c13 docs($route): fix typo (inluding --> including) 2018-07-22 18:44:59 +03:00
George Kalpakas 2dc83b2f04 docs(ngMock/$interval.flush): fix param type (not optional)
Closes #16640
2018-07-22 17:14:55 +03:00
George Kalpakas 3154111bb4 chore(saucelabs): upgrade sauce-connect to latest version
Closes #16639
2018-07-21 13:36:24 +03:00
George Kalpakas 2f6f1a7d70 chore(karma): upgrade karma and related dependencies to latest versions 2018-07-21 13:35:50 +03:00
Jason Bedard ff60b3f47a refactor($location): move repeated path normalization code into helper method (#16618)
Closes #16618
2018-07-21 02:39:38 -07:00
George Kalpakas c2d0783ca9 docs(ngMocks): fix type for $flushPendingTasks/$verifyPendingsTasks
Closes #16638
2018-07-21 10:44:57 +03:00
George Kalpakas 6706353a71 docs(ngMock/$timeout): deprecate flush() and verifyNoPendingTasks()
Closes #16603
2018-07-13 13:31:50 +03:00
George Kalpakas 24eeab0ebd docs(ngMock/$timeout): recommend $verifyNoPendingTasks() when appropriate
For historical reasons, `$timeout.verifyNoPendingTasks()` throws if
there is any type of task pending (even if it is not a timeout). When
calling `$timeout.verifyNoPendingTasks()`, the user is most likely
interested in verifying pending timeouts only, which is now possible
with `$verifyNoPendingTasks('$timeout')`.

To raise awareness of `$verifyNoPendingTasks()`, it is mentioned in the
error message thrown by `$timeoutverifyNoPendingTasks()` if none of the
pending tasks is a timeout.
2018-07-13 13:31:48 +03:00
George Kalpakas b14f67f4ae feat(ngMock): add $flushPendingTasks() and $verifyNoPendingTasks()
`$flushPendingTasks([delay])` allows flushing all pending tasks (or up
to a specific delay). This includes `$timeout`s, `$q` promises and tasks
scheduled via `$rootScope.$applyAsync()` and `$rootScope.$evalAsync()`.
(ATM, it only flushes tasks scheduled via `$browser.defer()`, which does
not include `$http` requests and `$route` transitions.)

`$verifyNoPendingTasks([taskType])` allows verifying that there are no
pending tasks (in general or of a specific type). This includes tasks
flushed by `$flushPendingTasks()` as well as pending `$http` requests
and in-progress `$route` transitions.

Background:
`ngMock/$timeout` has `flush()` and `verifyNoPendingTasks()` methods,
but they take all kinds of tasks into account which is confusing. For
example, `$timeout.verifyNoPendingTasks()` can fail (even if there are
no pending timeouts) because of an unrelated pending `$http` request.

This behavior is retained for backwards compatibility, but the new
methods are more generic (and thus less confusing) and also allow
more fine-grained control (when appropriate).

Closes #14336
2018-07-13 13:31:48 +03:00
George Kalpakas 411e35472b refactor($browser): share task-tracking code between $browser and ngMock/$browser
This avoids code/logic duplication and helps the implementations stay
in-sync.
2018-07-13 13:31:46 +03:00
George Kalpakas af59a0a00b refactor($interval): share code between $interval and ngMock/$interval
This avoids code/logic duplication and helps the implementations stay
in-sync.
2018-07-13 13:31:44 +03:00
George Kalpakas 1c380b7671 refactor(ngMock/$interval): more closely follow actual $interval's internal implementation 2018-07-13 13:31:44 +03:00
George Kalpakas 84fb041a89 feat(*): implement more granular pending task tracking
Previously, all pending async tasks (tracked via `$browser`) are treated
the same. I.e. things like `$$testability.whenStable()` and
`ngMock#$timeout.verifyNoPendingTasks()` take all tasks into account.

Yet, in some cases we might be interested in specific tasks only. For
example, if one wants to verify there are no pending `$timeout`s, they
don't care if there are other pending tasks, such as `$http` requests.
Similarly, one might want to get notified when all `$http` requests have
completed and does not care about pending promises.

This commit adds support for more granular task tracking, by enabling
callers to specify the type of task that is being added/removed from the
queue and enabling listeners to be triggered when specific types of
tasks are completed (even if there are more pending tasks of different
types).

The change is backwards compatible. I.e. calling the affected methods
with no explicit task-type, behaves the same as before.

Related to #14336.
2018-07-13 13:31:43 +03:00
Jason Bedard aee7d53a6b fix($location): fix infinite recursion/digest on URLs with special characters
Some characters are treated differently by `$location` compared to `$browser` and
the native browser. When comparing URLs across these two services this must be
taken into account.

Fixes #16592
Closes #16611
2018-07-09 19:39:25 -07:00
George Kalpakas bfdc9170f2 fix($compile): work around Firefox DocumentFragment bug
DOM nodes passed to `compilationGenerator()` will eventually be wrapped
in `jqLite`, when the compilation actually happens. In Firefox 60+,
there seems to be a `DocumentFragment`-related bug that sometimes causes
the `childNodes` to be empty at the time the compilation happens.

This commit works around this bug by eagerly wrapping `childNodes` in
`jqLite`.

NOTE:
The wrapped nodes have references to their `DocumentFragment` container.
This is "by design", since we want to be able to traverse the nodes via
`nextSibling` (in order to correctly handle multi-element directives).

Once the nodes are compiled, they will be either moved to a new
container element or the `jqLite` wrapper is release making them
eligible for garbage collection. In both cases, the original
`DocumentFragment` container should be eligible for garbage collection
too.

Fixes #16607

Closes #16615
2018-07-09 21:21:24 +03:00
Martin Staffa 494277e3d3 docs($animate): clarify possible options and fired events 2018-07-09 17:10:03 +02:00
Martin Staffa e4339bc512 feat($animate): add option data to event callbacks
Closes #12697
Closes #13059
2018-07-09 17:10:03 +02:00
Matias Niemelä 0e26197623 perf(ngAnimate): avoid repeated calls to addClass/removeClass when animation has no duration
Background:
ngAnimate writes helper classes to DOM elements to see if animations are defined on them. If many
elements have the same definition, and the same parent, we can cache the definition and skip the
application of the helper classes altogether. This helps particularly with large ngRepeat
collections.

Closes #14165
Closes #14166
Closes #16613
2018-07-05 19:44:34 +02:00
Martin Staffa 74726b4f79 docs(changelog, guide/Migration): add info about $sce BC in 1.7
Closes #16593
Closes #16622
2018-07-04 14:49:40 +02:00
Martin Staffa 3ad07eadef docs(guide/Using Location): change / remove obsolete information 2018-07-04 14:46:26 +02:00
Martin Staffa 7920f7140f docs(*): fix headlines 2018-07-04 14:46:26 +02:00
Atef Ben Ali 66fdf2a8a7 docs(guide/component): add missing :
Add `:` to `Components have a well-defined lifecycle` title.

Closes #16620
2018-06-29 11:10:01 +03:00
Martin Staffa 26a5779cdd chore(benchpress): add ngRepeat animation benchmark
Closes #13976
2018-06-25 16:54:33 +02:00
Martin Staffa a90d0cbbba chore: fix eslint error 2018-06-23 17:56:45 +02:00
Pete Bacon Darwin 9307ccf6ee chore(docs-app): ensure ToC links contain the path
Without the path the link is always pointing to the
root page, rather than the current page, which means
that copying the link address or opening the page in
a new tab is broken.

Closes #16608
2018-06-22 21:54:51 +01:00
Ilia Choly 2c7aa68ca8 fix(grunt-utils): correctly detect java 32bit support
Closes #16605
2018-06-20 21:06:25 +03:00
Georgii Dolzhykov 840b5f0a76 fix(ngMock/$httpBackend): correctly ignore query params in {expect,when}Route
Previously, a route definition such as
`$httpBackend.whenRoute('GET', '/route/:id')` matched against a URL with
query params, for example `/route/1?q=foo`, would incorrectly include
the query params in `id`: `{id: '1?q=foo', q: 'foo'}`.

This commit fixes it, so that the extracted `params` will now be:
`{id: '1', q: 'foo'}`.

Fixes #14173

Closes #16589
2018-06-18 19:42:50 +03:00
George Kalpakas 6c224a2a60 fix(ngAria): do not scroll when pressing spacebar on custom buttons
By default, pressing spacebar causes the browser to scroll down.
However, when a native button is focused, the button is clicked instead.

`ngAria`'s `ngClick` directive, sets elements up to behave like buttons.
For example, it adds `role="button"` and forwards `ENTER` and `SPACEBAR`
keypresses to the `click` handler (to emulate the behavior of native
buttons).

Yet, pressing spacebar on such an element, still invokes the default
browser behavior of scrolling down.

This commit fixes this, by calling `preventDefault()` on the keyboard
event, thus preventing the default scrolling behavior and making custom
buttons behave closer to native ones.

Closes #14665

Closes #16604
2018-06-18 18:44:46 +03:00
George Kalpakas af1e6a38b7 refactor(ngAria): clean up accessible actions tests 2018-06-18 18:44:27 +03:00
Martin Staffa 5b11145473 feat(form.FormController): add $getControls()
Closes #16601
Fixes #14749
Closes #14517
Closes #13202
2018-06-18 16:02:19 +02:00
Martin Staffa d7d64cc363 docs(downloading.ngdoc): remove link to Google CDN overview page
AngularJS is no longer listed on the CDN page, because the available versions
were almost always out of date due to the need to manually update the list
2018-06-14 18:06:00 +02:00
Pete Bacon Darwin 998d8b4b55 chore(code.angularjs.org): fix directory list paging 2018-06-14 10:48:59 +01:00
Pete Bacon Darwin 2472d621d7 chore(code.angularjs.org): update firebase libraries 2018-06-14 08:37:22 +01:00
Martin Staffa 83f7980e2f feat(ngModelOptions): add timeStripZeroSeconds and timeSecondsFormat
Closes #10721
Closes #16510
Closes #16584
2018-06-12 22:45:17 +01:00
George Kalpakas c9a92fcad5 docs(CHANGELOG): add release notes for 1.7.2 2018-06-12 16:33:59 +03:00
George Kalpakas f7b2fffa51 chore(doc-gen): error on unmatched links
Closes #16597
2018-06-12 14:40:32 +03:00
George Kalpakas 9a065c0fa9 docs(*): fix dangling or ambiguous links 2018-06-12 14:40:21 +03:00
George Kalpakas 42e622b751 revert: refactor($compile): remove preAssignBindingsEnabled leftovers
This reverts commit 8e104ee508.

This internal clean-up turned out to break popular UI libraries (e.g.
`ngMaterial`, `ui-bootstrap`) and cause pain to developers.

Fixes #16594

Closes #16595
2018-06-11 16:58:54 +03:00
George Kalpakas ad0ba99d8a docs(CHANGELOG): fix links to issues/PRs 2018-06-08 17:09:30 +03:00
George Kalpakas 05170bf371 docs(CHANGELOG): add release notes for 1.7.1 2018-06-08 16:25:08 +03:00
Georgios Kalpakas db584f7835 feat(ngAria): add support for ignoring a specific element
Fixes #14602
Fixes #14672

Closes #14833
2018-06-08 11:11:55 +03:00
Georgios Kalpakas 83d1229c87 refactor(ngAria): move test helpers inside of closure 2018-06-08 11:02:49 +03:00
Georgios Kalpakas 60069e67ae feat($route): add support for the reloadOnUrl configuration option
Enables users to specify that a particular route should not be reloaded after a
URL change (including a change in `$location.path()`), if the new URL maps to
the same route.
The default behavior is still to always load the matched route when any part of
the URL changes.

Related to #1699, #5860, #14999 (potentially closing the first two).

Fixes #7925

Closes #15002
2018-06-08 10:58:53 +03:00
Martin Staffa 84d80be2b4 feat(ngMessages): add support for default message
add support for showing default message when a truthy value is not matched by an ng-message directive.

Closes #12008
Closes #12213
Closes #16587
2018-06-06 17:40:55 +02:00
Martin Staffa 03a4782a35 feat(errorHandlingConfig): add option to exclude error params from url
Specific errors, such as those during nested module loading, can create very long
error urls because the error message includes the error stack. These urls create visual
clutter in the browser console, are often not clickable, and may be rejected
by the docs page because they are simply too long.

We've already made improvements to the error display in #16283, which excludes
the error url from error parameters, which results in cleaner error messages.

Further, modern browsers restrict console message length intelligently.

This option can still be useful for older browsers like Internet Explorer, or
in general to reduce visual clutter in the console.

Closes #14744
Closes #15707
Closes #16283
Closes #16299 
Closes #16591
2018-06-06 15:03:09 +02:00
Jakub Freisler 0ed36430da docs(ngAnimate): add "animating between value changes" section
Add a section which covers use case when users need to animate upon
a variable's value changes (not between two states).

Refers #16561

Closes #16582
2018-06-05 23:22:25 +03:00
Martin Staffa aa6adc77ae feat(ngRef): add directive to publish controller, or element into scope
Thanks to @drpicox for the original implementation: PR #14080 

Closes #16511
2018-06-05 15:00:12 +02:00
Georgii Dolzhykov a7de87d3e8 docs($httpBackend): headers param of expect* can be function
Closes #16588
2018-06-04 14:31:06 +03:00
Christian Oliff 1bb9aa0523 docs(.editorconfig): change link to use https 2018-06-04 10:13:43 +02:00
Jakub Freisler 586b6e8b73 docs(ngAnimate): refactor of ngAnimate docs
- Synced "animation aware" directives tables in API docs and "Animation"
  guide.
- Sorted tables alphabetically.
- Added info about `ngAnimateSwap` directive.

References #16561

Closes #16581
2018-06-02 11:48:20 +03:00
George Kalpakas 459997b482 fix(ngModel): do not throw if view value changes on destroyed scope
This could for example happen if updating the value is debounced (either
by asynchronously calling `$setViewValue()` or via `ngModelOptions`).

Fixes #16583

Closes #16585
2018-05-31 10:51:53 +03:00
Georgii Dolzhykov 8e104ee508 refactor($compile): remove preAssignBindingsEnabled leftovers
Now that we don't need to support `preAssignBindingsEnabled` (removed in #15782),
complexity introduced in `$controller` by #7645 can be removed.

One difference with the previous implementation is that all non-ES2015-class controller instances
were available on the element before calling their constructors. Now it depends on the relative
order of controllers. Controller constructors shouldn't be used to access other controllers
(e.g. via `$element.controller(directiveName)`). The recommended way is to use the `require`
property of the directive definition object and the life cycle hooks `$onChanges` or `$onInit`.

See
https://docs.angularjs.org/api/ng/service/$compile#-require-
https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks

Closes #16580
2018-05-30 23:01:52 +03:00
George Kalpakas 78b9f61366 fix($compile): support transcluding multi-element directives
Previously, transcluding multi-element directives (e.g. `foo-start`/`foo-end`)
was not supported on elements with multi-slot transclusion (a `uterdir` error
was thrown).
This commit fixes it by putting the transcluded nodes into a DocumentFragment,
where they can be traversed via `.nextSibling`.

Fixes #15554
Closes #15555
2018-05-26 16:11:09 +02:00
Martin Staffa b9f19ad0d4 docs(ngMockE2E): add docs for $httpBackend.matchLatestDefinitionEnabled()
Closes #16577
2018-05-26 16:05:51 +02:00
Martin Staffa 0b1adbb2e7 chore: try ios 11.2 2018-05-25 21:17:55 +02:00
Martin Staffa 6a1d7dd7dc chore(saucelabs): remove platform for ios11 2018-05-25 20:18:30 +02:00
George Kalpakas 5262039096 refactor(ngModelOptions): fix ng-closure-runner warning
Without this fix `grunt minall` emits the following warning:
> WARNING - Parse error. Non-JSDoc comment has annotations.
> Did you mean to start it with '/**'?

Closes #16575
2018-05-24 12:59:30 +03:00
Martin Staffa 96c4cb6694 chore: set ios 11 in saucelabs to 11.3 2018-05-23 23:36:48 +02:00
Martin Staffa 9fe596422f chore: add platform to ios saucelabs 2018-05-23 22:42:14 +02:00
Pete Bacon Darwin e22c5d3dba chore(package.json): update dist-tag for master branch 2018-05-23 19:20:29 +01:00
Martin Staffa 62660be328 docs(input[number]): note issue with large number and step validation
Closes #16486 
Closes #16573
2018-05-22 13:10:43 +02:00
Martin Staffa 773f39c934 feat(ngMock, ngMockE2E): add option to match latest definition for $httpBackend request
Closes #16251
Closes #11637
Closes #16560
2018-05-21 13:59:22 +01:00
Pete Bacon Darwin 7d121accdf chore(package.json): update docs app to use latest version of AngularJS 2018-05-21 10:19:44 +01:00
Mohamed amr 10a229ce1b feat(ngCookies): support samesite option
Closes  #16543 
Closes  #16544
2018-05-17 19:02:04 +02:00
Jason Bedard f9d1ca20c3 feat($compile): add one-way collection bindings
Closes #14039
Closes #16553
Closes  #15874
2018-05-17 15:30:39 +02:00
George Kalpakas f6e189dde0 refactor(ngAnimateSwap): simplify scope creation add tests regarding creating/removing scopes
Closes #16565
2018-05-16 22:50:20 +03:00
George Kalpakas c0b01d9123 refactor(ngAnimateSwap): remove usused dependency 2018-05-16 22:49:44 +03:00
Martin Staffa 45879a8c5a docs(CHANGELOG.md): update date for 1.7.0 2018-05-11 10:31:53 +02:00
Martin Staffa fe600c03da docs(CHANGELOG.md): add changes for 1.7.0 2018-05-09 22:30:41 +02:00
Daniel Herman 02c04690da fix($rootScope): don't allow explicit digest calls to affect $evalAsync
Fixes #15127

Closes #15494
2018-05-09 22:33:23 +03:00
Jason Bedard c3d5cc50cc refactor($compile): remove workaround for chrome bug fixed in v50
Closes #16554
2018-05-09 21:29:10 +02:00
Martin Staffa 6f85b3b699 chore(package.json): change distTag to "latest" 2018-05-09 19:40:07 +02:00
Martin Staffa 70b801f326 test(Angular): remove special case for Edge
Edge 17 supports this behavior.

Closes #16558
2018-05-07 18:10:16 +02:00
Martin Staffa 3cf4eed6b5 test($sanitize): exclude elclob test in Edge 17 (#16555)
We don't exclude Edge completely to know if the bug has been fixed
in the next version
2018-05-06 19:34:53 +02:00
George Kalpakas 376804676e docs(migration.ngdoc): add missing breaking changes from #16476
Closes #16557
2018-05-05 13:36:47 +03:00
George Kalpakas e3cb64b9e4 docs(CHANGELOG.md): add missing breaking changes from #16476
Closes #16556
2018-05-05 13:11:07 +03:00
Oscar Busk fb2d3fa15b docs(guide/Components): add link to documentation for component method
Closes #16548
2018-05-03 23:02:29 +02:00
Oscar Busk 0517799a05 docs(angular.Module): improved documentation for component method
Copy improved documentation for component() method from $compileProvider
and add missing object syntax.

Closes #16547
2018-05-03 22:59:41 +02:00
George Kalpakas 627180fb71 fix(input[date]): correctly parse 2-digit years
When parsing a date string value, AngularJS uses `new Date(year, ...)`
to create a Date object and assign it to the model. In the constructor,
2-digit years map to 1900-1999, so the created Date object has the wrong
value for year.
This commit fixes it, by explicitly using `setFullYear()` to set the
year to the correct value, when necessary.

Fixes #16537

Closes #16539
2018-04-27 18:51:58 +03:00
Martin Staffa 841feb0a05 docs(guide/migration): add notes on 1.6 to 1.7 migration
Closes #16474
2018-04-19 10:07:41 +02:00
Martin Staffa b85c70a958 docs(CHANGELOG.md): add changes for 1.7.0-rc.0
Closes #16439
Closes #16514
2018-04-19 10:07:41 +02:00
Martin Staffa b2ed68d723 docs(CHANGELOG.md): update date for 1.6.10 2018-04-17 18:34:13 +02:00
Michał Gołębiowski-Owczarek 5b7e4b4394 chore(*): remove manualLowercase & manualUppercase functions
The `manualLowercase` & `manualUppercase` functions were inspired by Google Caja
code which worked around Java issues where problems with `toLowerCase`
working differently in Turkish locale are well known[1]. In JavaScript
`String#toLowerCase` is defined in the ECMAScript spec and all implementations
are required to lowercase I in the same way, regardless of the current locale.
Differences may (and do) happen only in `String#toLocaleLowerCase`.

The mirroring of the Java workarounds in Caja was needed due to an old Rhino bug.
Rhino is a pre-Nashorn JavaScript interpreter written in Java and it used to
delegate `String.prototype.toLowerCase` to `java.lang.String.toLowerCase`. This
has since been long fixed.

Other libraries doing string normalization, like jQuery or DOMPurify don't
apply special lowercasing logic in a Turkish environment.

Therefore, the `manualLowercase` & `manualUppercase` logic is dead code in
AngularJS and can be removed.

Also, the `manualLowercase` & `manualUppercase` functions are incomplete; they
only lowercase ASCII characters which is different to native
`String#toLowerCase`. Since those functions are used in many places in the
library, they would break a lot of code. For example, the lowercase filter would
not lowercase Ω to ω but leave it as Ω.

[1] https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/

Closes #15890
Ref #11387
2018-04-13 09:43:38 +02:00
Martin Staffa 77f26bddf7 docs(CHANGELOG.md): add changes for 1.6.10 2018-04-12 18:39:35 +02:00
Martin Staffa c8c3de490f docs($compile): add known issues with replace:true
Closes #16523

Related #2573
Related #5695
Related #9837
Related #10612
2018-04-09 10:20:50 +02:00
Martin Staffa 3a2aea78ad fix(input): allow overriding timezone for date input types
This commit also fixes a bug where part of the Date object
was re-used even after the input was emptied.

Fixes #16181
Closes #13382
Closes #16336
2018-04-06 16:40:14 +02:00
Mohamed amr b7bb797e5c fix(input): take timezone into account when validating minimum and maximum date types
Closes #16342
Closes #16390
2018-04-06 11:53:32 +02:00
George Kalpakas 059d4f6118 refactor(urlResolve): return already parsed URLs unchanged
Closes #14890
2018-04-04 21:04:22 +03:00
Georgios Kalpakas 1e90d03077 feat($http): support sending XSRF token to whitelisted origins
Normally, the XSRF token will not be set for cross-origin requests.
With this commit, it is possible to whitelist additional origins, so that requests to these origins
will include the XSRF token header.

Fixes #7862
2018-04-04 21:04:20 +03:00
Michał Gołębiowski-Owczarek b7d396b8b6 fix(jqLite): make removeData() not remove event handlers
This change aligns jqLite with jQuery.

Fixes #15869
Closes #16512

BREAKING CHANGE:

Before this commit `removeData()` invoked on an element removed its event
handlers as well. If you want to trigger a full cleanup of an element, change:

```js
elem.removeData();
```

to:

```js
angular.element.cleanData(elem);
```

In most cases, though, cleaning up after an element is supposed to be done
only when it's removed from the DOM as well; in such cases the following:

```js
elem.remove();
```

will remove event handlers as well.
2018-04-03 21:49:52 +02:00
Jason Bedard 71d2c147a8 test($parse): add tests for watching one-time array/object literals
Closes #16477
2018-04-03 21:34:32 +02:00
Jason Bedard 4492db3077 test($rootScope): add tests clarifying $watchGroup oldValues behavior
Closes #16024 
Closes #16494
See also #16514
2018-04-03 21:25:52 +02:00
Michał Gołębiowski-Owczarek 09a638559a docs(jqLite): document that append doesn't work well with a multi-node object
Contrary to jQuery jqLite's append doesn't clone elements so will not work
correctly when invoked on a jqLite object containing more than one DOM node.

Refs #11446
Closes #16517
2018-04-03 21:10:12 +02:00
Michał Gołębiowski-Owczarek a8dedf7a01 fix(jqLite): use XHTML-compliant HTML as input for jqLite
Fixes #6917
Closes #16518
2018-04-03 20:58:00 +02:00
Michał Gołębiowski-Owczarek b0815a702e chore(*): stop testing on Edge 15 due to its instability
Edge 15 disconnects from Karma frequently causing extreme build instability.
We are testing on Edge 16 & Edge 17 should be released soon anyway.

Closes #16516
2018-03-28 14:43:45 +02:00
Michał Gołębiowski-Owczarek feee36c8c9 tests(ngMock): remove a broken jqLite cache clearing (#16515)
This commit removes the resetting of `angular.element.cache` in some tests;
this was desynchronizing jqLite.cache & the local jqCache variable and since
some parts of the code use one of them and some the other one, it was breaking
JQLite._data. `angular.element.cache` doesn't even exist when jQuery 2+ is used.

Closes #16515
Refs #16512
2018-03-28 13:20:42 +02:00
Martin Staffa 983e27b628 fix($compile): throw error in $onChanges immediately
This brings it in line with how we throw errors in a digest cycle, 
and also avoids throwing an array.

Closes #15578 
Closes #16492
2018-03-22 10:37:15 +01:00
Giuseppe Scoppino c68b31cb2c docs(guide/Internet Explorer Compatibility): include warnings for usage of 'disabled' attribute
* docs(guide/Internet Explorer Compatibility): Mention 'disabled' attribute

Setting the 'disabled' attribute on an element that has descendant elements has unexpected behavior in Internet Explorer 11.

* Input elements that are descendants have the text content of the 'placeholder' attribute inserted as the value (and it is not removed when typing in the field).
* Select elements that are descendants are disabled.

To avoid this issue, it is important to not set `disabled` or `ng-disabled` on an element that has descendant form elements. Normally these should only be used on actual form controls so the issue would not manifest.

The issue can also appear if a directive/component is named 'disabled' or takes an attribute named 'disabled' as an input/output attribute, so avoid these.

Closes  #16490
Related #15700
2018-03-19 18:02:52 +01:00
Martin Staffa 4b2de4bcbf feat(minErr): strip error url from error parameters
Related https://github.com/angular/angular.js/issues/14744
2018-03-19 17:57:44 +01:00
Martin Staffa 786cb30c61 fix(minErr): update url to https 2018-03-19 17:57:44 +01:00
Martin Staffa c0bc1df3f7 chore(travis): update iOs test browsers
Closes #16493
2018-03-16 16:48:12 +01:00
Martin Staffa 98e0e047b0 docs(ngShow/ngHide): add note about flicker when toggling elements
Related to https://github.com/angular/angular.js/issues/14015

Closes #16489
2018-03-14 22:35:34 +01:00
George Kalpakas a8bef95127 fix($interval): throw when trying to cancel non-$interval promise
Previously, calling `$interval.cancel()` with a promise that was not
generated by a call to `$interval()` would do nothing. This could, for
example, happen when calling `.then()`/`.catch()` on the returned
promise, which creates a new promise, and passing that to
`$interval.cancel()`.
With this commit, `$interval.cancel()` will throw an error if called
with a non-$interval promise, thus surfacing errors that would otherwise
go unnoticed.

Related to #16424.

BREAKING CHNAGE:

`$interval.cancel()` will throw an error if called with a promise that
was not generated by `$interval()`. Previously, it would silently do
nothing.

Before:
```js
var promise = $interval(doSomething, 1000, 5).then(doSomethingElse);
$interval.cancel(promise);  // No error; interval NOT canceled.
```

After:
```js
var promise = $interval(doSomething, 1000, 5).then(doSomethingElse);
$interval.cancel(promise);  // Throws error.
```

Correct usage:
```js
var promise = $interval(doSomething, 1000, 5);
var newPromise = promise.then(doSomethingElse);
$interval.cancel(promise);  // Interval canceled.
```

Closes #16476
2018-03-13 21:20:10 +02:00
George Kalpakas 3365256502 fix($timeout): throw when trying to cancel non-$timeout promise
Previously, calling `$timeout.cancel()` with a promise that was not
generated by a call to `$timeout()` would do nothing. This could, for
example, happen when calling `.then()`/`.catch()` on the returned
promise, which creates a new promise, and passing that to
`$timeout.cancel()`.
With this commit, `$timeout.cancel()` will throw an error if called with
a non-$timeout promise, thus surfacing errors that would otherwise go
unnoticed.

Fixes #16424

BREAKING CHNAGE:

`$timeout.cancel()` will throw an error if called with a promise that
was not generated by `$timeout()`. Previously, it would silently do
nothing.

Before:
```js
var promise = $timeout(doSomething, 1000).then(doSomethingElse);
$timeout.cancel(promise);  // No error; timeout NOT canceled.
```

After:
```js
var promise = $timeout(doSomething, 1000).then(doSomethingElse);
$timeout.cancel(promise);  // Throws error.
```

Correct usage:
```js
var promise = $timeout(doSomething, 1000);
var newPromise = promise.then(doSomethingElse);
$timeout.cancel(promise);  // Timeout canceled.
```
2018-03-13 21:19:45 +02:00
George Kalpakas de94dd4079 style($interval): fix indentation 2018-03-13 21:19:44 +02:00
George Kalpakas a2a8d7e791 style($timeout): fix indentation 2018-03-13 21:19:44 +02:00
Michał Gołębiowski-Owczarek 73c6467f14 fix($cookies): remove the deprecated $cookieStore factory
Closes #16465

BREAKING CHANGE:

The $cookieStore has been removed. Migrate to the $cookies service. Note that
for object values you need to use the `putObject` & `getObject` methods as
`get`/`put` will not correctly save/retrieve them.

Before:
```js
$cookieStore.put('name', {key: 'value'});
$cookieStore.get('name'); // {key: 'value'}
$cookieStore.remove('name');
```

After:
```js
$cookies.putObject('name', {key: 'value'});
$cookies.getObject('name'); // {key: 'value'}
$cookies.remove('name');
```
2018-03-13 09:31:15 +01:00
George Kalpakas 6e55b890de docs(input[radio]): explain what happens with same name on multiple inputs
Closes #15009

Closes #16478
2018-03-12 16:30:31 +02:00
Martin Staffa 64c23e4d9c docs($http): move response object documentation into Usage section 2018-03-07 10:40:02 +01:00
Martin Staffa 7e2e235cf2 fix($http): set correct xhrStatus in response when using 'timeout'
This correctly sets "timeout" if a request fails because the timeout
(numerical or $timeout) is exceeded,
and "abort" if the request is aborted by resolving a promise that was passed in.
2018-03-07 10:40:02 +01:00
Martin Staffa 4f4ad3cad4 chore(docs.angularjs.org): add csp headers for csp example
Fixes #16270
2018-03-01 12:52:12 +01:00
Martin Staffa a37f89f864 chore(docs-app): add dynamic 404 behavior
Adapted from https://github.com/angular/angular/commit/88045a50506adfe32c2f7a213c8e95f46d1e40e1,
https://github.com/angular/angular/commit/c3fb820473d64036ef0dd3d4c004cc7fbc67be75,
and https://github.com/angular/angular/commit/5a624fa1be530a1b3479a4cc7f96e5a20a3d64fb.
2018-03-01 12:52:12 +01:00
Martin Staffa 02fb980de6 chore(docs.angularjs.org): only deploy production index.html as entry file
Previously, we rewrote index.html to index-production.html, but Firebase ignored
this, probably because an exact file match always takes priority. This lead
to the problem thatthe root - angularjs.org - didn't include the angular.js source
files from the CDN
2018-03-01 12:52:12 +01:00
Martin Staffa 77917e34c9 chore(docs.angularjs.org): allow crawling of examples, don't deploy e2e test files 2018-03-01 12:52:12 +01:00
Martin Staffa 290a5f2339 docs(tutorial): fix headlines 2018-02-27 17:41:13 +01:00
Frederik Prijck 719e66b38b docs(README): fix incorrect version-support-status link (#16473)
Closes #16472
2018-02-26 15:00:42 +01:00
George Kalpakas c0adcc3a4b refactor($compile): avoid catastrophic backtracking when parsing bindings
This isn't expected to have any actual impact, since AngularJS is only
intended to be used in the browser (not the server) and for this RegExp
to be exploited by malicious user code the developer would have to have
to give the user rights to execute arbitrary JavaScript code anyway.
Fixing as a general good practice and to avoid encouraging use of a
similar RegExp in other environments where it might actually matter.

Closes #16464
2018-02-21 11:46:22 +02:00
Pete Bacon Darwin 33b251d55e docs(misc): add version-support-status page (#16460)
Closes #16058
Closes #16458
2018-02-21 08:33:28 +00:00
George Kalpakas ea0585773b fix($resource): fix interceptors and success/error callbacks
Previously, action-specific interceptors and `success`/`error` callbacks
were executed in inconsistent relative orders and in a way that did not
meet the general expectation for interceptor behavior (e.g. ability to
recover from errors, performing asynchronous operations, etc).

This commit fixes the behavior to make it more consistent and expected.
The main differences are that `success`/`error` callbacks will now be
run _after_ `response`/`responseError` interceptors complete (even if
interceptors return a promise) and the correct callback will be called
based on the result of the interceptor (e.g. if the `responseError`
interceptor recovers from an error, the `success` callback will be
called).
See also https://github.com/angular/angular.js/issues/9334#issuecomment-364650642.

This commit also replaces the use of `success`/`error` callbacks in the
docs with using the returned promise.

Fixes #6731
Fixes #9334
Closes #6865

Closes #16446

BREAKING CHANGE:

If you are not using `success` or `error` callbacks with `$resource`,
your app should not be affected by this change.

If you are using `success` or `error` callbacks (with or without
response interceptors), one (subtle) difference is that throwing an
error inside the callbacks will not propagate to the returned
`$promise`. Therefore, you should try to use the promises whenever
possible. E.g.:

```js
// Avoid
User.query(function onSuccess(users) { throw new Error(); }).
  $promise.
  catch(function onError() { /* Will not be called. */ });

// Prefer
User.query().
  $promise.
  then(function onSuccess(users) { throw new Error(); }).
  catch(function onError() { /* Will be called. */ });
```

Finally, if you are using `success` or `error` callbacks with response
interceptors, the callbacks will now always run _after_ the interceptors
(and wait for them to resolve in case they return a promise).
Previously, the `error` callback was called before the `responseError`
interceptor and the `success` callback was synchronously called after
the `response` interceptor. E.g.:

```js
var User = $resource('/api/users/:id', {id: '@id'}, {
  get: {
    method: 'get',
    interceptor: {
      response: function(response) {
        console.log('responseInterceptor-1');
        return $timeout(1000).then(function() {
          console.log('responseInterceptor-2');
          return response.resource;
        });
      },
      responseError: function(response) {
        console.log('responseErrorInterceptor-1');
        return $timeout(1000).then(function() {
          console.log('responseErrorInterceptor-2');
          return $q.reject('Ooops!');
        });
      }
    }
  }
});
var onSuccess = function(value) { console.log('successCallback', value); };
var onError = function(error) { console.log('errorCallback', error); };

// Assuming the following call is successful...
User.get({id: 1}, onSuccess, onError);
  // Old behavior:
  //   responseInterceptor-1
  //   successCallback, {/* Promise object */}
  //   responseInterceptor-2
  // New behavior:
  //   responseInterceptor-1
  //   responseInterceptor-2
  //   successCallback, {/* User object */}

// Assuming the following call returns an error...
User.get({id: 2}, onSuccess, onError);
  // Old behavior:
  //   errorCallback, {/* Response object */}
  //   responseErrorInterceptor-1
  //   responseErrorInterceptor-2
  // New behavior:
  //   responseErrorInterceptor-1
  //   responseErrorInterceptor-2
  //   errorCallback, Ooops!
```
2018-02-20 15:55:15 +02:00
Pete Bacon Darwin 8b399545a5 docs($route): fix typo in error message 2018-02-20 14:04:25 +01:00
Pete Bacon Darwin b87c6a6d4d test(*): fix references to tpload minerr in tests 2018-02-20 14:04:25 +01:00
Pete Bacon Darwin c617d6dcee fix($templateRequest): give tpload error the correct namespace
BREAKING CHANGE

Previously the `tpload` error was namespaced to `$compile`. If you have
code that matches errors of the form `[$compile:tpload]` it will no
longer run. You should change the code to match
`[$templateRequest:tpload]`.
2018-02-20 10:25:33 +00:00
Pete Bacon Darwin 56b6ba8e0b docs($route): add missing error document 2018-02-19 19:37:26 +00:00
Pete Bacon Darwin f1c164c92f docs($parse): add missing error documents 2018-02-19 19:31:43 +00:00
Martin Staffa 3eabaab009 chore(docs.angularjs.org): allow crawling but not indexing of partials/
The sitemap.xml might also prevent the indexing, as the partials are not
listed.

Related to #16432 
Closes #16457
2018-02-15 14:37:24 +01:00
Martin Staffa 9645a08b61 chore(docs.angularjs.org): allow robots access to js files
Related to #16432
2018-02-15 14:36:50 +01:00
Michał Gołębiowski-Owczarek 04ee1e781b docs(*): add CODE_OF_CONDUCT.md
Closes #16456
2018-02-15 14:28:47 +01:00
George Kalpakas a126b346ff chore(travis): fix ROOT_DIR path when build.sh is sourced 2018-02-13 02:21:22 +02:00
George Kalpakas ba140dbff9 chore(docs.angularjs.org): install firebase dependencies before deploying
Firebase is trying to execute our functions code locally in order to
parse the triggers. Install npm dependencies to avoid errors like:

```
Error: Error parsing triggers: Cannot find module 'firebase-functions'
```

Closes #16453
2018-02-13 01:36:22 +02:00
George Kalpakas fb479188f5 chore(docs.angular.js): do not break when deploying
Follow-up to #16451.

Closes #16452
2018-02-12 23:18:52 +02:00
Martin Staffa 75bf199421 chore(docs.angularjs.org): serve snapshots for googlebot
This commit restores serving the plain partials (content) when a docs
page is accessed with ?_escaped_fragment_=.
The Google Ajax Crawler accesses these urls when the page has
`<meta type="fragment" content="!">` is set.

During the migration to Firebase, this was lost, which resulted in Google
dropping the docs almost completely from the index.

We are using a Firebase cloud function to serve the partials. Since
we cannot access the static hosted files from the function, we have to
deploy them as part of the function directory instead, from which they
can be read.

Related to #16432
Related to #16417
2018-02-12 14:34:06 +01:00
Martin Staffa 9196c80c33 chore(deploy): rename deploy folders 2018-02-12 14:34:06 +01:00
Martin Staffa e1e2100e66 chore(code.angularjs.org): don't gzip compressed image files 2018-02-12 14:34:06 +01:00
Martin Staffa 9f1793fd2d chore(eslint): allow ES6 for node scripts 2018-02-12 14:34:06 +01:00
George Kalpakas a7a9688962 fix(docs): fix @media breakpoints for small/extra small devices
Previously, our custom styles used `@media` breakpoints for
small/extra small devices that were off-by-one from
[Bootstrap breakpoints](https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes)
(767px vs 768px). This caused the site to not be displayed correctly on
these exact sizes, which affected for example all iPad devices (whose
screens are exactly 768px wide).

This commit fixes it by making our breakpoints match those of Bootstrap.

Fixes #16448

Closes #16449
2018-02-11 21:22:15 +02:00
Martin Staffa 32b1a0c580 chore(docs.angularjs.org): actually fix deployment
When a file is symlinked, relative paths obviously aren't correct anymore.
This error was masked because Travis didn't fail the job when Firebase
couldn't find the public folder.
To fix, we copy the file and adjust the folder path
2018-02-09 00:31:48 +01:00
Martin Staffa 9a0f1abdda chore(docs.angularjs.org): deploy sitemap.xml
Closes #16445
2018-02-08 23:50:45 +01:00
Martin Staffa c484213180 test(input): add test for IE composition bug 2018-02-08 23:50:07 +01:00
Jae Ik Lee 2789ccbcf9 fix(input): fix composition mode in IE for Korean input
Fixes #6656
Closes #16273
2018-02-08 23:50:07 +01:00
Martin Staffa 3e7a87d7d1 fix(browserTrigger): support CompositionEvent 2018-02-08 23:50:07 +01:00
Martin Staffa 3ecb00115a chore(docs.angularjs.org): serve xml files (sitemap) 2018-02-08 18:56:59 +01:00
Martin Staffa e4e2024d1c chore(code.angularjs.org): increase the cache duration
This is already set, but wasn't checked in
2018-02-08 18:54:25 +01:00
frederikprijck 02f4ca4887 docs(ngClass): add docs regarding animation for ngClassEven and ngClassOdd
Previously, the documentation has no information regarding using
`ngAnimate` together with the `ngClassEven` and `ngClassOdd` directives.

This commit adds the same docs used by the `ngClass` directive to the
`ngClassEven` and `ngClassOdd` docs and adds an extra example for both
`ngClassEven` and `ngClassOdd` that showcases animations.

Closes #15654
2018-02-06 21:55:29 +02:00
Maksim Ryzhikov 8d6ac5f317 feat($sanitize): support enhancing elements/attributes white-lists
Fixes #5900
Closes #16326
2018-02-06 16:07:49 +02:00
Martin Staffa 7d50b2e9ee chore(docs.angularjs.org): allow robots to access js and css
Otherwise, the google bot cannot execute the JS
2018-02-05 17:52:34 +01:00
Martin Staffa ea04dbb229 chore(code.angularjs.org): fix robots.txt
- allow all-versions-data.js in snapshot, which is used by docs.angularjs.org
- disallow access to folders like docs-0.9.2 etc which are used by early versions
2018-02-05 17:52:34 +01:00
Martin Staffa fbe679dfbc chore(doc-gen): generate sitemap.xml 2018-02-05 17:52:34 +01:00
frederikprijck fb00991460 fix($templateRequest): always return the template that is stored in the cache
Previously, `$templateRequest` returned the raw `$http` response data on the
first request for a template and then the value from the cache for subsequent
requests.

If the value is transformed when being added to the cache (by decorating
`$templateCache.put`)  the return value of `$templateRequest` would be
inconsistent depending upon when the request is made.

This commit ensures the cached value is returned instead of the raw `$http`
response data, thus allowing the `$templateCache` service to be decorated.

Closes #16225
2018-02-05 11:21:28 +00:00
Martin Staffa d3bffc5476 chore(docs.angularjs.org): add robots.txt 2018-02-02 13:55:13 +01:00
Martin Staffa b969c3e354 docs(changelog): add changes for 1.6.9 2018-02-02 13:55:11 +01:00
Martin Staffa 16b82c6afe fix($animate): let cancel() reject the runner promise
Closes #14204
Closes #16373

BREAKING CHANGE:

$animate.cancel(runner) now rejects the underlying
promise and calls the catch() handler on the runner
returned by $animate functions (enter, leave, move,
addClass, removeClass, setClass, animate).
Previously it would resolve the promise as if the animation
had ended successfully.

Example:

```js
var runner = $animate.addClass('red');
runner.then(function() { console.log('success')});
runner.catch(function() { console.log('cancelled')});

runner.cancel();
```

Pre-1.7.0, this logs 'success', 1.7.0 and later it logs 'cancelled'.
To migrate, add a catch() handler to your animation runners.
2018-02-02 10:02:06 +01:00
Georgii Dolzhykov e3ece2fad9 feat(isArray): support Array subclasses in angular.isArray()
Closes #15533
Closes #15541

BREAKING CHANGE:

Previously, `angular.isArray()` was an alias for `Array.isArray()`.
Therefore, objects that prototypally inherit from `Array` where not
considered arrays. Now such objects are considered arrays too.

This change affects several other methods that use `angular.isArray()`
under the hood, such as `angular.copy()`, `angular.equals()`,
`angular.forEach()`, and `angular.merge()`.

This in turn affects how dirty checking treats objects that prototypally
inherit from `Array` (e.g. MobX observable arrays). AngularJS will now
be able to handle these objects better when copying or watching.
2018-02-01 23:06:03 +02:00
Martin Staffa 67f54b6600 fix(ngTouch): deprecate the module and its contents
Closes #16427
Closes #16431
2018-02-01 10:31:32 +01:00
Martin Staffa 3fc6843528 chore(code.angularjs.org): improve output of directory listing 2018-01-31 18:01:10 +01:00
Pete Bacon Darwin 1e9eadcd72 feat($sce): handle URL sanitization through the $sce service
Thanks to @rjamet for the original work on this feature.

This is a large patch to handle URLs with the $sce service, similarly to HTML context.

Where we previously sanitized URL attributes when setting attribute value inside the
`$compile` service, we now only apply an `$sce` context requirement and leave the
`$interpolate` service to deal with sanitization.

This commit introduces a new `$sce` context called `MEDIA_URL`, which represents
a URL used as a source for a media element that is not expected to execute code, such as
image, video, audio, etc.
The context hierarchy is setup so that a value trusted as `URL` is also trusted in the
`MEDIA_URL` context, in the same way that the a value trusted as `RESOURCE_URL` is also
trusted in the `URL` context (and transitively also the `MEDIA_URL` context).

The `$sce` service will now automatically attempt to sanitize non-trusted values that
require the `URL` or `MEDIA_URL` context:

* When calling `getTrustedMediaUrl()` a value that is not already a trusted `MEDIA_URL`
will be sanitized using the `imgSrcSanitizationWhitelist`.
* When calling `getTrustedUrl()` a value that is not already a trusted `URL` will be
sanitized using the `aHrefSanitizationWhitelist`.

This results in behaviour that closely matches the previous sanitization behaviour.

To keep rough compatibility with existing apps, we need to allow concatenation of values
that may contain trusted contexts. The following approach is taken for situations that
require a `URL` or `MEDIA_URL` secure context:

* A single trusted value is trusted, e.g. `"{{trustedUrl}}"` and will not be sanitized.
* A single non-trusted value, e.g. `"{{ 'javascript:foo' }}"`, will be handled by
  `getTrustedMediaUrl` or `getTrustedUrl)` and sanitized.
* Any concatenation of values (which may or may not be trusted) results in a
  non-trusted type that will be handled by `getTrustedMediaUrl` or `getTrustedUrl` once the
  concatenation is complete.
  E.g. `"javascript:{{safeType}}"` is a concatenation of a non-trusted and a trusted value,
  which will be sanitized as a whole after unwrapping the `safeType` value.
* An interpolation containing no expressions will still be handled by `getTrustedMediaUrl` or
  `getTrustedUrl`, whereas before this would have been short-circuited in the `$interpolate`
  service. E.g. `"some/hard/coded/url"`. This ensures that `ngHref` and similar directives
  still securely, even if the URL is hard-coded into a template or index.html (perhaps by
  server-side rendering).

BREAKING CHANGES:

If you use `attrs.$set` for URL attributes (a[href] and img[src]) there will no
longer be any automated sanitization of the value. This is in line with other
programmatic operations, such as writing to the innerHTML of an element.

If you are programmatically writing URL values to attributes from untrusted
input then you must sanitize it yourself. You could write your own sanitizer or copy
the private `$$sanitizeUri` service.

Note that values that have been passed through the `$interpolate` service within the
`URL` or `MEDIA_URL` will have already been sanitized, so you would not need to sanitize
these values again.
2018-01-31 13:12:29 +00:00
Dmitriy a8830d2be4 feat(input): add drop event support (#16420) 2018-01-28 11:24:00 +00:00
Martin Staffa 8d9984e530 chore(docs-gen): generate list of versions in correct order
Closes #16419
2018-01-26 12:05:46 +01:00
Frederik Prijck 1d804645f7 feat(orderBy): consider null and undefined greater than other values
Previously, `null` values where sorted using type `string` resulting in a string
comparison. `undefined` values where compared to other values by type and were
usually considered greater than other values (since their type happens to start
with a `u`), but this was coincidental.

This commit ensures that `null` and `undefined ` values are explicitly
considered greater than other values (with `undefined` > `null`) and will
effectively be put at the end of the sorted list (for ascending order sorting).

Closes #15294

Closes #16376

BREAKING CHANGE:

When using `orderBy` to sort arrays containing `null` values, the `null` values
will be considered "greater than" all other values, except for `undefined`.
Previously, they were sorted as strings. This will result in different (but more
intuitive) sorting order.

Before:
```js
orderByFilter(['a', undefined, 'o', null, 'z']);
//--> 'a', null, 'o', 'z', undefined
```

After:
```js
orderByFilter(['a', undefined, 'o', null, 'z']);
//--> 'a', 'o', 'z', null, undefined
```
2018-01-25 13:16:48 +02:00
Martin Staffa 40c49902b6 docs(*): fix headings and links 2018-01-25 12:12:46 +01:00
Martin Staffa 7300a5311c chore(docs.angularjs.org): fix firebase deploy
Travis looks for the firebase.json in the repo root,
but we moved each firebase project in its own sub-folder.
To fix, we create a symlink before deployment.
2018-01-23 10:31:31 +01:00
Martin Staffa 4c97df5852 chore(code.angularjs.org): don't use trailing slashes, and don't set headers after response was sent 2018-01-19 13:57:26 +01:00
Martin Staffa 2ea1e49cd6 chore(code.angularjs.org): don't gzip the zip file before uploading 2018-01-19 13:57:25 +01:00
Martin Staffa c76b09beed chore(errors.angularjs.org): add project with redirects to docs.angularjs.org 2018-01-19 13:57:09 +01:00
Martin Staffa f9d29889c4 chore(docs.angularjs.org): move project in separate folder
Firebase projects should be in their own folder, because the firebase-tools
search for projects in the parent folder, which makes it more difficult to create
new projects.
2018-01-18 13:35:16 +01:00
Pete Bacon Darwin 50ceb23277 fix(ngMessages): prevent memory leak from messages that are never attached
Closes #16389
Closes #16404
Closes #16406
2018-01-17 14:57:32 +01:00
Martin Staffa ab386cdef2 fix(ngTransclude): remove terminal: true
This was introduced in commit 2adaff083f,
but made obsolete in 41f3269bfb.

Fixes #16411
Closes #16412
2018-01-17 12:03:05 +01:00
Martin Staffa 507185979f docs(ngRepeat): improve info about tracking
- deduplicate info between docs section and arguments
- don't draw too much attention to track by $index  ...
- ... but highlight its drawbacks
- add example to show how tracking affects collection updates
- clarify duplicates support for specific tracking expressions

Closes #16332
Closes #16334 
Closes #16397
2018-01-17 12:01:54 +01:00
Martin Staffa a7e5e83240 docs(*): clarify module API and dependency injection rules
Closes #16363
Closes #16395
2018-01-17 12:00:10 +01:00
Martin Staffa 3f95ae21ef chore(code.angularjs.org): resolve gcs file stream on 'finish'
'response' is called before the data transfer is complete.
2018-01-16 19:49:04 +01:00
Martin Staffa 00b482fd8b chore(docs.angularjs.org): copy unminified angular files
e2e tests use the unminified files even in production deployment
2018-01-16 19:49:04 +01:00
Deb Saunders 9ba3d0070d docs(guide/External Resources): remove link to deprecated content
Content at URL is deprecated.

Closes #16403
2018-01-15 18:26:26 +01:00
Frederik Prijck ddbf197ad9 docs(guide/Animations): fix minor typos
Closes #16409
2018-01-15 13:10:10 +01:00
Manuel Darveau 7a9b7ba913 docs(guide/Using $location): fix typo
Closes #16408
2018-01-15 13:08:24 +01:00
Martin Staffa 62e2ec18e6 chore(node): add karma launchers for Edge, IE, and Safari
That makes it easier to run the tests with these browsers locally.

Closes #16407
2018-01-15 13:07:45 +01:00
Peter Bacon Darwin b86876c4a2 fix($sanitize): sanitize xml:base attributes
On Firefox there is a XSS vulnerability if a malicious attacker
can write into the `xml:base` attribute on an SVG anchor.

Thanks to Masato Kinugawa at Cure23
2018-01-11 14:34:06 +01:00
Martin Staffa c7bea44107 chore(travis): test on 2 latest Safari versions 2018-01-11 13:29:19 +01:00
Martin Staffa 8510143a0e test(*): fix tests for Safari 10+
The mocksSpec change is due to the following issue in Safari 10+ strict mode:
In the following code, Safari will not use the name of the enclosing function (testCaller)
in the stack, but rather list the anonymous function that is called to inject:

```
function testCaller() {
  return inject(function() {
    throw new Error();
  });
}
var throwErrorFromInjectCallback = testCaller();
```

Naming the anonymous function allows us to check for it in the test.
2018-01-11 13:29:19 +01:00
Martin Staffa 6388a348e4 docs(guide/Controllers): fix headings; re-order info 2018-01-10 12:58:30 +01:00
Martin Staffa 2da4917af4 chore(node): update semver
Closes #16396
2018-01-09 12:57:45 +01:00
Martin Staffa 4ff51bf18e docs(vendor): add readme 2018-01-08 13:01:21 +01:00
Martin Staffa ba42cedce5 refactor(getVersion.js): remove unused parameters
The parameters have been unused since we moved most of the bower
package dependencies to npm
2018-01-08 13:01:21 +01:00
Michał Gołębiowski-Owczarek ff2ce9ddde chore(*): get rid of Bower in favor of Yarn aliases & checked-in packages
Bower was used to install multiple versions of jQuery which is now handled
using Yarn aliases. The remaining two packages, closure-compiler and
ng-closure-compiler were installed from zip files which is not supported by Yarn
(see https://github.com/yarnpkg/yarn/issues/1483); the first of them exists
on npm as the google-closure-compiler but only versions newer than we used are
published and they don't work with ng-closure-compiler so - instead - both were
checked in to the repository.

Fixes #16268
Fixes #14961
Ref yarnpkg/yarn#1483
2018-01-08 13:01:21 +01:00
Martin Staffa 8da3aef91c chore(node): update karma to 2.0.0
Also reduce karma log level on Travis to INFO.
Before, the log level was DEBUG, but it seems that
prior to karma 2.0.0, the debug messages were not outoput on Karma,
so this simply restores the status quo (and prevents cluttering the log).
2018-01-08 10:41:06 +01:00
Martin Staffa 8988157861 chore(node): update jasmine to 2.8.0, and adjust tests 2018-01-08 10:41:06 +01:00
Martin Staffa d253c9d45c test($sanitize): skip nextSibling clobber test on Edge 16
In some circumstances, Edge 16 will not throw on clobbered
elements, because the nextSibling property is null. The exact
cause is currently unknown.
2018-01-08 10:41:06 +01:00
Martin Staffa 07d84dd85f chore(*): update copyright year
Closes #16386
2018-01-05 21:06:09 +01:00
Martin Staffa 88cb9af594 docs(DEVELOPERS.md): improve testing section 2018-01-03 18:19:05 +01:00
Sergey Kryvets e942e1e988 docs(developers.md): update node version as specified in package.json
Closes #16384
2017-12-29 17:48:35 +01:00
Georgii Dolzhykov 96dd35afb6 docs(ngModel.NgModelController): correct description for $viewChangeListeners
It was misleading.

Closes #16382
2017-12-29 14:30:31 +01:00
Frederik Prijck 9a521cb3ad docs(PULL_REQUEST_TEMPLATE.md): fix broken links in PR template
Closes #16377
2017-12-19 18:29:53 +01:00
Georgios Kalpakas 62743a54b7 feat(currencyFilter): trim whitespace around an empty currency symbol
In most locales, this won't make a difference (since they do not have
whitespace around their currency symbols). In locales where there is a
whitespace separating the currency symbol from the number, it makes
sense to also remove such whitespace if the user specified an empty
currency symbol (indicating they just want the number).

Fixes #15018
Closes #15085

Closes #15105
2017-12-19 11:29:33 +02:00
Martin Staffa 22450e5b7c docs(CHANGELOG.md): add changes for 1.6.8 2017-12-18 16:15:06 +01:00
George Kalpakas 240a3ddbf1 feat($resource): add support for request and requestError interceptors (#15674)
This commit adds `request` and `requestError` interceptors for `$resource`, as
per the documentation found for `$http` interceptors. It is important to note
that returning an error at this stage of the request - before the call to
`$http` - will completely bypass any global interceptors and/or recovery
handlers, as those are added to a separate context. This is intentional;
intercepting a request before it is passed to `$http` indicates that the
resource itself has made a decision, and that it accepts the responsibility for
recovery.

Closes #5146

BREAKING CHANGE:

Previously, calling a `$resource` method would synchronously call
`$http`. Now, it will be called asynchronously (regardless if a
`request`/`requestError` interceptor has been defined.

This is not expected to affect applications at runtime, since the
overall operation is asynchronous already, but may affect assertions in
tests. For example, if you want to assert that `$http` has been called
with specific arguments as a result of a `$resource` call, you now need
to run a `$digest` first, to ensure the (possibly empty) request
interceptor promise has been resolved.

Before:
```js
it('...', function() {
  $httpBackend.expectGET('/api/things').respond(...);
  var Things = $resource('/api/things');
  Things.query();

  expect($http).toHaveBeenCalledWith(...);
});
```

After:
```js
it('...', function() {
  $httpBackend.expectGET('/api/things').respond(...);
  var Things = $resource('/api/things');
  Things.query();
  $rootScope.$digest();

  expect($http).toHaveBeenCalledWith(...);
});
```
2017-12-18 12:48:15 +00:00
Martin Staffa 7df29521d8 refactor($location): remove obsolete workaround for Firefox bug
The bug was fixed in Firefox 48: https://bugzilla.mozilla.org/show_bug.cgi?id=684208,
and only affected the scenario runner
2017-12-14 11:50:36 +01:00
Martin Staffa 167766a5dd docs(*): add browserTrigger docs; remove references to scenario runner 2017-12-14 11:50:36 +01:00
Martin Staffa 0cd3921782 fix(ngScenario): completely remove the angular scenario runner
The runner has been deprecated and undocumented since 2014:
See commit 8d6d126899d4b1927360599403a7592011243270

Closes #9405

BREAKING CHANGE:

The angular scenario runner end-to-end test framework has been
removed from the project and will no longer be available on npm
or bower starting with 1.7.0.
It was deprecated and removed from the documentation in 2014.
Applications that still use it should migrate to
[Protractor](http://www.protractortest.org).
Technically, it should also be possible to continue using an
older version of the scenario runner, as the underlying APIs have
not changed. However, we do not guarantee future compatibility.
2017-12-14 11:50:36 +01:00
Martin Staffa f6e60c14c0 docs(ngForm): clarify usage and limitations 2017-12-13 19:23:49 +01:00
Martin Staffa 223de59e98 fix(form): set $submitted to true on child forms when parent is submitted
Closes #10071

BREAKING CHANGE:

Forms will now set $submitted on child forms when they are submitted.
For example:
```
<form name="parentform" ng-submit="$ctrl.submit()">
  <ng-form name="childform">
    <input type="text" name="input" ng-model="my.model" />
  </ng-form>
  <input type="submit" />
</form>

Submitting this form will set $submitted on "parentform" and "childform".
Previously, it was only set on "parentform".

This change was introduced because mixing form and ngForm does not create
logically separate forms, but rather something like input groups.
Therefore, child forms should inherit the submission state from their parent form.
2017-12-13 19:23:49 +01:00
Jason Bedard 5c38fb744e test($rootScope): test recursive event broadcast and emit 2017-12-13 11:45:31 +01:00
Jason Bedard 97d0224ae6 fix($rootScope): fix potential memory leak when removing scope listeners
When removing listeners they are removed from the array but the array size
is not changed until the event is fired again. If the event is never fired
but listeners are added/removed then the array will continue growing.

By changing the listener removal to `delete` the array entry instead of setting
it to `null` browsers can potentially deallocate the memory for the entry.

Fixes #16135
Closes #16161
2017-12-13 11:45:31 +01:00
Jason Bedard e5fb92978f revert: fix($rootScope): fix potential memory leak when removing scope listeners
This reverts commit 817ac56719.
2017-12-13 11:45:31 +01:00
Peter Bacon Darwin 41d5c90f17 feat($rootScope): allow suspending and resuming watchers on scope
This can be very helpful for external modules that help making the digest
loop faster by ignoring some of the watchers under some circumstance.
Example: https://github.com/shahata/angular-viewport-watch

Thanks to @shahata for the original implementation.

Closes #5301
2017-12-11 19:48:03 +00:00
Peter Bacon Darwin 2c1e58984b fix($location): always decode special chars in $location.url(value)
The original fix for #16312 included changing how `$location.url(value)`
decoded the special characters passed to it as a setter.
This broke a number of use cases (mostly involving the ui-router).

Further analysis appears to show that we can solve #16312, to prevent
urls being rewritten with decoded values, without modifying the
behaviour of `$location.url`.

This commit reverts changes to `$location.url(value)` so that encoded
chars will once again be decoded and passed to `$location.path(value)`.
In particular it will convert encoded forward slashes, which changes how
the path is updated, since e.g. `a/b/%2Fc%2Fd` will become `a/b/c/d`.
While this is arguably not "correct", it appears that there are too many
use cases relying upon this behaviour.
2017-12-11 19:41:14 +00:00
Martin Staffa 6d5ef34fc6 fix(ngAria): do not set aria attributes on input[type="hidden"]
This fixes a error found by @edclements  using the Google Accessibility Developer Tools audit.
Input fields of type hidden shouldn't have aria attributes.
https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties-1

Closes #15113 
Closes #16367

BREAKING CHANGE:

ngAria no longer sets aria-* attributes on input[type="hidden"] with ngModel.
This can affect apps that test for the presence of aria attributes on hidden inputs.
To migrate, remove these assertions.
In actual apps, this should not have a user-facing effect, as the previous behavior 
was incorrect, and the new behavior is correct for accessibility.
2017-12-11 19:27:47 +01:00
John Hampton 00815db8ef docs(ng-model-options): remove extra quotes in example
Remove unnecessary quotes around attribute directive name in the docs example.  This syntax is incorrect.

Closes #16362
2017-12-11 10:55:47 +02:00
Michał Gołębiowski-Owczarek a61c5d382e chore(*): bump Yarn in Jenkins init-node script
Without it Jenkins builds are broken.

Closes #16365
2017-12-07 20:27:35 +01:00
Michał Gołębiowski-Owczarek a7688100e3 build(*): update Node from 6 to 8, update Yarn
Angular (2+) switched to Node 8 and so should we.

Closes #16360
Ref angular/angular#20807
Ref angular/angular#20832
2017-12-07 19:26:32 +01:00
Martin Staffa dde520e02a docs(ngModelOptions): fix link text 2017-12-07 11:51:03 +01:00
Jason Bedard 394b185416 refactor($rootScope): consistently use noop as the default $watch listener
Closes #16343
2017-12-05 22:26:20 +01:00
Martin Staffa da72477701 fix(ngModelController): allow $overrideModelOptions to set updateOn
Also adds more docs about "default" events and how to override
ngModelController options.

Closes #16351
Closes #16352
2017-12-05 20:07:45 +01:00
Martin Staffa 74b04c9403 fix(ngModel, input): improve handling of built-in named parsers
This commit changes how input elements use the private $$parserName
property on the ngModelController to name parse errors. Until now,
the input types (number, date etc.) would set $$parserName when
the inputs were initialized, which meant that any other parsers on
the ngModelController would also be named after that type. The
effect of that was that the `$error` property and the `ng-invalid-...`
class would always be that of the built-in parser, even if the custom
parser had nothing to do with it.

The new behavior is that the $$parserName is only set if the built-in
parser is invalid i.e. returns `undefined`.

Also, $$parserName has been removed from input[email] and input[url],
as these types do not have a built-in parser anymore.

Closes #14292
Closes #10076
Closes #16347

BREAKING CHANGE:

*Custom* parsers that fail to parse on input types "email", "url", "number", "date", "month",
"time", "datetime-local", "week", do no longer set `ngModelController.$error[inputType]`, and
the `ng-invalid-[inputType]` class. Also, custom parsers on input type "range" do no
longer set `ngModelController.$error.number` and the `ng-invalid-number` class.

Instead, any custom parsers on these inputs set `ngModelController.$error.parse` and
`ng-invalid-parse`. This change was made to make distinguishing errors from built-in parsers
and custom parsers easier.
2017-12-04 11:17:32 +01:00
Francesco Pipita 2e03aedc85 feat($parse): add a hidden interface to retrieve an expression's AST
This PR adds a new private method to the `$parse` service, `$$getAst`,
which takes an Angular expression as its only argument and returns
the computed AST. This feature is not meant to be part of the public
API and might be subject to changes, so use it with caution.

Closes #16253

Closes #16260
2017-11-30 15:59:30 +02:00
Peter Bacon Darwin 199d888b84 fix($location): decode non-component special chars in Hashbang URLS
Fixes https://github.com/angular/angular.js/pull/16316#issuecomment-347527097
2017-11-30 13:22:38 +00:00
Martin Staffa 8b69d91fff chore(travis): fix deployment condition to include tagged commits
Tagged commits are not considered to belong to any branch.

Closes #16346
2017-11-29 15:45:59 +01:00
jugglinmike 0fa5a37838 docs(ngNonBindable): document effect on the element's directives
The phrase "contents of the current DOM element" may be interpreted either as
inclusive of the DOM element's attributes or as exclusive of the attributes.
This situation concerns markup such as:

    <div ng-non-bindable ng-controller="MyController"></div>

In practice, AngularJS does not compile or bind attribute values for elements
which specify the `ng-non-bindable` directive. Extend the documentation to
definitely describe this behavior.

Closes #16338
2017-11-27 13:11:50 +01:00
Martin Staffa 07e475137e docs(CHANGELOG.md): add changes for 1.6.7 2017-11-24 09:31:19 +01:00
Jason Bedard 5838017f26 refactor($rootScope): simplify $emit stopPropagation handling
See https://github.com/angular/angular.js/pull/16293#discussion_r147960028

Closes #16339
2017-11-24 09:25:33 +01:00
Michał Gołębiowski-Owczarek f2f5ac7ce4 chore(*): normalize Vojta's email in .mailmap correctly
Closes #16340
2017-11-22 13:24:56 +01:00
Martin Staffa 55ba44913e feat(ngModelOptions): add debounce catch-all + allow debouncing 'default' only
Closes #15411
Closes #16335

BREAKING CHANGE:

the 'default' key in 'debounce' now only debounces the default event, i.e. the event
that is added as an update trigger by the different input directives automatically.

Previously, it also applied to other update triggers defined in 'updateOn' that
did not have a corresponding key in the 'debounce'.

This behavior is now supported via a special wildcard / catch-all key: '*'.

See the following example:

Pre-1.7:
'mouseup' is also debounced by 500 milliseconds because 'default' is applied:
```
ng-model-options="{
  updateOn: 'default blur mouseup',
  debounce: { 'default': 500, 'blur': 0 }
}
```

1.7:
The pre-1.7 behavior can be re-created by setting '*' as a catch-all debounce value:
```
ng-model-options="{
  updateOn: 'default blur mouseup',
  debounce: { '*': 500, 'blur': 0 }
}
```

In contrast, when only 'default' is used, 'blur' and 'mouseup' are not debounced:
```
ng-model-options="{
  updateOn: 'default blur mouseup',
  debounce: { 'default': 500 }
}
```
2017-11-21 13:50:25 +01:00
Martin Staffa aa3f951330 fix(input[number]): validate min/max against viewValue
This brings the validation in line with HTML5 validation, i.e. what the user has entered
is validated, and not a possibly transformed value.

Fixes #12761
Closes #16325

BREAKING CHANGE

`input[type=number]` with `ngModel` now validates the input for the `max`/`min` restriction against
the `ngModelController.$viewValue` instead of against the `ngModelController.$modelValue`.

This affects apps that use `$parsers` or `$formatters` to transform the input / model value.

If you rely on the $modelValue validation, you can overwrite the `min`/`max` validator from a custom directive, as seen in the following example directive definition object:

```
{
  restrict: 'A',
  require: 'ngModel',
  link: function(scope, element, attrs, ctrl) {
    var maxValidator = ctrl.$validators.max;

    ctrk.$validators.max = function(modelValue, viewValue) {
      return maxValidator(modelValue, modelValue);
    };
  }
}
```
2017-11-17 12:28:03 +01:00
Denys B 12cf994fcc fix($compile): sanitize special chars in directive name
This fixes regression bug
when directive name with preceeding special char
in HTML markup does not match the registered name.
(introduced in https://github.com/angular/angular.js/commit/73050cdda04675bfa6705dc841ddbbb6919eb048)

Closes #16314
Closes #16278
2017-11-17 11:55:18 +01:00
kirk 873e26347f docs(linky): mark "target" param as optional
This argument is optional in practice, and it is not provided in many of the examples in the
documentation. Its optional presence is handled here:
https://github.com/angular/angular.js/blob/f876ab71913e17e9126baad19ab795f28b61bfe6/src/ngSanitize/filter/linky.js#L185

Closes #16330
2017-11-17 11:47:18 +01:00
Frederik Prijck f876ab7191 docs(*): remove usage of global grunt-cli
Previously, the `DEVELOPERS.md` and `CONTRIBUTING.md` files
refered to global `grunt-cli` by default.

This commit ensures the local `grunt-cli` is used by default
and mentiones the possibility to still use the global `grunt-cli`.
2017-11-11 14:10:53 +01:00
Martin Staffa 181ac0b7a1 docs(*): update CONTRIBUTING.md and create DEVELOPERS.md
CONTRIBUTING.md
- focus on basic info about issues and pull requests for new contributors
- move development heavy info to DEVELOPERS.md + add links
- remove outdated info

DEVELOPERS.md
- contains info about project setup, coding rules, and commit message guidelines from CONTRIBUTING.md
- add and update info about writing docs from Wiki
- add info about development setup from docs contribute.md
- add info about running tests on Saucelabs / Browserstack

Closes #7303
Closes #9444 
Closes #16297
2017-11-03 12:41:54 +01:00
Peter Bacon Darwin 0cbc505121 fix($location): do not decode forward slashes in the path in HTML5 mode
Closes #16312
2017-11-03 11:03:19 +00:00
Peter Bacon Darwin 667db466f9 fix(sanitizeUri): sanitize URIs that contain IDEOGRAPHIC SPACE chars
Browsers mutate attributes values such as `&#12288;javascript:alert(1)`
when they are written to the DOM via `innerHTML` in various vendor specific
ways.

In Chrome (<62), this mutation removed the preceding "whitespace" resulting
in a value that could end up being executed as JavaScript.

Here is an example of what could happen:
https://plnkr.co/edit/Y6EsbsuDgd18YTn1oARu?p=preview
If you run that in Chrome 61 you will get a dialog box pop up.

There is background here:
http://www.nds.rub.de/media/emma/veroeffentlichungen/2013/12/10/mXSS-CCS13.pdf

The sanitizer has a bit of code that triggers this mutation on an inert piece
of DOM, before we try to sanitize it:
https://github.com/angular/angular.js/blob/817ac567/src/ngSanitize/sanitize.js#L406-L417

Chrome 62 does not appear to mutate this particular string any more, instead
it just leaves the "whitespace" in place. This probably means that Chrome 62
is no longer vulnerable to this specific attack vector; but there may be
other mutating strings that we haven't found, which are vulnerable.

Since we are leaving the mXSS check in place, the sanitizer should still
be immune to any strings that try to utilise this attack vector.

This commit uses `trim()` to remove the IDEOGRAPHIC SPACE "whitespace"
before sanitizing, which allows us to expose this mXSS test to all browsers
rather than just Chrome.

Closes #16288
2017-11-03 10:13:59 +00:00
Lisa Pfisterer 2c9c3a0784 docs(guide/Unit Testing): change $scope = {} to $scope = $rootScope.$new()
{} will just create an empty object. This will break if the module uses for example $watch or others.
While it's not necessary for this example, it's good general practice.

Closes #16315
2017-11-02 17:23:20 +01:00
Jason Bedard 817ac56719 fix($rootScope): fix potential memory leak when removing scope listeners
Previously the array entry for listeners was set to null but the array size was
not trimmed until the event was broadcasted again (see e6966e05f5).

By keeping track of the listener iteration index globally it can be adjusted if
a listener removal effects the index.

Fixes #16135
Closes #16293

BREAKING CHANGE:

Recursively invoking `$emit` or `$broadcast` with the same event name is
no longer supported. This will now throw a `inevt` minErr.
2017-10-31 21:36:58 -07:00
Martin Staffa 0864f73458 docs($compileProvider): improve strictComponentBindingsEnabled info
Related to #16303 
Closes #16306
2017-10-30 11:23:44 +01:00
Jason Bedard c15c8a1380 test($rootScope): test removal of event listeners during event broadcast 2017-10-27 20:52:30 -07:00
Martin Staffa 9871ada04b chore(travis): tighten up deploy conditions 2017-10-26 14:25:45 +02:00
Martin Staffa 202f1809ad chore(travis): fix deploy conditions
Closes #16296
2017-10-25 10:44:55 +02:00
Martin Staffa 32fbb2e78f chore(travis): split unit test into 'core' and 'jquery'
"unit-core" consists of code+jqlite, module test, and promise A+ tests.
"unit-jquery" is code+jquery
"docs-app" includes unit and e2e tests

Splitting the unit tests into more than one job makes it faster
to rerun jobs that fail because Safari or Edge cannot complete the
suite, which seemingly happens on random.

Closes #16292
2017-10-23 12:53:36 +02:00
Sagir Khan 9ba07e974a docs(tutorial/step_14): replace broken web platform docs link
Replace broken [webplatform-animations][1] link with [mdn-animations][2].

The original link returns a 404. The closest match that works is
https://webplatform.github.io/docs/css/properties/animation. However,
the notice at the top of the page reads:

> The WebPlatform project, supported by various stewards between 2012
> and 2015, has been discontinued.

The CSS animations guide on MDN web docs is not only current, but also
more comprehensive.

[1]: https://docs.webplatform.org/wiki/css/properties/animations
[2]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations

Closes #16294
2017-10-23 11:45:05 +03:00
Martin Staffa dfcb5ac1e4 chore(travis): deploy to docs and code when distTag=latest
We now deploy to code.angularjs.org and docs.angularjs.org
when we are on the branch which has distTag=latest set in the
package.json, i.e. the stable branch.

Previously, we deployed to docs only when distTag=latest and
the commit was tagged, and to code only on the master branch.
2017-10-20 13:17:20 +02:00
Martin Staffa 10b48094d7 chore(doc-gen, docs-app): generate "stable snapshot" for distTag=latest
The "stable snapshot" is the current state of the branch that has
distTag=latest, i.e. a preview of the next patch version of the stable branch.
2017-10-20 13:17:20 +02:00
Martin Staffa 0f0a16ec40 chore(travis): remove unnessecary addons
The "Trusty" build environment on Travis includes these addons,
see https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements

Closes  #16286
2017-10-19 11:51:30 +02:00
Martin Staffa 84294ec1fc chore(travis): unit-test latest & latest-1 Chrome, FF, Edge
Previously, we used fixed versions that became outdated quickly for
FF and Chrome.

Safari 10/11 is not included because during the latest test there were 
failures, see https://github.com/angular/angular.js/pull/15717

Jasmine is fixed to 2.5.2 because 2.6.0+ is not compatible with the suite:
https://github.com/angular/angular.js/pull/15927#issuecomment-309206419

Closes #15927
2017-10-18 13:52:47 +02:00
Martin Staffa 69e0968309 chore(doc-gen): add directive names that aren't params to usage section
When a directive can be used as an attribute or CSS class, but doesn't take 
a value, its name is not included in the parameters, which previously meant 
that the directive name was missing from the Attribute / CSS Class usage 
section of the docs.

This commit adds the name to the Usage section when it is missing
from the parameters.

Closes #14045
Closes #16265
2017-10-18 13:29:50 +02:00
Martin Staffa bf758d0bef chore(node): update karma-sauce-launcher
Related to #14961
Closes #16281
2017-10-16 11:51:00 +02:00
Martin Staffa 00936ad12b docs(select.SelectController): fix example
Closes #16271
Closes #16275
2017-10-13 16:57:21 +02:00
Martin Staffa 656c8fa8f2 fix(input): listen on "change" instead of "click" for radio/checkbox ngModels
input[radio] and inout[checkbox] now listen on the change event instead
of the click event. This fixes issue with 3rd party libraries that trigger
a change event on inputs, e.g. Bootstrap 3 custom checkbox / radio button
toggles.
It also makes it easier to prevent specific events that can cause a checkbox / radio
to change, e.g. click events. Previously, this was difficult because the custom click
handler had to be registered before the input directive's click handler.

It is possible that radio and checkbox listened to click because IE8 has
broken support for listening on change, see http://www.quirksmode.org/dom/events/change.html

Closes #4516
Closes #14667
Closes #14685

BREAKING CHANGE:

`input[radio]` and `input[checkbox]` now listen to the "change" event instead of the "click" event.
Most apps should not be affected, as "change" is automatically fired by browsers after "click"
happens.

Two scenarios might need migration:

- Custom click events:

Before this change, custom click event listeners on radio / checkbox would be called after the
input element and `ngModel` had been updated, unless they were specifically registered before
the built-in click handlers.
After this change, they are called before the input is updated, and can call event.preventDefault()
to prevent the input from updating.

If an app uses a click event listener that expects ngModel to be updated when it is called, it now
needs to register a change event listener instead.

- Triggering click events:

Conventional trigger functions:

The change event might not be fired when the input element is not attached to the document. This
can happen in **tests** that compile input elements and
trigger click events on them. Depending on the browser (Chrome and Safari) and the trigger method,
the change event will not be fired when the input isn't attached to the document.

Before:

```js
    it('should update the model', inject(function($compile, $rootScope) {
      var inputElm = $compile('<input type="checkbox" ng-model="checkbox" />')($rootScope);

      inputElm[0].click(); // Or different trigger mechanisms, such as jQuery.trigger()
      expect($rootScope.checkbox).toBe(true);
    });
```

With this patch, `$rootScope.checkbox` might not be true, because the click event
hasn't triggered the change event. To make the test, work append the inputElm to the app's
`$rootElement`, and the `$rootElement` to the `$document`.

After:

```js
    it('should update the model', inject(function($compile, $rootScope, $rootElement, $document) {
      var inputElm = $compile('<input type="checkbox" ng-model="checkbox" />')($rootScope);

      $rootElement.append(inputElm);
      $document.append($rootElement);

      inputElm[0].click(); // Or different trigger mechanisms, such as jQuery.trigger()
      expect($rootScope.checkbox).toBe(true);
    });
```

`triggerHandler()`:

If you are using this jQuery / jqLite function on the input elements, you don't have to attach
the elements to the document, but instead change the triggered event to "change". This is because
`triggerHandler(event)` only triggers the exact event when it has been added by jQuery / jqLite.
2017-10-13 15:39:53 +02:00
Martin Staffa 5462373b5b chore($resource): remove undocumented API
This code has been in the $resource service since 2010, but was
never documented and can therefore be removed. It'll save precious bytes!

Shout-out to @gkalpak for finding this

Closes #16267
2017-10-13 15:36:32 +02:00
Dmitriy 5f76bc6097 feat($sanitize, $compileProvider, linky): add support for the "sftp" protocol in links
Add support for the sftp protocol in the linky filter and the "aHrefSanitizationWhitelist" that is used by $sanitize and can be configured in the $compileProvider.

Closes #16102
2017-10-11 15:10:07 +02:00
Martin Staffa c8d3498708 docs(ngPattern): add option of specifying literal RegExp
Closes #15929
2017-10-11 14:36:05 +02:00
Martin Staffa 2cb0318c1c docs(ngInit): clarify when it's okay to use ngInit
Closes #10489
2017-10-11 14:36:05 +02:00
Martin Staffa 2c8bfd8a08 docs(*): add / correct @-tags; fix headlines; add info
- add / correct `@param`, `@restrict`, `@element`, `@priorìty` to directives
- use `@animations` instead of manual headings
- fix more incorrect h1 headings
- fix incorrectly indented `<examples>`
- add some info to $templateCache and $templateRequest
2017-10-11 14:36:05 +02:00
Martin Staffa e5c6174839 docs(*): fix heading levels; use @example instead of headings
This ensures the doc-gen creates correct headlines and
table of contents entries.
2017-10-05 14:06:08 +02:00
Martin Staffa f05f548546 chore(doc-gen): improve headings for events and examples
The "Events" heading now gets an id (which makes them show in
the table of contents, and their "Parameters" use a heading with
a lower priority (previously it was the same as "Events" itself).

The "@example" tag now generates the heading "Example" if there's
only one, or "Examples" if there are multiple.
2017-10-05 14:06:08 +02:00
Michał Gołębiowski-Owczarek 8166dd40e4 chore(*): add a Git .mailmap with my new name
In this way:
* my past contributions are mapped correctly
* other people's distinct entries are collapsed into one

Closes #16254
2017-10-04 23:24:47 +02:00
Martin Staffa 0822d34b10 refactor(api-pages.scenario.js): remove misleading describe block 2017-10-04 15:48:33 +02:00
Martin Staffa 87273022f2 docs(*): fix heading levels and general clean-up
- docs pages should only have one h1
- docs pages shouldn't skip a h* in the hierarchy
- manual table of contents are no longer necesary
- references to the doc-module-components directive are obsolete
2017-10-04 15:48:33 +02:00
Martin Staffa ddd78bd3e4 chore(docs-app): add table of contents to individual pages 2017-10-04 15:48:33 +02:00
Martin Staffa 05fdf918d9 feat(ngModel.NgModelController): expose $processModelValue to run model -> view pipeline
Closes #3407
Closes #10764
Closes #16237
2017-09-29 13:12:18 +02:00
Trotyl Yu 6eb15cb114 docs(changelog): fix typo
Closes #16242
2017-09-25 17:14:22 +02:00
Peter Bacon Darwin 72a87ceda7 fix(http): do not allow encoded callback params in jsonp requests 2017-09-23 23:14:05 +01:00
George Kalpakas 6d997f56a3 chore(doc-gen): fix script paths in plnkr for examples with deps
Closes #16238
2017-09-22 23:22:56 +03:00
Craig Leyshan 34237f9299 feat($injector): ability to load new modules after bootstrapping
The new method `$injector.loadNewModules(modules)` will add each of the
injectables to the injector and execute all of the config and run blocks
for each module passed to the method.

* The application developer is responsible for loading the code containing
the modules.
* Modules cannot be unloaded.
* Previously loaded modules will not be reloaded.
* Previously compiled HTML will not be affected by newly loaded directives,
filters and components.
2017-09-21 13:52:46 +01:00
ImgBotApp 7e5a12e2c1 docs(*): optimize images
\docs\app\assets\img\AngularJS-small.png (1.82%)
\docs\img\One_Way_Data_Binding.png (12.15%)
\docs\img\guide\di_sequence_final.png (19.05%)
\docs\app\assets\img\bullet.png (13.68%)
\images\docs\Diagrams.svg\image1.png (1.73%)
\docs\img\angular_parts.png (30.41%)
\images\docs\tutorial\tutorial_06.svg\image15.png (1.55%)
\docs\img\Two_Way_Data_Binding.png (11.59%)
\docs\img\guide\concepts-databinding2.png (7.54%)
\images\docs\Diagrams.svg\image4.png (1.89%)
\images\docs\Diagrams.svg\image2.png (1.93%)
\images\docs\Diagrams.graffle\image9.png (2.12%)
\docs\img\guide\concepts-module-injector.png (2.41%)
\docs\img\guide\hero-detail.png (41.79%)
\images\docs\tutorial\tutorial_09.graffle\image9.png (7.86%)
\images\docs\Diagrams.svg\image9.png (2.12%)
\images\docs\guide\concepts.graffle\image4.png (10.43%)
\docs\img\guide\scenario_runner.png (37.15%)
\docs\img\guide\concepts-directive.png (1.05%)
\docs\img\guide\concepts-databinding1.png (8.75%)
\images\docs\guide\concepts.graffle\image1.png (9%)
\images\docs\tutorial\tutorial_09.svg\image9.png (15.35%)
\docs\img\form_data_flow.png (6.68%)
\docs\img\guide\heroes-list.png (40.81%)
\images\docs\guide\concepts.graffle\image5.png (12.02%)
\docs\img\guide\simple_scope_final.png (0.51%)
\docs\img\guide\concepts-startup.png (3.22%)
\docs\img\tutorial\tutorial_12.png (10.49%)
\images\docs\guide\concepts.svg\image4.png (10.43%)
\images\docs\Diagrams.graffle\image4.png (1.89%)
\docs\img\tutorial\tutorial_05.png (11.11%)
\docs\img\tutorial\catalog_screen.png (0.46%)
\images\docs\tutorial\tutorial_10.graffle\image10.png (5.73%)
\images\docs\tutorial\simple_scope.graffle\image7.png (43.81%)
\images\docs\guide\simple_scope.graffle\image7.png (43.81%)
\images\docs\tutorial\tutorial_02.graffle\image11.png (0.19%)
\docs\img\guide\crisis-list.png (39.68%)
\docs\img\guide\concepts-runtime.png (2.48%)
\images\docs\guide\concepts.svg\image5.png (12.02%)
\docs\img\guide\concepts-view.png (2.98%)
\images\docs\tutorial\tutorial_02.svg\image11.png (28.1%)
\docs\img\tutorial\tutorial_00.png (10.99%)
\docs\img\tutorial\tutorial_06.png (11.3%)
\docs\img\guide\crisis-detail.png (38.86%)
\docs\img\guide\concepts-scope-watch-strategies.png (7.59%)
\images\docs\guide\simple_scope.svg\image7.png (43.81%)
\docs\img\tutorial\tutorial_09.png (10.7%)
\images\docs\tutorial\tutorial_12.svg\image10.png (25.88%)
\images\docs\tutorial\tutorial_10.svg\image10.png (25.88%)
\images\logo\AngularJS.exports\AngularJS-large.png (3.86%)
\images\docs\Diagrams.graffle\image1.png (1.73%)
\images\docs\tutorial\tutorial_03.svg\image11.png (28.1%)
\docs\img\tutorial\tutorial_10.png (10.44%)
\images\docs\tutorial\tutorial_proto.graffle\image7.png (43.81%)
\images\docs\tutorial\simple_scope.svg\image7.png (43.81%)
\images\logo\AngularJS.exports\AngularJS-small.png (3.64%)
\images\docs\tutorial\tutorial_proto.svg\image7.png (43.81%)
\docs\img\tutorial\tutorial_02.png (10.91%)
\images\docs\tutorial\tutorial_05.graffle\image13.png (10.92%)
\images\logo\AngularJS-Shield.exports\AngularJS-Shield-large.png (5.3%)
\docs\img\tutorial\tutorial_03.png (10.77%)
\images\docs\tutorial\tutorial_05.svg\image13.png (3.46%)
\images\logo\AngularJS.graffle\image1.png (0.55%)
\images\docs\Diagrams.graffle\image2.png (1.93%)
\images\docs\tutorial\tutorial_12.graffle\image10.png (5.73%)
\images\logo\AngularJS-Shield.exports\AngularJS-Shield-huge.png (2.99%)
\images\docs\tutorial\tutorial_06.graffle\image15.png (16.51%)
\images\logo\AngularJS.graffle\image2.png (5.21%)
\docs\img\guide\hashbang_vs_regular_url.jpg (32.92%)
\images\logo\AngularJS-Shield.exports\AngularJS-Shield-medium.png (6.18%)
\images\logo\AngularJS-Shield.exports\AngularJS-Shield-small.png (6.58%)
\images\logo\AngularJS.exports\AngularJS-medium.png (3.37%)
\images\logo\AngularJS.exports\AngularJS-huge.png (3.56%)

Closes #16222
2017-09-21 13:48:06 +01:00
Michał Gołębiowski-Owczarek da6ae8b4b6 docs(*): don't hide results for middle-clicks
Middle-clicking opens a link in a new tab; it shouldn't close the results list
as the user may want to open more of those links.

Closes #16233
2017-09-21 13:13:42 +02:00
Michał Gołębiowski-Owczarek efaf59f988 chore(jqLite): fix $destroy describe block titles 2017-09-20 14:02:53 +02:00
Marcin Wosinek f18dd2957c fix(ngMock): pass unexpected request failures in $httpBackend to the error handler
Closes #16150
Closes #15855
2017-09-18 21:01:14 +01:00
Jason Bedard 97b00ca497 perf($rootScope): allow $watchCollection use of expression input watching
By adding a $$pure flag to the $watchCollectionInterceptor to shallow
watch all inputs regardless of type when watching an object/array
literal.
2017-09-18 12:50:33 -07:00
Jason Bedard 57280768e1 perf(jqLite): avoid setting class attribute when not changed 2017-09-17 13:28:59 -07:00
Jason Bedard bf60182df1 perf(jqLite): avoid repeated add/removeAttribute in jqLiteRemoveClass
Fixes #16078
Closes #16131
2017-09-17 13:28:59 -07:00
Fengwei Wang 8f61cf631a docs(guide/bootstrap): fix typo ('There a few things' --> 'There are a few things')
Closes #16221
2017-09-11 14:36:21 +03:00
melbourne2991 21a2f4bb23 docs(input[checkbox]): fix @param type for ngChange
Closes #16219
2017-09-07 15:44:19 +03:00
Martin Staffa 20590c0bd0 fix(ngAnimate): don't close animations when child transitions close 2017-09-06 16:16:55 +02:00
Martin Staffa 2f7fad5f9f fix(ngMock.browserTrigger): add 'bubbles' to Transition/Animation Event
When the event objects are created synthetically, the bubbles property is set to false
if not explicitly defined
2017-09-06 16:16:55 +02:00
Yonatan Kra ecc09a45f0 docs(guide/expression): add clarification for RegExp literal in ngPattern expression
The `ngPattern` expression does accept a RegExp created with literal notation,
hence it should be mentioned as an exception to the
"No RegExp Creation With Literal Notation" rule.

Closes #16206
2017-09-05 15:34:18 +03:00
frederikprijck 3651e42e49 docs(*): replace master/slave with leader/follower
Previously, the docs made use of `master/slave`, which is offensive.

This commit removes the usage of these terms and replace them with `leader/follower`.
2017-08-28 10:10:54 +01:00
Oscar Busk 233a93f6e0 docs($compileProvider): add more info on debugInfoEnabled()
Add more info on what `debugInfoEnabled()` affects.

Closes #16154
2017-08-23 22:11:01 +03:00
Oscar Busk 59a9c1319d docs(guide/production): add more info on debugInfoEnabled()
Add bullet mentioning how placeholder comments are affected.

Closes #16155
2017-08-23 18:56:45 +03:00
Martin Staffa 66dff7cf5f chore(docs.angularjs.org): fix docs deploy for source file changes
Since the embedded examples in the docs app now include the local source files instead
of CDN files, we need to include the source files into the folder that is deployed
to Firebase hosting
2017-08-23 11:52:46 +02:00
Martin Staffa 3072938186 chore(doc-gen): include source files from code.angularjs.org for production plnkr examples 2017-08-23 11:52:46 +02:00
Martin Staffa 48f0957dde revert: chore(docs-app): load example files based on active deployment
This reverts commit d91a6bdbc6.

The runnable examples cannot rely on the CDN for loading the common files,
because the CDN push does not happen at the same time as the docs are generated,
which means the doc examples are non-functional for an unforeseeable time.
2017-08-23 11:52:46 +02:00
Martin Staffa 6d2ff0ac6d docs(CHANGELOG.md): add changes for 1.6.6 2017-08-18 15:23:17 +02:00
Georgios Kalpakas 7c876285cb test(ngOptions): fix flaky test on Firefox 54+ and Safari 9
Closes #16149
2017-08-12 11:58:55 +03:00
Martin Staffa a83d64605f chore(karma): use dots reporter by default
dots is nicer for local testing, as you usually don't run a
ton of test suites, and the progress visualization is more important .
It's also more readable if you skip many tests (i.e. run isolated tests)

Closes #16167
2017-08-11 22:56:02 +02:00
Martin Staffa 919087f0ec chore(code.angular): correctly remove old zip files from snapshot
Previously, the event would be triggered on the deletion of the previous zip files,
which would delete the current zip file as well

Closes #16168
2017-08-11 22:54:51 +02:00
Frederik Prijck 5b31b379a6 docs(*): change Angular to AngularJS
Closes #16163
2017-08-11 16:53:56 +03:00
Martin Staffa c9691a29f2 chore(travis): manually install yarn (#16166)
Currently, the yarn version on Travis is outdated:
https://github.com/travis-ci/packer-templates/issues/478
2017-08-11 15:29:21 +02:00
Frederik Prijck 9b6c1540a5 docs($compile): update preAssignBindingsEnabled description
Previously, the changelog and migration guide did not mention the fact
that this only applies to controllers which are part of a
directive/component.

This commit ensures the changelog and migration guide mentions this explicitly.

Closes #15740

Closes #16162
2017-08-11 16:25:37 +03:00
Georgios Kalpakas 56ac2a7b3c chore(karma): run tests on latest Chrome (59) and Firefox (54) available on Saucelabs
Closes #16141
2017-08-04 12:07:55 +03:00
Georgios Kalpakas 811af9ccfb test(*): fix tests involving submit on Chrome 60
On Chrome 60 (at least on Windows) the `submit` event when clicking on a submit
button is not fired on the form element, unless it is already part of the DOM.
2017-08-04 12:07:34 +03:00
Frederik Prijck a784fab605 fix($httpParamSerializerJQLike): call functions as jQuery does
Previously, `httpParamSerializerJQLike` stringified function properties without executing them.
This commit ensures function properties are executed and the return value is used.

Fixes #16138

Closes #16139
2017-08-03 21:01:39 +03:00
andypotts 3650723501 docs(guide/concepts): simplify currency exchange API example (YQL --> Fixer.io)
Fixes #16130

Closes #16137
2017-08-02 13:33:38 +03:00
Martin Staffa aee5d02cb7 chore(travis): actually skip build on deployment job when from Pull Request 2017-07-31 23:31:39 +02:00
Martin Staffa 0179c70d02 chore(code.angularjs): enable directory listings 2017-07-31 15:58:11 +02:00
Martin Staffa 84061c2954 chore(code.angularjs): delete old zip files on snapshot 2017-07-31 15:58:11 +02:00
Martin Staffa 9936e570ea chore(travis): skip build on deployment job when from Pull Request 2017-07-31 15:58:11 +02:00
Martin Staffa 1b196332f5 chore(docs-app): only copy relevant assets
This keeps the size of the docs-app build down.
Especially needed to keep the size of the generated build .zip
under 10MB, which is the limit for firebase / gcs https function transfers
2017-07-31 15:58:11 +02:00
Martin Staffa d91a6bdbc6 chore(docs-app): load example files based on active deployment 2017-07-31 15:58:11 +02:00
Carl 394dbcc277 fix($httpParamSerializer): ignore functions
Closes #16133
2017-07-31 16:14:33 +03:00
Zita Nemeckova f1d01bbc74 feat($compile): add strictComponentBindingsEnabled() method
Closes #16129
2017-07-28 12:51:38 +03:00
Chirag Bhatia 01d6a47e91 fix($resource): do not throw when calling old $cancelRequest()
Closes #16037
2017-07-27 10:37:16 +03:00
Jason Bedard ac57a25cd9 test(ngStyle): add test for object literal 2017-07-26 21:25:48 -07:00
gdi2290 15bbd3e18c perf(ngStyleDirective): use $watchCollection
Since we are simply watching a flat object collection it is more performant
to use $watchCollection than a deepWatch...

BREAKING CHANGE:

Previously the use of deep watch by ng-style would trigger styles to be
re-applied when nested state changed. Now only changes to direct
properties of the watched object will trigger changes.

Closes #15947
2017-07-26 21:25:48 -07:00
Jason Bedard 87a586eb9a fix($parse): do not pass scope/locals to interceptors of one-time bindings 2017-07-21 20:56:14 -07:00
sathify e6d5fe7dea style(css) separate selectors and declarations by new lines 2017-07-19 14:18:08 +02:00
Kerry McCullough 823c7edb84 feat($resource): add resource to response for error interceptors
Closes #16109
2017-07-18 17:10:47 +03:00
Jason Bedard 631076a31b fix($parse): do not shallow-watch computed property keys
Shallow watching is not enough when an object implements a non-pure toString
2017-07-17 23:38:39 -07:00
Jason Bedard 341f8dbe24 refactor($parse): remove unnecessary .constant if when collecting inputs 2017-07-17 22:11:42 -07:00
Jason Bedard 8de97949c5 fix($parse): support constants in computed keys 2017-07-17 20:54:43 -07:00
Jason Bedard 2fb2d09971 test(ngClass): add test for one-time objects in array literal 2017-07-16 22:01:40 -07:00
Jason Bedard 2ee5033967 fix($parse): always pass the intercepted value to watchers
Fixes #16021
2017-07-16 22:01:40 -07:00
Jason Bedard de74034ddf fix($parse): respect the interceptor.$stateful flag 2017-07-16 22:01:40 -07:00
Jason Bedard 529550d0da refactor($parse): do not pass scope,locals to interceptor fns
All internal use of interceptors are for things such as data
conversion/normalizing, never reading state from the scope/locals.
This is the intended use and makes interceptors more like filters
(which receive only the input value + args, no scope/locals).
2017-07-14 01:53:48 -07:00
Martin Staffa 828a2757b2 chore(*): deploy (docs|code) .angularjs.org to Firebase via Travis
- code.angularjs.org and docs.angularjs.org are two separate Firebase projects
- both are automatically deployed via Travis config
- Travis is split up into 2 build stages: first, all tests are run, and if they pass, the deploy
stage runs a single job with both deployments (actual deployment depends on the state of the commit)
- docs. is deployed directly to Firebase hosting
- code. is uploaded to Firebase Google Cloud Storage and uses Firebase hosting rewrites to acces the
files
- jenkins builds still push the code builds to the code.angularjs.org Github repository

Closes #9674
Closes #16093
2017-07-13 11:14:55 +02:00
SteveAndrewArcher 7e97db93ff docs(input[week]): clarify value of Date object
Add a note to documentation of input[week] to explicitly state that the
resulting Date object's value is set to Thursday at midnight of the
specified week.

Resolves #15883 
Closes #16104
2017-07-13 11:13:09 +02:00
Martin Staffa 6a22c79a94 chore(travis): fix bower install
We removed `grunt package` from JOB_UNIT in 4015e0fde5,
but this runs `grunt bower` which JOB_UNIT needs.

This commit adds `grunt bower` to JOB_UNIT.

Closes #16105
2017-07-13 10:38:57 +02:00
Martin Staffa 0616dde95e chore(travis): add commitplease validation to ci-checks
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. 

The git hook integration is turned off.

Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway.

Note that "Merge commit" messages and everything starting with "WIP" is always allowed by commitplease. Follow issue https://github.com/jzaefferer/commitplease/issues/101 for more info.

Related to #14888 
Closes #16097
2017-07-12 12:02:18 +02:00
Martin Staffa 25bf1ef07c chore(doc-gen): insert current tagged version if missing from list of all versions
In commit ce49edc08b, we switched to npm info (now yarn info)
instead of the local git repository information to get the list of currently available versions for
the docs app. This means that during a release the version that is currently tagged is not yet
available on npm, and therefore our list of available versions is incomplete.

We now simply add the current build version (read from build/version.json) to the list of all
versions if it fulfills the following conditions:

- it is not a snapshot build
- it is not already part of the list of all versions (i.e. if you are building locally on a tagged commit)

Closes #15741
Closes #16099
2017-07-12 11:15:09 +02:00
Nikos Katsos 7f2accaa3a fix($http): do not throw error if Content-Type is not application/json but response is JSON-like
Previously, when the response data was JSON-like, `$http` would try to
`JSON.parse` them and throw if they were not actually JSON. This happened even
if the `Content-Type` header was not `application/json`. As a result, it was not
possible to send `text/plain` data that looked like JSON (e.g. `{abcd}`).
The reason for not relying solely on the `Content-Type` is that many users serve
JSON data without proper headers.

This commit fixes it by returning the raw response text if `$http` fails to
parse a JSON-like response, unless the `Content-Type` header has been explicitly
set to `application/json` (in which case it will still fail with an error).

Fixes #16027

Closes #16075
2017-07-11 18:32:12 +03:00
Martin Staffa c8793431b6 docs($rootScope.Scope): improve wording in $watch
Closes #16050
2017-07-11 15:34:46 +02:00
Eyal Ronel 77b302ab00 docs($resource): add missing closing square bracket in example
Closes #16090
2017-07-11 09:48:49 +03:00
z.ky af83c1541c docs(ngRepeat): correct typo
Closes #16088
2017-07-06 19:06:34 +02:00
Frederik Prijck e872f0ed36 feat($http): allow differentiation between XHR completion, error, abort, timeout
Previously, it wasn't possible to tell if an `$http`-initiated XMLHttpRequest
was completed normally or with an error or it was aborted or timed out.
This commit adds a new property on the `response` object (`xhrStatus`) which
allows to defferentiate between the possible statuses.

Fixes #15924

Closes #15847
2017-07-04 15:20:48 +03:00
Martin Staffa 122d89b240 docs(ngOpen): improve example, correct browser compat note
Firefox supports details since version 49
2017-07-04 12:33:00 +02:00
Georgios Kalpakas 1991e77e43 docs(changelog): add release notes for 1.6.5 2017-07-03 14:50:58 +03:00
ksvitkovsky 57a972d899 feat($compile): overload .component() to accept object map of components
Register multiple components with single call as it is possible with other module units.

Closes #14579 
Closes #16062
2017-07-03 11:07:10 +02:00
Jason Bedard cdaa6a951b fix($timeout/$interval): do not trigger a digest on cancel
Previously, `.catch(noop)` was used on a rejected timeout/interval to prevent an unhandled rejection error (introduced in #c9dffde1cb). However this would schedule a deferred task to run the `noop`. If the cancelling was outside a digest this could cause a new digest such as with the ng-model `debounce` option.

For unit testing, this means that it's no longer necessary to use `$timeout.flush()` when a `$timeout` has been cancelled outside of a digest. Previously, this was necessary to execute the deferred task added by `.catch(noop).
There's an example of such a change in this commit's changeset in the file `/test/ngAnimate/animateCssSpec.js`.

Fixes #16057
Closes #16064
2017-07-03 11:04:17 +02:00
davesidious bf0af6dbb1 docs($log): add note about blackboxing
Add browser-agnostic hint about blackboxing and the benefits it brings developers when using $log.

Closes #15592
2017-06-30 11:58:30 +02:00
Idan Cohen 62c9d1da7a docs(misc/FAQ): correct misspell
The brackets are still just 'angular' :-)

Fixing over-correction made in [this PR](https://github.com/angular/angular.js/commit/03043839d5a540b02208001fe12e812dfde00a8e)

Closes #16070
2017-06-29 11:02:58 +02:00
Martin Staffa 8deff89e5f test(ngOptions): ensure options are only painted once on compile 2017-06-29 10:51:09 +02:00
Pol Bonastre 65728383f3 perf(ngOptions): prevent initial options repainting
Avoid double execution of `updateOptions()` method,
which causes a complete repainting of all `<option>` elements.

Fixes #15801
Closes #15812
Close #16071
2017-06-29 10:51:09 +02:00
Jason Bedard a772b94b0a chore(benchmarks): add $watchCollection tests 2017-06-27 21:42:28 -07:00
Jason Bedard 423acc2c67 chore(benchmarks): remove no longer applicable tests and literal watching workarounds 2017-06-27 21:42:28 -07:00
Jason Bedard a03b75c6a8 refactor($browser): remove workaround for old ff bug
- https://bugzilla.mozilla.org/show_bug.cgi?id=407172 was fixed in ff 40

Closes #16065
2017-06-21 16:34:37 +02:00
Martin Staffa e58bcfab99 chore(grunt): increase task readability 2017-06-13 10:40:09 +01:00
Martin Staffa 4015e0fde5 chore(travis): don't build package for the "unit" job
Source test:unit do not need built or packaged code,
and, and tests:docs only need built code.
2017-06-13 10:40:09 +01:00
Martin Staffa 030ae660bb chore(travis): use "karma-spec-reporter"
dots reporter creates lots of empty space that makes it tedious to scroll
through the logs. "Spec" is configured to only report on failures.
2017-06-13 10:40:09 +01:00
Jason Bedard b85926b33f test($parse): add one-time/interceptor tests 2017-06-12 22:07:00 -07:00
Jason Bedard b12a0b7652 fix($parse): do not shallow-watch inputs when wrapped in an interceptor fn
Fixes #15905
Closes #16018
2017-06-12 21:30:36 -07:00
Martin Staffa 464dde8bd1 fix(Angular): deprecate angular.merge
This function has problems with special object types but since it's not used in core,
it is not worth implementing fixes for these cases.
A general purpose library like lodash (provides `merge`) should be used instead.

Closes #12653
Closes #14941
Closes #15180
Closes #15992
Closes #16036
2017-06-12 15:59:20 +02:00
Saurav Bhattacharya 42299e9f6d docs(external-resources.ngdoc): fix broken link
Closes #16042
2017-06-12 15:02:02 +03:00
Georgios Kalpakas 53fb909068 test(ngMock): fix Firefox craches on Travis
This test keeps causing Firefox 47 (currently used on Travis) to crash and fail
the build. The test passes locally (on Firefox 53). Lowering the loop count from
1000 to 100 seems to fix the issue.
(Note: The crach only affects the mocked implementation of `$interval` and does
not happen locally.)

Closes #16040
2017-06-12 14:39:13 +03:00
Peter Bacon Darwin 420ceb6e48 chore(jenkins): do not publish to code.angularjs.org snapshot
While the firewall continues to block the update ports
we will not try to publish there. This will be fixed when we move to hosting
the sites on Firebase.

This means that successful builds on master will not automatically update
code.angularjs.org, this will affect:

* https://code.angularjs.org/snapshot, which people often use to check latest features
* https://docs.angularjs.org, which is supposed to display the docs for the latest master

As it turns out we can manually partially trigger an update by browsing to
https://code.angularjs.org/gitFetchSite.php but we just can’t guarantee that we will update
both the round robin servers.
2017-06-06 12:26:05 +01:00
Lucio Martinez 32f4645314 fix(ngMock/$interval): add support for zero-delay intervals in tests
Previously, trying to test code thaat contained zero-delay intervals (e.g.
`$interval(fn, 0)` or `$interval(fn)`) would result in an infinite loop.
This commit avoids the infinite loop, by treating zero-delay intervals as one
second intervals (except for the initial trigger, where they can also be
executed with `$interval.flush(0)`).

Fixes #15952

Closes #15953
2017-06-06 13:28:34 +03:00
Georgios Kalpakas e5c5b4a131 chore(i18n): update CLDR to v30.0.1
Fixes #15976

Closes #15997
2017-06-06 13:08:05 +03:00
Georgios Kalpakas 5d5fd6292a chore(i18n): fix parser for currency patterns without fraction digits
Previously, it was assumed that all currency pattern would have fraction digits.
However, in [closure-library@b9155d5][1] the `agq_CM` locale was modified to
have such a pattern (namely `#,##0\u00A4`).
This commit modifies the parser implementation to account for pattern without a
decimal point (and thus no fraction digits).

[1]: https://github.com/google/closure-library/commit/b9155d5966a228cb33f367c30c275c833b30e3ff#diff-02793124214ad0470ccea6f86b90d786R711
2017-06-06 13:08:03 +03:00
Georgios Kalpakas 7fbbacc104 chore(i18n): fix relative paths in scripts 2017-06-06 13:07:35 +03:00
Georgios Kalpakas 1df736e256 test(i18n): remove bad assertion 2017-06-06 13:07:35 +03:00
Peter Bacon Darwin 7673ca7d15 fix($sanitize): use appropriate inert document strategy for Firefox and Safari
Both Firefox and Safari are vulnerable to XSS if we use an inert document
created via `document.implementation.createHTMLDocument()`.

Now we check for those vulnerabilities and then use a DOMParser or XHR
strategy if needed.

Thanks to @cure53 for the heads up on this issue.
2017-06-05 21:02:03 +01:00
Martin Staffa e65928eecb docs($compile): add more info about optional bindings
This centralizes the info about optional bindings.
Also adds more examples to the $compile:iscp error.

Closes #15989
Closes #16025
2017-06-05 20:23:12 +02:00
Martin Staffa 3bce707421 docs(ngRepeat): highlight track by expression position 2017-05-31 18:37:31 +02:00
Michał Gołębiowski b4651e5278 test(support): verify support tests results in all tested browsers (#16008)
Closes #16008
2017-05-25 16:14:31 +02:00
Jason Bedard aef3ef7b03 test($parse): reorganize $parse tests 2017-05-24 21:42:21 -07:00
Jason Bedard b5118ac6a9 fix($parse): always re-evaluate filters within literals when an input is an object
Fixes #15964
Closes #15990
2017-05-24 21:42:21 -07:00
Michał Gołębiowski 33cd29b3a3 chore(testabilityPatch): fix a typo 2017-05-24 10:25:30 +02:00
Michał Gołębiowski 667d4734fc test($log): run all $log tests in IE9 & non-IE9 logging mode (#15995)
In IE 9 console methods don't inherit from Function.prototype and, hence, don't
have apply. Until recently IE 9 logging in AngularJS was restricted to the
first 2 parameters but that changed as we could just reuse
Function.prototype.apply everywhere, creating one code path for all browsers.
Therefore, we can now run all tests in modes where apply exists on logging
methods and where it doesn't.

Ref #15911
Ref b277e3ead7
Closes #15995
2017-05-24 10:14:29 +02:00
Thomas Grainger 837acd14e0 fix(*): correctly detect Error instances from different contexts
Previously, errors thrown from different contexts (such as an iframe or
webworker) were not detected as `Error` instances and handled accordingly.
This commit fixes it by introducing an `isError()` helper, that is able to
correctly detect such instances.

Fixes #15868

Closes #15872
2017-05-22 14:07:52 +03:00
Sercan Eraslan 63b6d64a60 docs(guide/component): remove redundant empty controller from example
There is no need for empty controller functions on components, since this is the
default.

Closes #16003
2017-05-22 11:50:20 +03:00
BobChao87 762580ff34 fix(orderBy): guarantee stable sort
If a user-provided comparator fails to differentiate between two items, fall
back to the built-in comparator (using the tie-breaker predicate).

Fixes #14881

Closes #15914
2017-05-19 14:40:04 +03:00
Martin Staffa a86a3195b4 chore(*): update protractor
Update protractor to latest 5.1.2 to make it work with Chrome 58 on Jenkins.
This protractor version is not compatible with FF 53 and directConnect, but this should be irrelevant as Travis does not use directConnect and on Jenkins we don't test FF.

Closes #15991
2017-05-17 09:22:34 +02:00
Martin Staffa 2acea11a17 chore(ci): disable unit testing on Firefox
Related to https://github.com/angular/angular.js/issues/15987

Closes #15988
2017-05-15 13:29:13 +02:00
Georgios Kalpakas 9bcdfcfe17 docs(*): fix dangling links
Closes #15984
2017-05-12 18:09:33 +03:00
Georgios Kalpakas 66945e217e docs(form): improve the docs for FormController.$setValidity()
Fixes #15963
2017-05-12 18:09:32 +03:00
tsclaus cd5efa095e docs(ngRepeat): fix argument name in comment to match actual argument (element --> clone)
Closes #15975
2017-05-11 11:40:16 +03:00
Jake Danforth e79c472fdd docs(error/badrestrict): fix typo (of --> or)
Closes #15979
2017-05-11 11:34:36 +03:00
Martin Staffa e1dd00e4ef chore(*): update jasmine-core to 2.5.2
This might resolve an issue where Firefox 51+ fails on Jenkins at this
test: https://github.com/angular/angular.js/blob/8a89586bede0256494cb3027d856f1ebf592afde/test/ng/directive/ngOptionsSpec.js#L2891

The failure can also be reproduced locally when running the whole test suite with the
Firefox window unfocused. With 2.5.2, the failure happens too, but much less
frequent.

Latest jasmine (2.6.2) has problems with some browsers, see here:
https://github.com/jasmine/jasmine/issues/1327

Closes #15978
2017-05-10 14:10:23 +02:00
David Fuka 8a89586bed docs(errors/badjsonp): fix typo
Closes #15977
2017-05-10 13:26:49 +02:00
Jason Bedard d0d829899c test($rootScope): add $watch/$watchCollection/$watchGroup tests
Closes #15949
2017-05-09 21:54:15 -07:00
Michał Gołębiowski 30eb194341 test(*): run class-related tests everywhere; fix eval syntax
1. Wrap an evaled class definition in parens; previously they weren't; the test
   wasn't failing only because it was disabled everywhere outside of Chrome
   and Chrome <59 incorrectly accepted such input.
2. There's no reason to restrict class-related tests just to Chrome; now they
   run in every browser that supports ES6 classes. The classes support test
   was modified to check not only if a class definition parses but also if
   it stringifies correctly which is required by AngularJS. This restriction
   disables class-related tests in current Firefox (53) but will work in v55
   or newer.

Closes #15967
2017-05-09 15:08:35 +02:00
musclor 2f3bd89a51 docs(guide/component): remove redundant unit test
Fixes #15968
Closes #15974
2017-05-09 10:18:38 +03:00
Lucas Mirelmann 301fdda648 fix(httpParamSerializerJQLike): Follow jQuery for null and undefined
Follow jQuery when serializing `null` and `undefined`.

Closes: #15969
Closes: #15971
2017-05-07 20:24:07 +02:00
Michał Gołębiowski 1069086299 chore(*): update all Karma-related packages except Karma
The updated karma-chrome-launcher adds support for ChromeHeadless &
ChromeCanaryHeadless launchers; test with:

    karma start karma-jqlite.conf.js --browsers=ChromeCanaryHeadless

The updated karma-firefox-launcher disables multi-process which may increase
stability on Jenkins.

Closes #15966
2017-05-06 17:50:42 +02:00
Valentin 2a8a29ac43 docs(guide/templates): add missing closing <script> tag
Closes #15961
2017-05-04 14:02:48 +03:00
Leonardo Souza d21acafa77 docs(guide/interpolation): fix typo in markdown (code highlight)
Closes #15935
2017-05-02 15:41:58 +03:00
Georgios Kalpakas 8f563e2ecf perf(animate): avoid unnecessary computations if animations are globally disabled
Closes #14914
2017-04-28 12:48:03 +03:00
Georgios Kalpakas c09e613aac feat($animate): add support for customFilter
This commit adds a new `customFilter()` function on `$animateProvider` (similar
to `classNameFilter()`), which can be used to filter animations (i.e. decide
whether they are allowed or not), based on the return value of a custom filter
function.
This allows to easily create arbitrarily complex rules for filtering animations,
such as allowing specific events only, or enabling animations on specific
subtrees of the DOM, etc.

Fixes #14891
2017-04-28 12:48:02 +03:00
Georgios Kalpakas 913cf794c9 perf($animate): do not retrieve className unless classNameFilter is used 2017-04-28 12:47:49 +03:00
Georgios Kalpakas 17fb15d7a4 docs(guide/animations): list missing animated directives (and other improvements)
- List missing animation-aware directives.
- Fix/Improve wording/formatting.
- Fix typos.
- Limit lines to 100 chars.
2017-04-28 12:47:49 +03:00
Dimitri Tarasiuk 9341671d78 docs($q): fix typo in qFactory documentation
Closes #15946
2017-04-28 12:20:27 +03:00
Georgios Kalpakas 4a12ae7b36 fix(angular-loader): do not depend on "closure" globals that may not be available
Code that is distributed as part of both `angular.js` and `angular-loader.js`
should not depend on "closure" globals that may not be available in
`angular-loader`.

Fixes #15880

Closes #15881
2017-04-27 22:46:35 +03:00
Martin Staffa b496daabe6 fix(ngOptions): re-render after empty option has been removed 2017-04-27 21:35:26 +02:00
Martin Staffa 6fc0f02ad2 feat(select): expose info about selection state in controller
This allows custom directives to manipulate the select's and
ngModel's behavior based on the state of the unknown and
the empty option.

Closes #13172
Closes #10127
2017-04-27 21:35:26 +02:00
Pol Bonastre 2fdfbe7296 fix(ngOptions): allow empty option to be removed and re-added
This bug was reported as part of angular/angular.js#15801
2017-04-27 21:35:26 +02:00
Georgios Kalpakas f90b48d7d8 chore(docs-app): fix vertical scrolling offset after recent re-design
Previously, the `yOffset` pointed to the `<header>` element, which had a height
of 0 (since all its children have fixed positions). This caused scrolled items
to have 0 vertical offset, essentially hiding the top part behind the static
`<nav>` items.
This commit fixes the vertical scrolling offset, by setting `yOffset` to the
last (lowest) `<nav>` item.

Closes #15945
2017-04-27 17:00:49 +03:00
Martin Staffa dcc57f1718 docs(select): add known issue about Firefox selection behavior
Related to #9134
2017-04-26 12:48:36 +02:00
Michał Gołębiowski 602fa698a5 refactor($injector): require standard class stringification
ES6 classes now require Edge 14 or newer to work.

Closes #15911
2017-04-25 20:56:10 +02:00
Michał Gołębiowski b277e3ead7 feat($log): log all parameters in IE 9, not just the first two.
IE 9 lacks apply on console methods but it's possible to borrow the apply
method from Function.prototype.
2017-04-22 15:33:05 +02:00
Michał Gołębiowski e4c2fe6d42 refactor(*): remove workarounds for IE <9, update IE/Edge-related comments 2017-04-22 15:31:36 +02:00
Martin Staffa ff0e61166d refactor(select, ngOptions): extract common methods; make consistent 2017-04-21 20:38:57 +02:00
Martin Staffa 4b06637f70 chore(matchers): improve output for toBeMarkedAsSelected 2017-04-21 20:38:57 +02:00
Martin Staffa 5878f07474 fix(ngOptions): select unknown option if unmatched model does not match empty option
When a regular / ngOptions select has an explicit *empty* option, this option can be selected
by the user and will set the model to `null`. It is also selected when the model is set to
`null` or `undefined`.

When the model is set to a value that does not match any option value, and is also not
`null` or `undefined`, the *unknown* option is inserted and selected - this is an explicit marker
that the select is in an invalid / unknown state, which is different from an allowed empty state.

Previously, regular selects followed this logic, whereas ngOptions selects selected the empty
option in the case described above.

This patch makes the behavior consistent between regular / ngOptions select - the latter will now
insert and select the unknown option. The order of the options has been fixed to unknown -> empty
-> actual options.
2017-04-21 20:38:57 +02:00
Martin Staffa 8d7c7f4a8e test(select, ngOptions): add more tests for "required" with "empty" or "unknown" option 2017-04-21 20:38:57 +02:00
Jacob Hansson 080357e906 feat(ngMock): describe unflushed http requests
The current implementation of $httpBackend.verifyNoOutstandingRequest
gives an integer number describing how many requests are unflushed.

While it's superficially easy to solve test errors from that message
by simply adding an additional $httpBackend.flush(), if a developer
is truly not expecting the code to make further requests this is
not ideal.

This change explicitly prints out which additional requests remain
unflushed in the error message, helping her determine if the code
needs changing, or if an additional flush is appropriate.

Before this change:

    Unflushed requests: 1

After this change:

    Unflushed requests: 1
      GET /some

Closes #10596
Closes #15928
2017-04-21 13:39:36 +02:00
Martin Staffa 69c3faf405 test(core): expect that Edge cannot auto-bootstrap in extensions 2017-04-19 13:05:25 +02:00
Martin Staffa 7efed00632 test(input): exclude tests that are only failing on Edge 2017-04-19 13:05:25 +02:00
Martin Staffa 496138f12a chore: test on Microsoft Edge
Closes #13687
Closes #14401
2017-04-19 13:05:25 +02:00
TheHalcyonSavant 37a2c20bb8 docs(guide/migration): remove duplicate entry for commit 13c252
Closes #15919
2017-04-18 10:28:20 +03:00
Michał Gołębiowski 8eb925d7c5 chore(browserstack): Update OS X, make iOS 8-10 available to test 2017-04-12 15:00:57 +01:00
Michał Gołębiowski ad0bb83819 chore(browserstack): Update browserstacktunnel-wrapper, fix options
Only the latest version of the package works correctly (the backend for it at
BrowserStack is not versioned) and the options have changed in the new version
of the package.

Also, iOS 8.0 is no longer available on BrowserStack, only 8.3 is. Instead,
this commit changes it to 9.3 as we shouldn't be testing on 8 anymore anyway.

Closes #15892
2017-04-12 13:20:43 +02:00
Martin Staffa e23782b8c2 docs($http): correct and clarify default transforms
- baddata error described incorrect http behavior, and workarounds
- httpProvider defaults were missing transformResponse / transformRequest
- http was not clear about JSON detection strategy

Closes #15897 
Closes #15906
2017-04-12 11:21:10 +02:00
Vigneshkumar Chinnachamy d0622d0649 docs(guide/Developer Guide): Update twitter handle
Replaced the old Angular twitter handle with the new one.

Closes #15903
2017-04-08 14:10:21 +02:00
Eli Sadoff e812b9fa9e docs(filter/uppercase): add an example
I saw that the uppercase filter had no example so I decided to add a minimal example to explain how the uppercase filter works.

Thank you very much to @narretz for helping me through this process.

Closes #15885
2017-04-07 17:23:19 +02:00
Martin Staffa 6ee7c29ca7 docs(filter/filter): remove duplicate 'the'
Closes #15893
2017-04-07 15:02:48 +02:00
Atef Ben Ali 0fbb1187b8 docs(guide/directive): delete redundant 'the'
Closes #15891
2017-04-05 15:13:28 +02:00
Atul Shimpi 136a42abc1 docs(README): improve vocabulary and orthography
Closes #15876
Closes #15875
2017-04-03 10:19:35 +02:00
michaelb958 06516d7c27 docs(guide/i18n): fix links to CLDR
The old link target is dead, deceased, pushing up daisies. I quote:
> The cldr-tmp repository is no longer available.
> For access to CLDR sources and data, please see the [CLDR pages](link to new one).

Closes #15879
2017-04-02 16:12:46 +03:00
Martin Staffa 617b36117a docs(changelog): add release notes for 1.6.4 2017-03-31 10:47:45 +02:00
Jason Bedard 189461f9bf fix($parse): standardize one-time literal vs non-literal and interceptors
Previously literal one-time bindings did not use the expression `inputs`, causing infinite digest issues with literal values. This often forces the use of deepEquals when watching one-time literals.

`ng-class` is one example of deepEquals which is no longer required.

This one-time/literal behavior is now also consistently propogated through interceptors.

Closes #15858
2017-03-31 09:36:19 +02:00
Jason Bedard 93879b3c72 fix($parse): fix infinite digest errors when watching objects with .valueOf in literals
Closes #15867
2017-03-31 09:17:55 +02:00
Jason Bedard c2b8fab0a4 fix($rootScope): provide correct value of one-time bindings in watchGroup 2017-03-30 22:22:22 -07:00
bennycoomans f403925ee0 docs(guide/Migrating from Previous Versions): fix typo "indentifiers"
Closes #15871
2017-03-29 14:49:00 +02:00
Michał Gołębiowski 1e841a89c1 docs($compile): remove a mention of preassigning bindings in controllers
The deprecation warning is no longer needed as the feature has been removed
in 1.7.

Closes #15870
2017-03-29 14:15:26 +02:00
Jason Bedard 2b0c0505e2 refactor($parse): move duplicate $parse interpreter/compiler logic into Parser
- the construction of the AST is now in the Parser
- the assigning of the literal and constant flags is now in the Parser
- remove unused references to the lexer, $filter and options on the Parser
2017-03-27 23:29:02 -07:00
Jason Bedard 9d74f0fdcb refactor($compile): reuse shared simpleCompare method 2017-03-27 23:25:22 -07:00
Jason Bedard f1d0f03863 refactor($parse): make use of local variable instead of refetching property 2017-03-27 22:53:12 -07:00
Jason Bedard b0f6afcdac test($compile): add test for #15833 2017-03-27 22:47:25 -07:00
Jason Bedard 2931a6df03 refactor(ngModel): use local scope param in watcher 2017-03-27 22:47:15 -07:00
Michał Gołębiowski bf5c2eef34 fix(jqLite): make jqLite invoke jqLite.cleanData as a method
The previous implementation of jqLite didn't use cleanData from the jqLite
object but instead used a cached version which maede it impossible to
monkey-patch jqLite.cleanData similarly to how you can do it in jQuery.

The cleanData method is not meant to be called directly by userland code;
its purpose is mainly to be able to be monkey-patched; therefore, the previous
implementation didn't make a lot of sense.

This commit enables one of the tests so far run only with jQuery to run with
jqLite as well.

Ref #8486
Ref #8695
Closes #15846
2017-03-27 11:55:56 +02:00
Michał Gołębiowski dcdd5def8f test(jQuery): run tests with jQuery 2.1, 2.2 & 3.2
Also, update jQuery 2.2.x mentions in the tutorial to 3.2.x.

Closes #15843
2017-03-27 11:23:49 +02:00
Peter Mertz f3aa1d183a docs($interval): Update interval promise docs
It's currently not clear when or why the promise returned by `$interval` resolves. This updates the docs to be more specific.

Closes #15862
2017-03-25 18:08:38 +02:00
Martin Staffa 80077f35d0 docs(faq): clarify the versioning strategy
- When do breaking changes appear
- Relationship with Semver
- Compatibility of modules

Closes #15845
2017-03-24 12:45:28 +01:00
Martin Staffa 32f38a33b6 docs($animate): remove obsolete error doc 2017-03-24 10:44:51 +01:00
Martin Staffa 9de0842719 chore(doc-gen): report on missing or obsolete error docs
Closes #12527
2017-03-24 10:44:51 +01:00
Rodrigo b9d2b30808 docs(filterFilter): clarify the comparator parameter
Closes #15827
2017-03-23 16:00:37 +02:00
Michał Gołębiowski 3d0abffbc0 chore(yarn): rely on Travis built-in Yarn support, update Yarn in Jenkins
On Travis we now rely on built-in Yarn support and we only cache the Yarn cache,
not node_modules. This creates a more stable environment as we don't install
over previous node_modules state but we still won't download packages from the
internet in the second run for the same yarn.lock as Yarn takes packages from
its local cache if they exist there.

We install a new Yarn verison manually on Jenkins; the location of the install
script changed.

Closes #15851
2017-03-22 22:49:51 +01:00
Martin Staffa c35786ae26 chore(github): update issue template
Closes #15824
2017-03-22 17:03:44 +01:00
Michał Gołębiowski 60644d5d05 chore(*): remove unused docs/bower_components mentions 2017-03-22 16:49:16 +01:00
Michał Gołębiowski 233f47b98a chore($parse): make sure no one changes .toEqual(-0) to .toBe(-0) 2017-03-22 12:08:05 +01:00
Martin Staffa 421040588c docs(component-router): give deprecation notice red color 2017-03-22 12:00:32 +01:00
Jason Bedard f132ce740a refactor($controller): remove unused injected $window
Closes #15839
2017-03-22 11:54:55 +01:00
Joshua J Wilborn 5377baf0fc docs ($compile): add error documentation for noslot error in $compile
Fixes #15790
Closes  #15828
2017-03-22 11:51:55 +01:00
Michał Gołębiowski bf7685abbd test(jqLite): test not firing $destroy on jqLite.cleanData with jQuery UI
So far it wasn't tested that Angular's logic for skipping it triggering
the $destroy event on jQuery.cleanData in the replaceWith internal function
works correctly when Angular is not the last one to patch the cleanData method
(e.g. if jQuery UI does the patching later). This commits adds the relevant
test.

Ref #8486
2017-03-22 10:37:17 +00:00
Michał Gołębiowski ba2e0d3d9b docs(faq): document the AngularJS/jqLite deprecation strategy
Fixes #15282
2017-03-22 10:32:28 +00:00
Raphael Jamet 0d9d57d418 docs($sce): overhaul the $sce service documentation
A big docs update around `$sce`:
There is a lot of content in there that is often misunderstood, and some of the
documentation starts to get really old too. Also fixed capitalization,
formatting, indentation and uniformized `@param` descriptions.

Closes #15735
2017-03-21 17:34:33 +02:00
Richard Kaufhold d96e58fdc8 feat($resource): add hasBody action configuration option
By default, only `PUT`, `POST` and `PATCH` requests have a body, but you can use
`hasBody` to configure any action to either have or not have a body, regardless
of its HTTP method.

Fixes #10128

Closes #12181
2017-03-21 12:43:48 +02:00
Georgios Kalpakas 70dbb15846 docs($sanitize): fix incorrect test description 2017-03-20 16:26:14 +02:00
BobChao87 d94153939c docs($resource): encode ) in link
JSDoc to HTML converter was treating the close parenthesis in
`[MDN](...#toJson()_behavior)` as the final close parenthesis, thus resulting in
a broken link.
This commit fixes it by percent-encoding the parentesis in the link address.

Closes #15825
2017-03-20 12:50:18 +02:00
xfg eacf06f5cf docs(ngMock/$httpBackend): add catch() block to example
Make the `it should fail authentication` test pass.

Closes #15822
2017-03-20 12:45:06 +02:00
TheRealMaxion bb2a247aa5 docs(tutorial/step_09) fix typo
Closes #15829
2017-03-20 12:32:39 +02:00
TheRealMaxion 24c94b83fa docs(tutorial/step_04): fix typo (each --> its)
Closes #15826
2017-03-20 12:27:44 +02:00
Vitaliy 0c3620bbf5 docs($interpolate): fix typo
There was missing `JS` at line 141.

Closes #15817
2017-03-15 18:19:06 +01:00
Michał Gołębiowski 38f8c97af7 fix($compile): remove the preAssignBindingsEnabled flag
Closes #15782

BREAKING CHANGE:

Previously, the `$compileProvider.preAssignBindingsEnabled` flag was supported.
The flag controlled whether bindings were available inside the controller
constructor or only in the `$onInit` hook. The bindings are now no longer
available in the constructor.

To migrate your code:

1. If you haven't invoked `$compileProvider.preAssignBindingsEnabled()` you
don't have to do anything to migrate.

2. If you specified `$compileProvider.preAssignBindingsEnabled(false)`, you
can remove that statement - since AngularJS 1.6.0 this is the default so your
app should still work even in AngularJS 1.6 after such removal. Afterwards,
migrating to AngularJS 1.7.0 shouldn't require any further action.

3. If you specified `$compileProvider.preAssignBindingsEnabled(true)` you need
to first migrate your code so that the flag can be flipped to `false`. The
instructions on how to do that are available in the "Migrating from 1.5 to 1.6"
guide:
https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
Afterwards, remove the `$compileProvider.preAssignBindingsEnabled(true)`
statement.
2017-03-15 15:38:44 +01:00
Chirag Bhatia c80fa1cfe1 fix($http): throw more informative error on invalid JSON response
Fixes #15695

Closes #15724
2017-03-14 14:47:39 +02:00
Martin Staffa 11d9ad1eb2 fix(ngTouch): remove ngClick override, $touchProvider, and $touch
Closes #15761
Closes #15755

BREAKING CHANGE:

The `ngClick` directive from the ngTouch module has been removed, and with it the
corresponding `$touchProvider` and `$touch` service.

If you have included ngTouch v1.5.0 or higher in your application, and have not
changed the value of `$touchProvider.ngClickOverrideEnabled()`, or injected and used the `$touch`
service, then there are no migration steps for your code. Otherwise you must remove references to
the provider and service.

The `ngClick` override directive had been deprecated and by default disabled since v1.5.0,
because of buggy behavior in edge cases, and a general trend to avoid special touch based
overrides of click events. In modern browsers, it should not be necessary to use a touch override
library:

- Chrome, Firefox, Edge, and Safari remove the 300ms delay when
  `<meta name="viewport" content="width=device-width">` is set.
- Internet Explorer 10+, Edge, Safari, and Chrome remove the delay on elements that have the
  `touch-action` css property is set to `manipulation`.

You can find out more in these articles:
https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away
https://developer.apple.com/library/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_9_1.html#//apple_ref/doc/uid/TP40014305-CH10-SW8
https://blogs.msdn.microsoft.com/ie/2015/02/24/pointer-events-w3c-recommendation-interoperable-touch-and-removing-the-dreaded-300ms-tap-delay/
2017-03-14 11:48:54 +01:00
eeeqxxtg 5a13cacf9f docs(changelog): fix typo (resourceUrlWhiteList --> resourceUrlWhitelist)
Closes #15809
2017-03-14 11:30:14 +02:00
Ash Searle 28bad725b1 fix(dateFilter): correctly handle newlines in format string
Fixes #15794

Closes #15792
2017-03-13 19:28:26 +02:00
Martin Staffa 1daa4f2231 fix(Angular): remove angular.lowercase and angular.uppercase
Closes #15445

BREAKING CHANGE:

The helper functions `angular.lowercase` `and angular.uppercase` have
been removed.

These functions have been deprecated since 1.5.0. They are internally
used, but should not be exposed as they contain special locale handling 
(for Turkish) to maintain internal consistency regardless of user-set locale.

Developers should generally use the built-ins `toLowerCase` and `toUpperCase`
or `toLocaleLowerCase` and `toLocaleUpperCase` for special cases.

Further, we generally discourage using the angular.x helpers in application code.
2017-03-08 14:33:34 +01:00
Martin Staffa 4d43ee3327 docs(changelog): move bootstrap fixes to Bug Fix section 2017-03-08 12:47:23 +01:00
Martin Staffa a59f46b37d docs(changelog): add release notes for 1.6.3 2017-03-08 12:22:32 +01:00
Pablo Targa 728ce72372 docs(ngAnimate): update staggering config for use with css animations
Closes #15743
2017-03-07 20:20:01 +01:00
diegomrsantos b779091ffd docs(guide/migration): add info for 1.4 (ng)Pattern BC
Breaking change was introduced in commit 0e001084ff.
This content being included in the migration guide is taken from the commit message of commit 0e001084ff.

Closes #15758
Closes #15765
2017-03-07 20:13:24 +01:00
Raphael Jamet 6ccbfa65d6 feat($compile): lower the xlink:href security context for SVG's a and image elements
Previously, `xlink:href` on SVG's `<a>` and `<image>` elements, was
`$sce.RESOURCE_URL`. While this makes sense for other `xlink:href` usecases, it
was an overkill for these elements.
This commit lowers the `xlink:href` security context for these specific
elements, treating it in the same way as `a[href]` or `img[src]` respectively.
The `xlink:href` security context for other elements is not affected.

BREAKING CHANGE:

In the unlikely case that an app relied on RESOURCE_URL whitelisting for the
purpose of binding to the `xlink:href` property of SVG's `<a>` or `<image>`
elements and if the values do not pass the regular URL sanitization, they will
break.

To fix this you need to ensure that the values used for binding to the affected
`xlink:href` contexts are considered safe URLs, e.g. by whitelisting them in
`$compileProvider`'s `aHrefSanitizationWhitelist` (for `<a>` elements) or
`imgSrcSanitizationWhitelist` (for `<image>` elements).

Closes #15736
2017-03-05 00:57:04 +02:00
mohamed amr cc793a1364 test(errorHandlingConfig): add tests for errorHandlingConfig() (independent of minErr)
Closes #15770
2017-03-05 00:44:45 +02:00
Michał Gołębiowski 3dc0096dc4 fix($log): don't parse error stacks manually outside of IE/Edge
IE/Edge display errors in such a way that it requires the user to click in
4 places to see the stack trace. There is no way to feature-detect it so
there's a chance of the user agent sniffing to go wrong but since it's only
about logging, this shouldn't break apps. Other browsers display errors in
a sensible way and some of them map stack traces along source maps if available
so it makes sense to let browsers display it as they want.

Fixes #15590
Closes #15767
2017-03-03 11:38:58 +01:00
jason-larigakis-hs 846fa1cdf6 docs(guide/Providers): remove confusing section
This part of the guide  is called "Providers", which means the section no longer applies.

Closes #15771
2017-03-03 11:08:54 +01:00
Peter Bacon Darwin 60e294cbd8 feat(info): add angularVersion info to each module
You can now check what version of AngularJS a core module is designed for:

```
var angularVersion = $injector.modules['myModule'].info().angularVersion;
```
2017-03-02 08:22:08 +00:00
Peter Bacon Darwin 550f309dba feat($injector): add new modules property
The `modules` property is a hash of the modules loaded into the injector
at bootstrap time. This can be used to access the module's info.
2017-03-02 08:22:08 +00:00
Peter Bacon Darwin 49aba51e6b feat(Module): add info() method
The new `info()` method lets developers store arbitrary information about
their module for consumption later.

Closes #15225
2017-03-02 08:22:08 +00:00
Martin Staffa e269c14425 fix($controller): remove instantiating controllers defined on window
This also removes the likewise deprecated `$controllerProvider.allowGlobals()` method.

Closes #15349
Closes #15762

BREAKING CHANGE:

The option to instantiate controllers from constructors on the global `window` object
has been removed. Likewise, the deprecated `$controllerProvider.allowGlobals()`
method that could enable this behavior, has been removed.

This behavior had been deprecated since AngularJS v1.3.0, because polluting the global scope
is bad. To migrate, remove the call to $controllerProvider.allowGlobals() in the config, and
register your controller via the Module API or the $controllerProvider, e.g.

```
angular.module('myModule', []).controller('myController', function() {...});

angular.module('myModule', []).config(function($controllerProvider) {
  $controllerProvider.register('myController', function() {...});
});

```
2017-03-01 13:27:17 +01:00
Peter Bacon Darwin 19bc52127f fix(Angular): do not autobootstrap if the src exists but is empty
In Chrome an empty `src` attribute will be ignored, but in Firefox it seems
happy to prepend the `base[href]` and try to load whatever that is.
2017-02-27 11:53:44 +00:00
Georgios Kalpakas 4f69d38f09 fix($sanitize): prevent clobbered elements from freezing the browser
Closes #15699
2017-02-24 16:38:16 +00:00
Peter Bacon Darwin ebe90051ed fix(Angular): do not auto bootstrap if the currentScript has been clobbered 2017-02-24 14:53:22 +00:00
Peter Bacon Darwin a649758655 fix(Angular): do not auto bootstrap if the script source is bad and inside SVG 2017-02-24 14:52:13 +00:00
Peter Bacon Darwin c357b1aba6 test(Angular): refactor auto bootstrap tests 2017-02-24 14:46:27 +00:00
Martin Staffa 603b66e1fa docs(changelog): insert release notes for 1.2.32
They were only in the v1.2.x branch.
2017-02-24 11:09:11 +01:00
Martin Staffa 295043d32e docs($compile): clarify to which element scope isolation applies
Closes #13556
2017-02-22 21:05:44 +01:00
waahhhh 892d236afc docs(changelog): correct typo
changed spelling from "auto-bootstraping" to "auto-bootstrapping".

Closes #15729
2017-02-21 15:20:14 +01:00
Peter Bacon Darwin b7ee5ee3c6 chore(jenkins): disable unit testing on Safari
There is a strange failure in the animation code that only appears to happen
on Safari 10 on OS/X. While we investigate we are disabling this browser
to allow the development (and doc generation) to continue.
2017-02-20 20:09:38 +00:00
Georgios Kalpakas b55637a8f7 fix($animate): reset classNameFilter to null when a disallowed RegExp is used
Closes #14913
2017-02-17 11:26:23 +02:00
Georgios Kalpakas 9a2efb7b66 fix($animate): improve detection on ng-animate in classNameFilter RegExp
Fixes #14806
2017-02-17 11:26:21 +02:00
Martin Staffa db46d24491 chore(docs-app): add debounce to search input
This fixes issues where the search results do not correctly reflect
the search query. This happens in Firefox when you enter a search query
very rapidly.
There is probably an issue with the async behavior of the search / webworker,
so this is just a workaround.
2017-02-16 14:28:43 +01:00
Keith Walsh f779230f70 docs($resource): add minor clarification
Closes #15711
2017-02-16 11:59:35 +02:00
Martin Staffa 62494bae38 chore(docs-app): update links in header menu
They are now in the same order as angularjs.org

Closes #14351
2017-02-15 15:53:51 +01:00
Martin Staffa f85656e934 chore(docs-app): update the header style
Also adds a new fixed strip / bar about the AngularJS version

Closes #14963
Closes #15670
2017-02-15 15:53:51 +01:00
Martin Staffa b9d3185e52 docs(select, ngOptions): add ngAttrSize as argument
Closes #1619
2017-02-15 15:25:25 +01:00
Martin Staffa 43cf54c3a2 docs(ngModelController): improve $formatters and $parsers info
Closes #11714
Closes #8194
2017-02-15 13:05:15 +01:00
Martin Staffa 15149c1da1 docs(filterFilter): add note about self-referencing objects in array
Relate #6655, #6319
2017-02-15 12:19:06 +01:00
Martin Staffa 23e747331b docs(guide/directive): clarify which type of matching directives support
Closes #15710
2017-02-15 12:19:06 +01:00
Georgii Dolzhykov 71f437c15a refactor($rootScope): remove extraneous call to $parse in $evalAsync
Closes #15682
2017-02-09 23:38:03 +02:00
Michał Gołębiowski 2c7400e7d0 chore(jenkins): get rid of Opera from the Jenkins build script
The Opera launcher hasn't been installed for ages, but until Karma 1.4.0 the
error of Opera not being able to start was ignored. Karma has fixed the bug and
now Jenkins is failing.

This commit also removes Opera/Opera launcher mentions from the docs. We don't
support Opera officially anymore (it's sort-of supported via being based on
Blink).

Closes #15691
2017-02-09 12:56:59 +02:00
PRIJCK Frederik (FPRJ) 2af2607fba fix(filterFilter): don't throw if key.charAt is not a function
Previously, when an object has keys which are not of type string, `filterFilter`
would throw an exception for trying to call `key.charAt()`, which is a string
method.

This commit checks whether `charAt` is defined before calling it.

Fixes #15644

Closes #15660
2017-02-08 23:17:26 +02:00
mohamed amr a0641ea475 feat(errorHandlingConfig): make the depth for object stringification in errors configurable
Closes #15402
Closes #15433
2017-02-08 19:05:43 +02:00
Martin Staffa 538f4606ff fix(select): add attribute "selected" for select[multiple]
This helps screen readers identify the selected options,
see #14419
2017-02-08 17:44:47 +01:00
Martin Staffa 4385e1268a fix(select): keep original selection when using shift to add options in IE/Edge
In IE9-11 + Edge, the selected options were previously incorrect under the following
circumstances:
- at least two options are selected
- shift+click or shift+down/up is used to add to the selection (any number of options)

In these cases, only the last of the previously selected options and the newly selected
options would be selected.

The problems seems to be that the render engine gets confused when an option that
already has selected = true gets selected = true set again.

Note that this is not testable via unit test because it's not possible to simulate
click / keyboard events on option elements (the events are delegated to the select element
change event), and the problem also doesn't appear when modifying the option elements directly
and then using the selectController API. It seems that this only happens when you manipulate the
select directly in the user interface.

Fixes #15675
Closes #15676
2017-02-08 17:44:47 +01:00
Martin Staffa ba8b924bf5 test($http): ensure json deserialization errors are forwarded to error handler
Since https://github.com/angular/angular.js/commit/e13eeabd7e34a78becec06cfbe72c23f2dcb85f9,
errors thrown from onFulfilled and onRejected handlers are passed to the regular http
error handlers. Before this, JSON deserialization errors lead to hard application errors, and could
not be handled by application code. This behavior was introduced in https://github.com/angular/angular.js/commit/7b6c1d08aceba6704a40302f373400aed9ed0e0b, and originally, a malformed JSON string was forwarded
as the data to the http success response handler.

This commit adds a specifc test case, even though the behavior is unlikely to break in the future without
a change in the $q rejection handling.

Related #11433
Closes #15689
2017-02-08 17:41:23 +01:00
Matt Lewis 0ce9348bc0 fix($jsonpCallbacks): allow $window to be mocked in unit tests
Fixes #15685

Closes #15686
2017-02-08 18:07:17 +02:00
Georgios Kalpakas a29f66c465 chore(*): update dependencies (including changez-angular) 2017-02-08 18:07:17 +02:00
Georgios Kalpakas 79c4a712d7 docs(changelog): update with changes for 1.6.2 2017-02-07 15:26:25 +02:00
Martin Staffa 2f667b177c docs(guide/scopes): mention component directive scopes, reorder info
Closes #15634
2017-02-06 17:25:14 +01:00
Martin Staffa 07f34e7af3 docs: fix some dangling links
They broke during the Angular -> AngularJS rename
2017-02-06 16:42:49 +01:00
Georgios Kalpakas 493b4967de test($resource): fix broken test
(Introduced while "cleaning up" the tests for in edfb691.)
2017-02-05 17:56:51 +02:00
Georgios Kalpakas 8c1b4c020d refactor(*): remove ignored expensiveChecks argument passed to $parse()
This is a follow-up to #15094.

Closes #15680
2017-02-05 15:38:27 +02:00
Kyle Wuolle edfb691deb fix($resource): do not swallow errors in success callback
Previously, errors thrown inside the `success` callback would be swallowed by a
noop `catch()` handler. The `catch()` handler was added in order to avoid an
unnecessary "Possibly Unhandled Rejection" error, in case the user provided an
`error` callback (which would handle request errors).

The handler was added too "eagrly" and as a result would swallow errors thrown
in the `success` callback, despite the fact that those errors would _not_ be
handled by the `error` callback.

This commit fixes this, by adding the `catch()` handler "lazily", only when it
is certain that a rejection will be handled by the `error` callback.

Fixes #15624

Closes #15628
2017-02-04 21:00:32 +02:00
Kindy Lin 8162362217 fix($parse): make sure ES6 object computed properties are watched
Add the missing watches for ES6 object computed properties which were
implemented in #14407.

Closes #15678
2017-02-04 16:16:04 +02:00
Dimitris Vardoulakis 15581287a4 refactor(*): avoid non-existent property warnings from Closure Compiler
Closes #15672
2017-02-02 22:37:17 +02:00
Chris fd76d872fc docs(misc/started): update Twitter handle (@angularjs --> @angular)
Closes #15671
2017-02-02 19:29:25 +02:00
Jessica Soltero 3708162bc8 docs(guide/expression): typo in one-time-binding
Closes #15668
2017-02-02 12:45:10 +02:00
Michał Gołębiowski 813117da31 refactor($injector): remove the Chrome stringification hack
The Chrome stringification hack added in afcedff34c
is no longer needed. I verified that both of the commented out tests pass
on Chrome 56.
2017-02-01 15:02:11 +00:00
Michał Gołębiowski dc8762eff1 chore(anchorScroll): remove a Jasmine toHaveBeenCalled workaround
The Jasmine fix landed long time ago and we've updated Jasmine since that
happened.
2017-02-01 13:36:08 +00:00
Michał Gołębiowski 1e3c7d2922 docs($location): fix examples
The examples contained tests with assertions in form of regular equality
comparisons which would be noops and in case of an error nothing would get
reported. Also, one of the test mixed a HTML5 browser scenario with a non-HTML5
one.
2017-02-01 13:35:01 +00:00
Michał Gołębiowski 187fce7cdf docs($animation): fix weird spaces around colons 2017-02-01 13:29:06 +00:00
Peter Bacon Darwin 2b00e8893e feat(ngModel): add $overrideModelOptions support
This change allows developers to modify the model options for an `ngModel`
directive programmatically.

Closes #15415
2017-02-01 12:19:37 +00:00
Patrick McElhaney d03357a320 docs(guide/component): add replace option
Add `replace` to the table comparing components to directives options. The
`replace` option is deprecated, but it is still documented for directives, so
it is worth pointing it out as a difference between directives and components.

Closes #15658
2017-01-31 19:34:29 +02:00
Georgios Kalpakas 03dbd94cb8 fix($compile): do not swallow thrown errors in test
In e13eeab, errors/rejections produced during fetching the template or compiling
an asynchronous directive, where overzealously silenced. This doesn't make any
difference in (most) production apps, where `$exceptionHandler` does not rethrow
the errors. In tests though (where `$exceptionHandler` rethrows by default), it
can unexpectedly "swallow" thrown errors.

This commit fixes it by removing the extraneous `.catch(noop)`, thus letting
errors thrown by `$exceptionHandler` to surface.

The changes in 'compileSpec.js' essentially revert the modifications that were
unnecessarily (and incorrectly) done in e13eeab (and also one incorrect
modification from [c22615c][1]).

[1]: https://github.com/angular/angular.js/commit/c22615cbfbaa7d1712e79b6bf2ace6eb41313bac#diff-348c2f3781ed66a24894c2046a52c628L2084

Fixes #15629

Closes #15631
2017-01-30 19:23:50 +02:00
Peter Bacon Darwin 0ef193f1a3 chore(docs): don't use bower for docs dependencies 2017-01-30 13:31:56 +00:00
Frederik Prijck dea8ae9af0 chore(doc-gen): show arguments as a subsection of the usage section
Previously, on the docs of directives which include the `animation` section, `arguments` are shown as an `h3` element below the `animation` `h2` element, making it look like it's a subsection of `animations`.

This commit ensures that the àrgument` `h3`element is rendered correctly after the `usage` `h2` element.

Fixes #15645
Closes #15646
2017-01-28 15:20:05 +01:00
vteremasov 39a90a9c20 fix($resource): correctly unescape /\. even if \. comes from a param value
Closes #15627
2017-01-27 18:15:49 +02:00
Jason Bedard fd4f011118 perf($compile): do not use deepWatch in literal one-way bindings
Avoiding deep watchers for array/object literals will improve watcher
performance of all literals passed as one-way bindings, especially those
containing references to large/complex objects.

BREAKING CHANGE:
Previously when a literal value was passed into a directive/component via
one-way binding it would be watched with a deep watcher.

For example, for `<my-component input="[a]">`, a new instance of the array
would be passed into the directive/component (and trigger $onChanges) not
only if `a` changed but also if any sub property of `a` changed such as
`a.b` or `a.b.c.d.e` etc.

This also means a new but equal value for `a` would NOT trigger such a
change.

Now literal values use an input-based watch similar to other directive/component
one-way bindings. In this context inputs are the non-constant parts of the
literal. In the example above the input would be `a`. Changes are only
triggered when the inputs to the literal change.

Closes #15301
2017-01-27 10:05:51 +00:00
Jason Bedard 7084deccaa feat($parse): allow watching array/object of inputs to literal values
The inputs of array/object literals are now watched for changes.
If the an input changes then a new instance of the literal will be
provided when the parsed expression is executed.

Closes #15301
2017-01-27 10:05:50 +00:00
frederikprijck 7019d9f27a fix($sniffer): allow history for NW.js apps
Previously `$sniffer` incorrectly detected NW.js apps as Chrome Packaged Apps,
disallowing them to use the history API.

This commit correctly detects NW.js apps and allows them to use the History API.

Fixes #15474

Closes #15633
2017-01-27 00:11:58 +02:00
Martin Staffa 89f3e3b0af fix(select): keep ngModel when selected option is recreated by ngRepeat
Fixes #15630 
Closes #15632
2017-01-26 13:29:11 +01:00
Georgios Kalpakas 641e13acc1 refactor(*): replace HashMap with NgMap
For the time being, we will be using `NgMap`, which is an API-compatible
implementation of native `Map` (for the features required in Angular). This will
make it easy to switch to using the native implementations, once they become
more stable.

Note:
At the moment some native implementations are still buggy (often in subtle ways)
and can cause hard-to-debug failures.)

Closes #15483
2017-01-25 23:20:18 +02:00
Georgios Kalpakas 028fa1abb2 test(hashKey): add tests for hashKey() 2017-01-25 23:17:06 +02:00
Martin Staffa 3c259ce624 docs(ngDisabled): list some elements that natively support
Closes #15473
2017-01-25 20:07:50 +01:00
Martin Staffa ef7d18b1c4 docs($compile): fix AngularJS versions 2017-01-25 20:03:04 +01:00
Peter Bacon Darwin 03043839d5 docs(*): ensure naming is correct for Angular(JS) versions 2017-01-25 08:18:39 +00:00
Georgios Kalpakas d24617bf32 fix(ngAnimate): correctly animate transcluded clones with templateUrl
Previously, `$animate` would decide whether an animation should be cancelled
based on some assumption that didn't hold in specific cases (e.g. when animating
transcluded clones with `templateUrl` directives on them for the first time). As
a result, the entering elements would not be animated in such cases. This
affected commonly used, structural built-in directives (`ngIf`, `ngRepeat`,
`ngSwitch` etc).
This commit fixes it by avoiding invalid assumptions (i.e. by taking into
account the transformations that take place while compiling such elements).

Partly addresses #14074 and #14124.

Fixes #15510

Closes #15514
2017-01-24 23:54:33 +02:00
Georgios Kalpakas 2b7a359363 test(ngAnimate): make expectations more specific 2017-01-24 23:54:33 +02:00
Georgios Kalpakas e7d8eee46d refactor(ngAnimate): simplify functions and remove redundant args/calls
Simplifies/Optimizes the following functions:

- `areAnimationsAllowed()`
- `cleanupEventListeners()`
- `closeChildAnimations()`
- `clearElementAnimationState()`
- `markElementAnimationState()`
- `findCallbacks()`

Although not its primary aim, this commit also offers a small performance boost
to animations (~5% as measured with the `animation-bp` benchmark).
2017-01-24 23:54:32 +02:00
Georgios Kalpakas 565ca6a1f5 chore(benchmarks): add basic animation benchmark 2017-01-24 23:54:32 +02:00
Georgios Kalpakas 54a7caf667 docs(*): document the breaking change in 7ceb5f6 2017-01-20 22:47:27 +02:00
Peter Bacon Darwin eba7c28261 chore(package): relax yarn version constraint 2017-01-19 08:18:40 +00:00
Peter Bacon Darwin 83b67b6c54 revert:docs(guide/scope): access the current element's scope in the console
This reverts commit c6bd58eb58.
The recommended approach of just typing scope does not appear to work out of the box.

See https://github.com/angular/angular.js/pull/4884#issuecomment-273686380
2017-01-19 07:55:33 +00:00
frederikprijck d85b3f56ac fix(ngValue): correctly update the value property when value is undefined
Previously, when the expression evaluated to `undefined` the `value` property
was not updated. This happened because jqLite/jQuery's `prop(_, undefined)` is
treated as a getter, thus not apdating the property.

This commit fixes it by setting the property to `null` instead.
(On IE9 we use `''` - see inline comments for more info.)

Fixes #15603

Closes #15605
2017-01-18 19:01:11 +02:00
Raphael Jamet 1cf728e209 fix($compile) : add base[href] to the list of RESOURCE_URL context attributes
Previously, `base[href]` didn't have an SCE context. This was not ideal, because
`base[href]` affects the behavior of all relative URLs across the page.
Furthermore, since #15145, `base[href]` also affects which URLs are considered
trusted under the 'self' policy for white- or black-listed resource URLs.

This commit tightens the security of Angular apps, by adding `base[href]` to the
list of RESOURCE_URL context attributes, essentially putting the same
constraints on bindings to `base[href]` as on iframe or script sources.

Refer to the
[`$sce` API docs](https://code.angularjs.org/snapshot/docs/api/ng/service/$sce)
for more info on SCE trusted contexts.

Closes #15597

BREAKING CHANGE:

Previously, `<base href="{{ $ctrl.baseUrl }}" />` would not require `baseUrl` to
be trusted as a RESOURCE_URL. Now, `baseUrl` will be sent to `$sce`'s
RESOURCE_URL checks. By default, it will break unless `baseUrl` is of the same
origin as the application document.

Refer to the
[`$sce` API docs](https://code.angularjs.org/snapshot/docs/api/ng/service/$sce)
for more info on how to trust a value in a RESOURCE_URL context.

Also, concatenation in trusted contexts is not allowed, which means that the
following won't work: `<base href="/something/{{ $ctrl.partialPath }}" />`.

Either construct complex values in a controller (recommended):

```js
this.baseUrl = '/something/' + this.partialPath;
```
```html
<base href="{{ $ctrl.baseUrl }}" />
```

Or use string concatenation in the interpolation expression (not recommended
except for the simplest of cases):

```html
<base href="{{ '/something/' + $ctrl.partialPath }}" />
```
2017-01-18 12:02:15 +02:00
Martin Brown 675f99bc5a docs(guide/i18n): fix typos
Closes #15616
2017-01-17 18:09:19 +02:00
Georgios Kalpakas 5b6763f575 docs(changelog): update with changes for 1.5.11 2017-01-13 01:07:45 +02:00
Georgios Kalpakas 22392ef949 style($compile): remove trailing whitespace 2017-01-12 23:12:01 +02:00
Grace Benz f63c46406f docs($compile): add some detail about $onChanges
Closes #15604
2017-01-12 22:39:47 +02:00
Georgios Kalpakas 3983a66eda test(e2e): make test less flakey-prone 2017-01-12 22:24:49 +02:00
Peter Bacon Darwin 74e232dab7 fix(ngMockE2E): ensure that mocked $httpBackend uses correct $browser
The fix from #13124 enabled ngMock and ngMockE2E to work together but
did it in a way that meant that the "real" `$httpBackend` service that
was used in pass-through depended upon a different `$browser` service
to the rest of the app.

This broke Protractor since it watches the `$browser` for outstanding
requests and the pass through requests were being tracked by the wrong
`$browser` instance.

Closes #15593
2017-01-12 09:46:24 +00:00
Georgios Kalpakas 2e27df690c chore(*): update dgeni-packages (and other devDependencies)
`dgeni-packages` prior to version 0.16.3 specified `engine.yarn: '^0.17.9'`,
which was unnecessarily strict and would cause any task to fail if someone had a
yarn version >=0.18.0.
Other devDependencies were also updated (because why not).

Closes #15600
2017-01-12 00:33:26 +02:00
Sammy Jelin c522a43f41 fix($route): make asynchronous tasks count as pending requests
Protractor users were having a problem where if they had asynchonous code in a
`route.resolve` or `route.resolveRedirectTo` variable, Protractor was not
waiting for that code to complete before continuing. See
https://github.com/angular/protractor/issues/789#issuecomment-190983200 for
details.

This commit fixes it by ensuring that `$browser#outstandingRequestCount` is
properly increased/decreased while `$route` (asynchronously) processes a route.

Also, enhanced `ngMock` to wait for pending requests, before calling callbacks
from `$browser.notifyWhenNoOutstandingRequests()`.

Related to angular/protractor#789.

Closes #14159
2017-01-12 00:07:22 +02:00
frederikprijck 9c722cfcd2 fix($compile): allow the usage of "$" in isolate scope property alias
Previously, when using an alias for an isolate scope or `bindings` property
(e.g. `alias: '<attrName'` instead of `attrName: '<'`), a `$compile:iscp` error
was thrown if the attribute name contained a "$".
This commit removes the error by changing the regex to allow "$" characters in
the attribute name when using a property alias.

Fixes: #15586

Closes #15594
2017-01-11 11:39:03 +02:00
Alex Dobkin 9412962696 fix($sce): consider document base URL in 'self' URL policy
Page authors can use the `<base>` tag in HTML to specify URL to use as a base
when resovling relative URLs. This can cause SCE to reject relative URLs on the
page, because they fail the same-origin test.

To improve compatibility with the `<base>` tag, this commit changes the logic
for matching URLs to the 'self' policy to allow URLs that match the protocol and
domain of the base URL in addition to URLs that match the loading origin.

**Security Note:**
If an attacker can inject a `<base>` tag into the page, they can circumvent SCE
protections. However, injecting a `<base>` tag typically requires the ability to
inject arbitrary HTML into the page, which is a more serious vulnerabilty than
bypassing SCE.

Fixes #15144

Closes #15145
2017-01-10 14:20:15 +02:00
Georgios Kalpakas 752f411c8b fix($location): correctly handle external URL change during $digest
Previously, when the URL was changed directly (e.g. via `location.href`) during
a `$digest` (e.g. via `scope.$evalAsync()` or `promise.then()`) the change was
not handled correctly, unless a `popstate` or `hashchange` event was fired
synchronously.

This was an issue when calling `history.pushState()/replaceState()` in all
browsers, since these methods do not emit any event. This was also an issue when
setting `location.href` in IE11, where (unlike other browsers) no `popstate`
event is fired at all for hash-only changes ([known bug][1]) and the
`hashchange` event is fired asynchronously (which is too late).

This commit fixes both usecases by:

1. Keeping track of `$location` setter methods being called and only processing
   a URL change if it originated from such a call. If there is a URL difference
   but no setter method has been called, this means that the browser URL/history
   has been updated directly and the change hasn't yet been propagated to
   `$location` (e.g. due to no event being fired synchronously or at all).
2. Checking for URL/state changes at the end of the `$digest`, in order to
   detect changes via `history` methods (that took place during the `$digest`).

[1]: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3740423/

Fixes #11075
Fixes #12571
Fixes #15556

Closes #15561
2017-01-09 23:58:10 +02:00
Georgios Kalpakas 2b360bf305 fix(*): detect external changes in history.state
Previously, `$browser.$$checkUrlChange()` (which was run before each `$digest`)
would only detect an external change (i.e. not via `$location`) to the browser
URL. External changes to `history.state` would not be detected and propagated to
`$location`.

This would not be a problem if changes were followed by a `popstate` or
`hashchange` event (which would call `cacheStateAndFireUrlChange()`). But since
`history.pushState()/replaceState()` do not fire any events, calling these
methods manually would result in `$location` getting out-of-sync with the actual
history state.

This was not detected in tests, because the mocked `window.history` would
incorrectly trigger `popstate` when calling `pushState()/replaceState()`, which
"covered" the bug.

This commit fixes it by always calling `cacheState()`, before looking for and
propagating a URL/state change.
2017-01-09 23:57:31 +02:00
Nikhil Wins c00903be7a refactor($interpolate): remove unnecessary else
Closes: #15575
2017-01-05 13:57:56 +01:00
David Jöch 3776b2ef30 style($log): fix indentation
Closes #15579
2017-01-05 13:02:01 +02:00
Florian Berger e193cda800 docs(*): fix typos
Closes #15577
2017-01-05 11:04:17 +02:00
Nic Mitchell 296e9f6cdf chore(*): update copyright year
Closes #15573
2017-01-04 12:14:45 +02:00
Georgios Kalpakas 035f1cd90e docs(guide/$location): correctly format heading 2017-01-03 22:36:28 +02:00
Georgios Kalpakas 0694af8fc4 fix(angularInit): allow auto-bootstraping from inline script
Some browsers (e.g. Safari 9.x, PhantomJS) do not set `link.origin/protocol`
correctly, when setting `link.href` to `null`, which prevented auto-bootstraping
Angular from scripts without a `src` attribute (i.e. inline scripts).
Inline scripts are on the same origin as the loading page, so auto-bootstraping
should be allowed.

Fixes #15567

Closes #15571
2017-01-03 19:14:57 +02:00
Soumya Ranjan Mohanty 090a839ac9 docs(guide/services): fix syntax for Jasmine v2.x
Closes #15570
2017-01-03 16:13:22 +02:00
Georgios Kalpakas 5294d208ae docs(ngShow/ngHide): improve docs and fix inconsistencies between ngShow/ngHide
Closes #15471
2017-01-03 12:41:11 +02:00
Deco 4082fb03b6 docs(tutorial/step_04): fix typo
Closes #15562
2016-12-31 12:31:31 +02:00
Georgios Kalpakas a24777a2c4 fix(input): fix step validation for input[type=number/range]
Previously, the validation would incorrectly fail in certain cases (e.g.
`step: 0.01`, `value: 1.16 or 20.1`), due to Floating Point Arithmetic
limitations. The previous fix for FPA limitations (081d06ff) tried to solve the
issue by converting the numbers to integers, before doing the actual
calculation, but it failed to account for cases where the conversion itself
returned non-integer values (again due to FPA limitations).
This commit fixes it by ensuring that the values used in the final calculation
are always integers.

Fixes #15504

Closes #15506
2016-12-29 10:16:07 +02:00
Georgios Kalpakas 99a3adbdaa docs(CHANGELOG.md): add missing commas 2016-12-29 10:08:40 +02:00
supasak 922a83e94f fix($resource): delete $cancelRequest() in toJSON()
Closes #15244
2016-12-29 10:00:42 +02:00
Peter Bacon Darwin ee1458fdba docs(CHANGELOG): add 1.6.1 release info 2016-12-23 10:53:38 +00:00
Peter Bacon Darwin cfc16b17f7 chore(deps): update changez-angular version 2016-12-23 10:52:32 +00:00
Naomi Black 8ceeeccdd7 docs(guide/forms): remove implicit bias from example
Closes #15543
2016-12-23 11:42:16 +02:00
Thomas Grainger 316f60fd14 fix($q): Add traceback to unhandled promise rejections
Fixes #14631
Closes #15527
2016-12-21 20:08:24 +01:00
sp00m f768da2488 fix($$cookieReader): correctly handle forbidden access to document.cookie
In certain cases (e.g. on LG webOS using the `file:` protocol), access to
`document.cookie` may not be allowed and throw an error. This could break
`$http` which relies on `$$cookieReader()` for retrieving the XSRF token.
This commit fixes it by treating `document.cookie` as empty, when access to it
is fordibben.

Fixes  #15523

Closes #15532
2016-12-20 23:28:34 +02:00
Simon Legner c898ae9e45 docs(CHANGELOG): fix typo
Closes #15529
2016-12-20 10:29:36 +02:00
Thomas Grainger 47b14bf3e3 docs(guide/migration): improve grammar
Closes #15526
2016-12-20 01:16:24 +02:00
Georgios Kalpakas 4e143fcae3 fix(ngOptions): do not unset the selected property unless necessary
Previously, when updating the value of a `select[multiple]` element, all options
were first set to `selected = false` and then the selected ones were set to
`true`. By setting an already selected option to `selected = false` and then
`true` again - essentially unselecting and reselecting it - caused some browsers
(including Firefox, IE and under some circumstances Chrome) to unexpectedly
scroll to the last selected option.

This commit fixes it by ensuring that the `selected` property is only set if its
current value is different than the new one and even then it is set to its final
value at once (i.e. without first setting it to `false`), thus avoiding the
undesirable behavior.

Fixes #15477

Closes #15478
2016-12-19 22:44:36 +02:00
Peter Neave 15d07c0108 docs(tutorial/step_13): add missing dependency phoneDetails module
Closes #15521
2016-12-19 20:53:38 +02:00
Peter Bacon Darwin d08e31984d chore(doc-gen): update to dgeni-packages@0.16.2 2016-12-16 14:08:37 +00:00
Georgios Kalpakas fbe0b73ab5 docs(CHANGELOG.md): remove reverted bug fix
Related to 02f045b.
2016-12-16 11:11:22 +02:00
Peter Bacon Darwin 07987e26e9 docs(CHANGELOG): add note to 1.5.0-beta.1 2016-12-15 20:41:13 +00:00
Georgios Kalpakas c6842b5a65 docs(CHANGELOG.md): add changes for v1.5.10 2016-12-15 19:18:29 +02:00
Georgios Kalpakas baa30695f3 docs(CHANGELOG.md): add missing entries for v1.6.0-rc.0/v1.6.0 2016-12-15 19:18:28 +02:00
Georgios Kalpakas d03cac4cd5 docs($q): document the default value for errorOnUnhandledRejections 2016-12-14 00:43:52 +02:00
Jannick Fahlbusch e9a4de035d docs($interval): improve fn description
If no additional arguments are passed, the function is called with the current iteration count.

Closes #15503
2016-12-13 14:07:58 +02:00
Georgios Kalpakas ce8abac66d fix(ngModelOptions): work correctly when on the template of replace directives
Previously, in order for `ngModel` and `ngModelOptions` to work correctly
together, the latter's pre-linking function should be run before the former's
pre-linking function. This was typically what happened, except when `ngModel`
was used on an element which also had a `replace` directive, whose template
included `ngModelOptions`. In that case, the order was reversed.

This commit fixes it by moving the initialization logic of `ngModelOptions` from
its pre-linking function to its controller's `$onInit()` lifecycle hook.

Fixes #15492

Closes #15493
2016-12-13 00:09:56 +02:00
Georgios Kalpakas fade1db253 refactor(testabilityPatch): remove code duplication 2016-12-13 00:04:57 +02:00
Aaron Brewer 29f3bf4bd6 docs(ngMessageExp): improve description
Closes #15486
2016-12-11 20:58:13 +02:00
idhindsight 7f8bc587ae docs(tutorial/step_09): fix typo (it's --> its)
Closes #15485
2016-12-10 22:15:35 +02:00
David Rodenas Pico 1ecf6efa81 chore(benchpress): add an ngClass benchmark
Closes #15243
2016-12-09 12:20:31 +02:00
Georgios Kalpakas b82097085d perf(ngClass): avoid unnecessary .data() accesses, deep-watching and copies
Includes the following commits (see #15246 for details):

- **perf(ngClass): only access the element's `data` once**

- **refactor(ngClass): simplify conditions**

- **refactor(ngClass): move helper functions outside the closure**

- **refactor(ngClass): exit `arrayDifference()` early if an input is empty**

- **perf(ngClass): avoid deep-watching (if possible) and unnecessary copies**

  The cases that should benefit most are:

  1. When using large objects as values (e.g.: `{loaded: $ctrl.data}`).
  2. When using objects/arrays and there are frequent changes.
  3. When there are many `$index` changes (e.g. addition/deletion/reordering in large `ngRepeat`s).

  The differences in operations per digest include:

  1. `Regular expression (when not changed)`
     **Before:** `equals()`
     **After:**  `toClassString()`

  2. `Regular expression (when changed)`
     **Before:** `copy()` + 2 x `arrayClasses()` + `shallowCopy()`
     **After:**  2 x `split()`

  3. `One-time expression (when not changed)`
     **Before:** `equals()`
     **After:**  `toFlatValue()` + `equals()`*

  4. `One-time expression (when changed)`
     **Before:** `copy()` + 2 x `arrayClasses()` + `shallowCopy()`
     **After:**  `copy()`* + `toClassString()`* + 2 x `split()`

  5. `$index modulo changed`
     **Before:** `arrayClasses()`
     **After:**  -

  (*): on flatter structure

  In large based on #14404. Kudos to @drpicox for the initial idea and a big part
  of the implementation.

Closes #14404

Closes #15246
2016-12-09 11:49:10 +02:00
Georgios Kalpakas 5fd5e131b6 fix(ngClassOdd/Even): add/remove the correct classes when expression/$index change simultaneously 2016-12-09 11:49:09 +02:00
David Rodenas Pico 7b2ed4ae41 test(ngClass): add some tests about one-time bindings and objects inside arrays 2016-12-09 11:49:09 +02:00
Georgios Kalpakas 7c80d8afa9 refactor(ngClass): remove redundant $observer and dependency on $animate
Includes the following commits (see #15246 for details):

- **refactor(ngClass): remove unnecessary dependency on `$animate`**

- **refactor(ngClass): remove redundant `$observe`r**

  The code was added in b41fe9f in order to support having both `ngClass` and
  interpolation in `class` work together. `ngClass` has changed considerably since
  b41fe9f and for simple cases to work the `$observe`r is no longer necessary (as
  indicated by the expanded test still passing).

  That said, it is a [documented known issue][1] that `ngClass` should not be used
  together with interpolation in `class` and more complicated cases do not work
  anyway.

[1]: https://docs.angularjs.org/api/ng/directive/ngClass#known-issues
2016-12-09 11:48:02 +02:00
Aman Mittal d05f894aff docs(guide/external-resources): add "AngularJS in Action" book
Closes #15480
2016-12-09 11:34:53 +02:00
Georgios Kalpakas 1c0c2605d3 fix($rootScope): when adding/removing watchers during $digest
Previously, adding a watcher during a `$digest` (i.e. from within a watcher),
would result in the next watcher getting skipped. Similarly, removing a watcher
during a `$digest` could result in the current watcher being run twice (if the
removed watcher had not run yet in the current `$digest`).

This commit fixes both cases by keeping track of the current watcher index
during a digest and properly updating it when adding/removing watchers.

Fixes #15422

Closes #15424
2016-12-09 10:39:54 +02:00
Peter Bacon Darwin 5b477614ff chore(docs): fix plnkrOpener to use $onInit
Since 1.6.0 does not preassign bindings before running the controller
constructor function, we must move initialisation into the `$onInit`
method.
2016-12-09 01:12:59 +00:00
Peter Bacon Darwin 9595337f67 chore(package): update docs app to run on 1.6.0 2016-12-08 23:42:55 +00:00
Georgios Kalpakas a9e91461a8 fix(jqLite): silently ignore after() if element has no parent
Previously, the element was always assumed to have a parent and an error was
thrown when that was not the case.
This commit makes jqLite consistent with jQuery, which silently ignores a call
on elements that do not have a parent.

Fixes #15331
Closes #15367

Closes #15475
2016-12-08 18:11:34 +02:00
Peter Bacon Darwin 4e7f652b5f chore(package): update dist-tag for master/1.7 2016-12-08 13:56:34 +00:00
Georgios Kalpakas e922c38612 docs(ngMockE2E): correctly document the data arg of $httpBackend.when(...) 2016-12-08 14:53:47 +02:00
Peter Bacon Darwin 1b7ddd3491 chore(bower/npm): use npm (not yarn) to publish
yarn has an annoying behaviour in that it wants to do the version bumping
for you and requires an interactive terminal to tell it what version.
2016-12-08 12:21:57 +00:00
Peter Bacon Darwin 4c5afb5cc2 chore(jenkins): ensure deps are installed before trying to use them 2016-12-08 11:07:52 +00:00
Peter Bacon Darwin f0dc288824 chore(jenkins): fix working directory to make yarn work 2016-12-08 10:53:07 +00:00
Peter Bacon Darwin 70490ef717 docs(CHANGELOG): fix 1.6.0 release name 2016-12-08 10:21:48 +00:00
Peter Bacon Darwin dfef3bf2d4 chore(package): update dist-tag for 1.6.0 release 2016-12-08 10:18:07 +00:00
Peter Bacon Darwin f727adddeb docs(CHANGELOG): 1.6.0 release notes 2016-12-08 10:15:05 +00:00
Peter Bacon Darwin fc89a85406 chore(jenkins): fix yarn and grunt installation 2016-12-07 10:53:37 +00:00
Georgios Kalpakas b4f5377a2f docs(guide/migration): fix typo 2016-12-07 01:55:48 +02:00
Georgios Kalpakas 7a667c77e3 fix(select): do not throw when removing the element (e.g. via ngIf)
Fixes #15466

Closes #15468
2016-12-06 12:43:34 +02:00
Georgios Kalpakas 752b1e69b7 fix($resource): allow params in hostname (except for IPv6 addresses)
Support for IPv6 addresses (in b643f0d) was too aggressive and broke support for params in the
`hostname` part of a URL.
This commit restores support for params in the `hostname`, as long as it is not an IPv6 address.

Fixes #14542

Closes #14906
2016-12-03 09:56:18 +02:00
ojab 1102c84f59 docs(guide/templates): camelCase directive name for consistency
Closes #15465
2016-12-02 23:40:22 +02:00
Martin Staffa 245b27101a fix(ngOptions): don't add comment nodes as empty options
When the "empty option" element contains a transclusion directive, the result of the compilation always includes a comment node. Since we are adding / removing the "selected" attribute on the empty option, we need to make sure it's an actual element.

To solve this, we take advantage of the fact the each option element has an option directive that tries to register the option with the selectController. With ngOptions, this registerOption function is normally noop'd since it's not possible to add dynamic options. Now if the result of the empty option compilation is a comment, we re-define the function so that it catches empty options when they are actually linked / rendered.

Closes #15454
Closes #15459
2016-12-02 18:48:49 +01:00
Martin Staffa f5d2bf3d6e chore(doc-gen): render @example tag in ngdoc @method
Currently, ngdoc `@method` ignores `@example` tags and does not output them.
This is usually not a problem, as examples are mostly defined directly
in the `@description` via code blocks or `<example>`
elements. However, some methods still have `@example` tags (possibly
from a previous docs version).

While not absolutely necessary, having special markup for Examples
makes them a) easier to find visually in the docs, and b) easier
to link to as they will have a unique id.

Closes #14722
Closes #15448
2016-12-01 16:11:25 +01:00
Georgios Kalpakas 9c2d0b8af3 test($compile): work around Chrome issue with reported size for <foreignObject>
Since Chrome 53-57+, the reported size of `<foreignObject>` elements and their
descendants is affected by global display settings (e.g. font size) and browser
settings (e.g. default zoom level). This could cause tests incorrectly failing
due to such settings.

In order to avoid false negatives, we now compare against the size of the
equivalent, hand-written SVG instead of fixed widths/heights.

Fixes #15333

Closes #15458
2016-12-01 14:28:39 +02:00
Rob Wu 465d173455 feat(security): do not bootstrap from unknown schemes with a different origin 2016-12-01 11:29:22 +00:00
Martin Staffa f1db7d735b docs(ngModelOptions): fix broken layout because of code section 2016-11-29 23:51:13 +01:00
Peter Bacon Darwin b77defde81 docs(contribute): mention nvm-windows 2016-11-29 13:25:59 +00:00
Peter Bacon Darwin afafb7a8ab docs(FAQ) add link to security guide 2016-11-29 13:25:58 +00:00
Peter Bacon Darwin f04fcdfe9f chore(grunt): check node, yarn and grunt-cli versions
If global versions of node, yarn or grunt-cli don't match what we expect then blow up.
2016-11-29 13:25:58 +00:00
Peter Bacon Darwin 5dd3a35f47 chore(grunt): run gulp directly rather than through npm 2016-11-29 13:25:58 +00:00
Peter Bacon Darwin ca139dee8e chore(utils): install npm-run to simplify scripts 2016-11-29 13:25:58 +00:00
Peter Bacon Darwin 099083352a chore(travis): install grunt-cli globally to simplify scripts 2016-11-29 13:25:57 +00:00
Peter Bacon Darwin f54e9242fc chore(jenkins): remove path to grunt
grunt is installed globally on jenkins so we can just use it directly.
2016-11-29 13:25:57 +00:00
Peter Bacon Darwin d003ec1d41 docs(ComponentRouter): it is unlikely ever to appear on bower or CDN 2016-11-29 13:25:57 +00:00
Peter Bacon Darwin aadee894da chore(validate-commit): remove redundant scripts 2016-11-29 13:25:57 +00:00
Peter Bacon Darwin ad4e86a582 chore(saucelabs): update sauce-connect to 4.4.1 2016-11-29 13:25:57 +00:00
Peter Bacon Darwin e8f9cbfdce chore(bower): set clone depth to speed up releases
We already use `git clone ... --depth=1` for the `code.angularjs.org`
repository, which speeds up the cloning of the repository.
2016-11-29 13:25:57 +00:00
Peter Bacon Darwin d4863a82fa chore(npm-bundle-deps): remove unused script
This became reduntant as of 507ee2d9ba
2016-11-29 13:25:57 +00:00
Peter Bacon Darwin 736b6c7fed style(*): fix no-useless-escape eslint errors 2016-11-29 13:25:56 +00:00
Peter Bacon Darwin 1dedcdf2bc docs(*): switch from npm to yarn 2016-11-29 13:25:56 +00:00
Peter Bacon Darwin 05c3336f92 chore(dependencies): USE YARN (and node 6) 2016-11-29 13:24:50 +00:00
Martin Staffa d1e4f5728c chore(docs-app): improve deprecation box layout
Deprecated boxes for APIs appear right under the header and were missing
a bit of margin. Boxes for methods still look good even with the
additional margin.
2016-11-28 19:01:43 +01:00
Wesley Cho 9f61e74be3 docs($rootScope): add note about watching File objects
- Add note recommending against watching `File` objects with deep watchers

Closes #15440
2016-11-28 18:50:36 +01:00
Wesley Cho 4059600d20 docs(*): add deprecation notice for angular.lowercase/uppercase
Closes #15441
Closes #14316
2016-11-28 18:50:36 +01:00
Georgios Kalpakas c625b0d568 chore(docs): use correct script-URL for plnkr on snapshot
Fixes #15437

Closes #15438
2016-11-28 12:14:55 +02:00
Wesley Cho 04cbe1e74f refactor($q): replace occurrences of .when() with .resolve()
Related to #13709.

Closes #15442
2016-11-28 12:02:10 +02:00
Georgios Kalpakas 9399d68d98 docs(*): document the breaking change introduced in e1da4be (#15434)
Closes #15434
2016-11-25 11:38:50 +00:00
Peter Bacon Darwin 4a320ab9f0 docs(CHANGELOG): add missing feature to 1.6.0-rc.0 2016-11-25 09:59:14 +00:00
Georgios Kalpakas 44f9ae6126 docs(input[number]): fix typo 2016-11-25 10:44:39 +02:00
Peter Bacon Darwin cdb9e08f4e docs(CHANGELOG): add missing "closes" link 2016-11-24 21:34:31 +00:00
Peter Bacon Darwin dcfcf81893 docs(CHANGELOG): add release notes for 1.6.0-rc.2 2016-11-24 21:30:56 +00:00
Peter Bacon Darwin d7cc863105 docs(CHANGELOG): add release notes for 1.5.9 2016-11-24 20:16:03 +00:00
Martin Probst 6e91f9c25d style: fix CI failure (#15429) 2016-11-23 23:04:05 -08:00
Martin Probst 7f1b8bdfe1 feat(security): explicitly whitelist URL schemes for bootstrap. (#15427)
Many browsers have some extension URL scheme. It is unclear how many of
those have the security issue of allowing parser-inserted loads of
extension URLs.

To be conservative, this code whitelists the URL schemes that are known
to be subject to CSP, i.e. the ones that are expected and safe.
2016-11-23 15:44:43 -08:00
Michał Gołębiowski cc92da0d67 chore(*): cleanup msie handling; add support comments
1. The conditions checking the msie variable value have been simplified.
There is e.g. no point to check if `msie <= 11` since there IE 12 won't ever
exist.
2. Edge UA-sniffing has been added to tests (only!) where appropriate
3. Support comments for IE/Edge have been added.

Closes #15407
2016-11-23 14:42:04 +00:00
Packt c9bb5b9fa4 docs(external-resources): add new book link and alphabetize
Closes #15421
2016-11-23 14:39:06 +00:00
Michał Gołębiowski c54921008d chore(ngAnimate): cleanup vendor prefixes handling in tests
1. Change all transition/transform/animation-related ss.addRule to
   ss.addPossiblyPrefixedRule to account for the -webkit- prefix.
2. Remove manually added -webkit-prefixed rules in favor of automatically
   handling them in ss.addPossiblyPrefixedRule.

Closes #15406
2016-11-23 14:28:12 +01:00
Martin Staffa 69f59f2d01 docs($compile, guide/compiler): add "double compilation" known issue
Related #15278
Closes #15392
2016-11-23 13:52:48 +01:00
Martin Staffa f4fb6e0983 perf(*): don't trigger digests after enter/leave of structural directives
ngIf, ngInclude, ngSwitch, and ngView now use the `done` callback functions on animation runners returned
by leave/enter animations to do internal cleanup (and $anchorScroll for ngInclude and ngView).
Previously, they were using promise callbacks (`then`), which caused an unnessecary digest.

Background:

In https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9, animation
promises where introduced instead of animation callbacks. These promises were however not tied to
the digest cycle, so you had to manually call `$apply` inside them.

This was changed in https://github.com/angular/angular.js/commit/c8700f04fb6fb5dc21ac24de8665c0476d6db5ef,
so animation promise callbacks would always trigger a `$digest`. This meant that several built-in
directives would now trigger additional digests on leave (ngIf, ngSwitch) or enter/leave (ngInclude,
ngView). The `done` callback, which receives a single argument indicating success / failure was
introduced to allow digest-less responses, but wasn't applied to these directives.

Note that this applies to all calls to $animate.enter/leave, even if ngAnimate isn't included, and
no actual animations are running, because the animation runner code is in the core ng module.

Fixes #15322
Closes #15345
2016-11-23 13:30:41 +01:00
Martin Staffa a18be15137 style(ngIfSpec.js, ngIncludeSpec.js): add top level describe 2016-11-23 13:30:41 +01:00
Martin Staffa 05a9d3a73c docs(*): add more info deprecation versions 2016-11-23 00:10:54 +01:00
Georgios Kalpakas 60035f597c docs(guide/directive): minor wording and styling fixes 2016-11-22 14:49:26 +02:00
Georgios Kalpakas 0af21a48e5 docs(CHANGELOG.md): minor fixes/tweaks 2016-11-22 09:48:08 +02:00
Santi Albo 991a2b30e0 fix($sce): fix adjustMatcher to replace multiple '*' and '**'
`adjustMatcher` was only replacing the first occurrences of '*' and '**'
that were found in whitelisted and blacklisted url strings.

Closes ##7897
2016-11-21 14:51:48 +00:00
Peter Bacon Darwin fc4afd0c1b docs(CHANGELOG): add 1.6.0-rc.1 changes
Closes #15364
2016-11-21 13:27:47 +00:00
Peter Bacon Darwin d5109e26e4 docs(CHANGELOG): minor typos and fixes 2016-11-21 13:27:47 +00:00
Georgios Kalpakas cf3c736b61 docs(guide/migrate): fix typo in code (&amp; --> &) 2016-11-21 14:21:55 +02:00
Georgios Kalpakas b343e7a560 docs(error/ng:areq): fix typo 2016-11-21 12:55:11 +02:00
Karthikeyan 5ff5815f51 docs(error/ng:areq): mention common error cause
Closes #15414
2016-11-21 12:51:00 +02:00
Georgios Kalpakas a144c1c022 docs(guide/migration): add "Migrate 1.5 to 1.6" section
Closes #15399
2016-11-18 22:04:12 +00:00
Peter Bacon Darwin d79f9b3693 docs(*): fix up deprecation notices 2016-11-18 13:51:56 +00:00
Peter Bacon Darwin f56926a77d chore(docs): deprecation notices for methods and properties
Closes #15351
Closes #15394
2016-11-18 13:51:56 +00:00
Peter Bacon Darwin 17e98ace48 chore(docs): bring in all templates from dgeni-packages 2016-11-18 11:28:14 +00:00
Peter Bacon Darwin 752c989152 chore(package.json): update to latest dgeni-packages 2016-11-18 11:28:14 +00:00
Peter Bacon Darwin 789790feee fix(ngModelOptions): handle update triggers that are not in debounce list
Closes #15401
2016-11-17 23:38:24 +00:00
Peter Bacon Darwin fd1a93a4b0 refactor(ngModelOptions): internal variables do not start with a $ 2016-11-17 23:38:24 +00:00
Michal Bultrowicz 7d24af110a docs(CONTRIBUTING.md): expand test commit type, add info about closing issues
Expanded "test" to also mean test fixes.
Added a link to the help page about closing issues with commit
messages in the section about the footer.

Closes #15340
2016-11-17 22:17:42 +01:00
Arturo Romero ac7a2daf2e docs(guide/Forms): add labels to input elements
Closes #15403
2016-11-17 19:23:52 +01:00
Peter Bacon Darwin 296cfce40c feat(ngModelOptions): allow options to be inherited from ancestor ngModelOptions
Previously, you had to apply a complete set of `ngModelOptions` at many places in
the DOM where you might want to modify just one or two settings.

This change allows more general settings to be applied nearer to the root of the DOM
and then for more specific settings to inherit those general settings further down
in the DOM.

To prevent unwanted inheritance you must opt-in on a case by case basis:
* To inherit as single property you simply provide the special value `"$inherit"`.
* To inherit all properties not specified locally then include a property `"*": "$inherit"`.

Closes #10922
Closes #15389

BREAKING CHANGE:

The programmatic API for `ngModelOptions` has changed. You must now read options
via the `ngModelController.$options.getOption(name)` method, rather than accessing the
option directly as a property of the `ngModelContoller.$options` object. This does not
affect the usage in templates and only affects custom directives that might have been
reading options for their own purposes.

One benefit of these changes, though, is that the `ngModelControler.$options` property
is now guaranteed to be defined so there is no need to check before accessing.

So, previously:

```
var myOption = ngModelController.$options && ngModelController.$options['my-option'];
```

and now:

```
var myOption = ngModelController.$options.getOption('my-option');
```
2016-11-16 13:46:13 +00:00
Peter Bacon Darwin fb0225a36a revert: feat(ngModelOptions): allow options to be inherited from ancestor ngModelOptions
This reverts commit 87a2ff76af
2016-11-16 13:40:46 +00:00
Georgios Kalpakas 7dd42d31a7 docs(ngModel): fix typo and rephrase for simplicity 2016-11-16 12:35:54 +02:00
Georgios Kalpakas 7d9a791c6a fix(ngMock/$controller): respect $compileProvider.preAssignBindingsEnabled()
Fixes #15387

Closes #15395
2016-11-16 11:41:42 +02:00
Martin Staffa 17ddba873b docs($httpProvider): fix broken layout caused by unclosed `
Closes #15393
2016-11-15 18:52:33 +01:00
Peter Bacon Darwin ce49edc08b chore(docs): improve version picker
Closes #15385
2016-11-15 10:40:20 +00:00
Peter Bacon Darwin 0f45adebea chore(package.json): update to latest version of shelljs 2016-11-15 09:59:18 +00:00
Julio Borja Barra 5419201a3c docs(ngModel): fix example
For the example to work correctly, the initial model values have to be empty strings.

Closes #15272
2016-11-14 12:30:11 +02:00
kentwalters fcf182eb13 docs(guide/controller): change "hides" to "shadows"
"Shadows" should better convey the meaning of "overwriting the value of the property in the child
scope, while leaving the parent scope intact".
"Hides" could give the impression that it makes the property unavailable in the child scope and
leaving "overrides" only, could give the impression that the parent scope would be affected too,
especially to people not familiar with JavaScript's prototypal inheritance.

Closes #15375
2016-11-14 12:05:02 +02:00
Peter Bacon Darwin f582f9e57b chore(promises-tests): make timeout longer (correctly) 2016-11-11 12:34:25 +00:00
Peter Bacon Darwin c3a8b5d9f1 chore(promises-tests): make timeout longer 2016-11-10 22:59:37 +00:00
Thomas Grainger 6f072c8a41 docs(angular.isArray): Document that isArray is an alias
Closes #15383
2016-11-10 22:09:56 +00:00
Peter Bacon Darwin 4aa9534b0f fix($location): throw if the path starts with double (back)slashes
Previously `$location` was rewriting such paths to remove not only the
double slashes but also the first segment of the path, leading to an invalid
path.

In this change, we deem leading double (back)slashes an invalid path and
now throw a `$location:badpath` error if that occurs.

Closes #15365
2016-11-09 10:28:40 +00:00
Peter Bacon Darwin 627459b96d test(): remove redundant hashPrefix params 2016-11-09 10:28:40 +00:00
Tim Black 148cd26030 docs(ngRepeat): correct typo
Closes #15378
2016-11-08 23:17:14 +02:00
Martin Staffa 5ac7daea72 fix(input[radio]): use strict comparison when evaluating checked-ness
Closes #15283
Closes #15288

BREAKING CHANGE:

When using input[radio], the checked status is now determined by doing
a strict comparison between the value of the input and the ngModel.$viewValue.
Previously, this was a non-strict comparison (==).

This means in the following examples the radio is no longer checked:

```
  <!-- this.selected = 0 -->
  <input type="radio" ng-model="$ctrl.selected" value="0" >

  <!-- this.selected = 0; this.value = false; -->
  <input type="radio" ng-model="$ctrl.selected" ng-value="$ctrl.value" >
```

The migration strategy is to convert values that matched with non-strict
conversion so that they will match with strict conversion.
2016-11-08 16:42:39 +01:00
Kyle Wuolle b5a5623fc7 docs(filterFilter): mark the comparator parameter as optional
Mark the `comparator` parameter as optional and mention that it defaults to `false`.

Fixes #15312

Closes #15371
2016-11-07 14:55:09 +02:00
Georgios Kalpakas 3e87f54922 docs(ngRepeat): add warning about track by $index with one-time bindings 2016-11-07 12:50:27 +02:00
NoHomey 810a3e429a docs(CHANGELOG.md): add language ids to code blocks for syntax highlighting
Add missing language identifiers to code blocks used as examples, in order to
have proper syntax highlighting.

Fixes #15356

Closes #15357
2016-11-05 18:09:46 +02:00
sathify fc3e48980b chore(docs): apply consistent css property spacing 2016-11-05 14:29:12 +01:00
sathify a48f64162d chore(docs): use $document[0] 2016-11-05 14:29:12 +01:00
Martin Staffa b28f1fc3fb chore(docs-gen): create plnkr examples with the correct version
- docs for the snapshot will include the snapshot files from code.angularjs.org
- docs for tagged versions will include the files from the (Google) CDN
- docs for local / untagged versions will try to include the files from the (Google) CDN, which will fail. This gives immediate feedback that something is broken.

Closes #15267
Closes #15358
2016-11-05 13:18:48 +01:00
Peter Bacon Darwin 53cb1d7d40 chore(protractor): upgrade to latest 4.0.10
This fixes problems with testing against Chrome 54.
2016-11-05 11:33:14 +00:00
Martin Staffa d80cdeb3af docs($routeProvider): document that one of template or templateUrl is required
Closes #8604
2016-11-04 17:50:13 +01:00
Corey Cacic 6d3329479f docs($cookiesProvider): add example for overwriting defaults on provider
Add an example on how to set default values on `$cookiesProvider`. Many similar services support
overriding the `defaults` object with a new one, but this service only supports changing individual
properties.

Closes #15362
2016-11-04 15:12:12 +02:00
Tom Harvey d71788455d docs($resourceProvider): correct JS syntax error in code example
Closes #15360
2016-11-03 15:42:32 +01:00
Michał Gołębiowski bcd0d4d896 feat($compile): set preAssignBindingsEnabled to false by default
Fixes #15350
Closes #15352

BREAKING CHANGE: Previously, $compileProvider.preAssignBindingsEnabled was
set to true by default. This means bindings were pre-assigned in component
constructors. In Angular 1.5+ the place to put the initialization logic
relying on bindings being present is the controller $onInit method.

To migrate follow the example below:

Before:

```js
angular.module('myApp', [])
  .component('myComponent', {
    bindings: {value: '<'},
    controller: function() {
      this.doubleValue = this.value * 2;
    }
  });
```

After:
```js
angular.module('myApp', [])
  .component('myComponent', {
    bindings: {value: '<'},
    controller: function() {
      this.$onInit = function() {
        this.doubleValue = this.value * 2;
      };
    }
  });
```

If you don't have time to migrate the code at the moment, you can flip the
setting back to true:
```js
angular.module('myApp', [])
  .config(function($compileProvider) {
    $compileProvider.preAssignBindingsEnabled(false);
  })
  .component('myComponent', {
    bindings: {value: '<'},
    controller: function() {
      this.doubleValue = this.value * 2;
    }
  });
```
Don't do this if you're writing a library, though, as you shouldn't change
global configuration then.
2016-11-03 15:23:12 +01:00
Martin Probst 0ff10e1b56 fix(security): do not auto-bootstrap when loaded from an extension.
Extension URIs (`resource://...`) bypass Content-Security-Policy in Chrome and
Firefox and can always be loaded. Now if a site already has a XSS bug, and uses
CSP to protect itself, but the user has an extension installed that uses
Angular, an attacked can load Angular from the extension, and Angular's
auto-bootstrapping can be used to bypass the victim site's CSP protection.

Notes:
- `isAutoBootstrapAllowed` must be initialized on load, so that `currentScript`
  is set correctly.
- The tests are a bit indirect as reproducing the actual scenario is too
  complicated to reproduce (requires signing an extension etc). I have confirmed
  this to be working manually.

Closes #15346
2016-11-02 13:33:12 +00:00
Michał Gołębiowski a7076dc0bb chore(*): switch URLs from npmcdn.com to unpkg.com
The domain changed, the old one redirects to the new one.
2016-11-02 14:32:02 +01:00
Martin Staffa 433c8714f3 fix(docsApp): show correct version number in api index
Previously, the index would show the version of Angular that runs on
the page, not the version for which the docs are. This meant that in
that snapshot docs the stable version was displayed.

The `$scope.docsVersion` value was used in the plnkr opening code, but
has not been used since https://github.com/angular/angular.js/commit/bdec35cebc89e0d80a04eeffbd71ad999fc7e61a.

Closes #15265
2016-11-02 13:22:39 +01:00
Martin Staffa 01d8638114 chore: delete the gdocs.js file
This file was probably used for an early version of the docs, but hasn't been updated since 2011.

Closes #15325
2016-11-02 13:21:31 +01:00
Michał Gołębiowski 856e300046 chore(*): make some files non-executable
The repository contained JS/HTML/PNG files that had the executable bit enabled
for no real reason.

Closes #15339
2016-11-02 11:11:49 +01:00
Kyle Lieber 3b7f29ff63 perf(ngOptions): avoid calls to element.value
In some cases IE11/Edge calls to `element.value` are very slow when the
`element.value` has not been set. Normally, these calls are usualy 0-3 ms
but in these cases it can take 200-300 ms. This can easily add 3 or more
seconds to the load time on a view that has 10 or more select tags using
`ngOptions`.

The line this pull request is changing not only suffers from the performance
issue described above but it also appears to be broken. The code is checking
that `option.value` does not equal `element.value` but then sets `element.value`
to `option.selectValue`.

I don't believe `option.value` is actually defined anywhere and likely it
was always intended to be `option.selectValue`. This means that check would
always be true and since this code has been this way for quite a while and
is causing a performance issue I've just removed the check. This way a call
to `element.value` is never made prior to it's value being set.

Closes #15344
2016-11-01 10:40:58 +00:00
Josh Soref bdf960294a docs(CONTRIBUTING.md): add note about scope wildcard 2016-11-01 10:32:03 +00:00
Jason Bedard 79d2b9a5a6 refactor($parse): remove unused expression arguments
These are no longer required after the removal of the expression sandbox errors

Closes #15276
2016-10-31 10:31:23 +01:00
Martin Staffa e77f717ebf docs(guide/Conceptual Overview): fix external api example
In 1.6, urls accessed with jsonp must be whitelisted via sce. 
However, the yahoo finance api used in the example allows CORS
access via Access-Control-Allow-Origin:"*", so we can simply use
`$http.get` instead.

Closes #15336
2016-10-31 10:29:28 +01:00
Erick Delfin 872bdbd343 docs(README.md): mention "Pug" (Jade's new name)
Closes #15338
2016-10-30 21:28:46 +02:00
Jason Bedard f1e677895e refactor($compile): remove unnecessary assignment
Closes #15337
2016-10-30 13:13:54 +02:00
Martin Staffa 7ed0340488 style(ng/animate.js): remove a newline
Closes #15309
2016-10-29 18:52:03 +02:00
Josh Soref 5cce6e233e docs(*): fix typos
* a
* allows
* angularytics
* animate
* architecting
* asynchronously
* attribute
* back
* browser
* callback
* component
* delimited
* dependencies
* dynamically
* empty
* encoded
* explicitly
* expression
* fails
* guarantees
* hierarchy
* highlight
* identifiers
* immediately
* infinite
* initialized
* inputting
* instance
* interprets
* linking
* location
* misformed
* numerically
* occurring
* overridden
* overwritten
* parameters
* Pluralsight
* precedence
* primitive
* properly
* prototypically
* representation
* response
* separately
* separator
* should
* specifying
* supported
* template
* thrown
* transclude
* transclusion
* transitions
* trigger
* useful
2016-10-29 17:40:21 +02:00
Josh Soref 305e201b71 test(*): fix some inconsequential typos
* select
* synopsis
* params
* template
2016-10-29 17:40:21 +02:00
Erik Smith 47ba51eaf6 docs(guide/production): fix typo ("3rd part" --> "3rd party")
Closes #15328
2016-10-29 12:51:25 +03:00
Peter Bacon Darwin 1cf01d6fa7 chore(version-info): fix getTaggedVersion
The version being used was a "raw" version which included the "v" prefix.
2016-10-27 20:28:09 +01:00
Peter Bacon Darwin 74c19f096f chore(version-info): fix getTaggedVersion
The version being used was a `Semver` object instead of a string.
2016-10-27 17:48:28 +01:00
Peter Bacon Darwin 9e4d42cafb chore(version-info): use branchPattern to check tag
We have two fields in package.json for checking the current version:

* branchVersion
* branchPattern

The `branchVersion` field is used to work out what version to use in the
docs application, so we should not update this to the most recent version
until that version is on the Google CDN. Otherwise the docs app will break.

The `branchPattern` is used to determine what branch we are currently
working from and is generally used as a gate-keeper to prevent invalid
releases from the wrong branch.

The `getTaggedVersion()` method was using the `branchVersion` to check
that the tagged commit was valid but this fails when we are moving to a
new minor version with release candidates.

This fix avoids the problem by doing a custom comparison against the
`branchPattern` instead.
2016-10-27 09:19:55 +01:00
Peter Bacon Darwin ad3a1f9dea chore(package.json): bump for new minor version 2016-10-26 21:13:29 +01:00
Peter Bacon Darwin 3c88c62446 docs(CHANGELOG): add 1.6.0-rc.0 release notes 2016-10-26 17:50:04 +01:00
Peter Bacon Darwin 491d23ed57 chore(deps): add changez 2016-10-26 17:50:04 +01:00
Allan Watson 6a33749686 docs(orderBy): clarify behavior of default comparator wrt null
Document how `orderBy`'s default comparator handles `null` values.

Fixes #15293

Closes #15304
2016-10-26 00:04:14 +03:00
emed 21ac2c42ea docs(error/ueoe): add another possible cause
Mention unescaped quotes as another possible cause for this error.

Closes #15313
2016-10-25 23:34:34 +03:00
Peter Bacon Darwin eeb9ef09f9 chore(gruntfile): check the node version before starting
We specify the node version that is required to run the build in the `.nvmrc`
file. So let's check that the current node version satisfies this and report
a helpful message if it is not.
2016-10-21 12:37:15 +01:00
Georgios Kalpakas a6118dfda4 chore(ng-closure-runner): upgrade to version 0.2.4
Version 0.2.4's `minErr` implementation is up to date with the one in core.

Fixes #14971

Closes #15307
2016-10-21 13:26:42 +03:00
Jonathan Yates 586e2acb26 fix($compile): clean up @-binding observers when re-assigning bindings
Fixes #15268

Closes #15298
2016-10-20 19:26:01 +03:00
Jason Bedard 41034bb41b test($compile): ensure equal but different instance changes are detected in onChanges
Closes #15300
2016-10-20 19:08:43 +03:00
Jason Bedard 828f8a63b5 docs($controller): deprecate the use of $controllerProvider#allowGlobals
Closes #15230
2016-10-20 09:48:04 +03:00
laranhee f5f802c6e6 docs($rootScope): add missing round bracket
Closes #15299
2016-10-20 09:45:14 +03:00
Michał Gołębiowski 35482babd9 refactor($sniffer): remove $sniffer.vendorPrefix
Previously, Angular tried to detect the CSS prefix the browser supports and
then use the saved one. This strategy is not ideal as currently some browsers
are supporting more than one vendor prefix. The best example is Microsoft Edge
that added -webkit- prefixes to be more Web-compatible; Firefox is doing
a similar thing on mobile. Some of the -webkit--prefixed things are now even
getting into specs to sanction that they're now required for Web compatibility.

In some cases Edge even supports only the -webkit--prefixed property; one
example is -webkit-appearance.

$sniffer.vendorPrefix is no longer used in Angular core outside of $sniffer
itself; taking that and the above problems into account, it's better to just
remove it. The only remaining use case was an internal use in detection of
support for transitions/animations but we can directly check the webkit prefix
there manually; no other prefix matters for them anyway.

$sniffer is undocumented API so this removal is not a breaking change. However,
if you've previously been using it in your code, just paste the following
to get the same function:

    var vendorPrefix = (function() {
      var prefix, prop, match;
      var vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/;
      for (prop in document.createElement('div').style) {
        if ((match = vendorRegex.exec(prop))) {
          prefix = match[0];
          break;
        }
      }
      return prefix;
    })();

The vendorPrefix variable will contain what $sniffer.vendorPrefix used to.

Note that we advise to not check for vendor prefixes this way; if you have to
do it, it's better to check it separately for each CSS property used for the
reasons described at the beginning. If you use jQuery, you don't have to do
anything; it automatically adds vendor prefixes to CSS prefixes for you in
the .css() method.

Fixes #13690
Closes #15287
2016-10-19 23:10:52 +02:00
Georgios Kalpakas 7dacbcc991 test(input): fix typo (step="{{step}}"" --> step="{{step}}") 2016-10-19 15:27:54 +03:00
Georgios Kalpakas 081d06ffd1 fix(input): fix step validation for input[number]/input[range]
Related to 9a8b8aa and #15257. Fixes the issue discussed in
https://github.com/angular/angular.js/commit/9a8b8aa#commitcomment-19108436.

Fixes #15257

Closes #15264
2016-10-19 14:52:51 +03:00
Georgios Kalpakas d6c91ea175 refactor(input): avoid duplicating step/ngStep tests 2016-10-19 14:52:28 +03:00
Martin Staffa 00b60f2f03 docs(a): remove outdated practice
Using a tags as buttons is bad for accessibility and usability
2016-10-19 12:12:56 +02:00
Martin Staffa 18263f1c52 chore(docs-app): improve layout when loading partials
By setting the current partial content to hidden, the current height
of the window is maintained until the new content is loaded.
This prevents flickering caused by the scrollbar (dis)appearing and
the footer coming into view.
2016-10-19 11:55:53 +02:00
Martin Staffa daa47e33e3 Revert "chore(doc-gen, docs-app): create plnkr examples with correct Angular version"
This patch relies on a change in the dgeni example package, which has not been added to dgeni yet.

This reverts commit db02008fe2.
2016-10-17 23:16:41 +02:00
Martin Staffa 19973609f4 chore(docs-app): show loader when loading view / partial
Closes #14385
PR (#15280)
2016-10-17 19:32:15 +02:00
Martin Staffa db02008fe2 chore(doc-gen, docs-app): create plnkr examples with correct Angular version
When the docs are based on the snapshot, the plnkr examples must use the snapshot files
from code.angularjs.org

Closes #15267
PR (#15269)
2016-10-17 19:31:39 +02:00
Martin Staffa 705afcd160 fix($location): prevent infinite digest with IDN urls in Edge
Internationalized Domain Urls, for example urls with Umlaut (Ä, Ö, Ü)
cause infinite digest in Edge 38.14393.0.0 because lastIndexOf doesn't
work correctly in this version when the search string is the same as the haystack string.

The patch uses an implementation based on core.js: https://github.com/zloirock/core-js/blob/v2.4.1/modules/es6.string.starts-with.js#L16

Edge Bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9271625/

Fixes #15217
PR #15235
2016-10-17 12:21:29 +02:00
Georgios Kalpakas aa6a80618d chore(tutorial): make diagram images responsive
Fixes angular/angular-phonecat#376

Closes #15275
2016-10-17 12:38:40 +03:00
Venkat Ganesan b8c8262808 docs(input[checkbox]): mention ngChecked
Closes #14465
Closes #15277
2016-10-17 10:29:24 +03:00
Georgii Dolzhykov 406c1b094b docs($rootScope.Scope): grammar
Closes #15263
2016-10-15 01:15:12 +03:00
Martin Staffa c22615cbfb refactor(compileSpec): make tests consistent
PR (#15141)
2016-10-14 11:39:21 +02:00
Michał Gołębiowski fc0c11db84 fix(jqLite): camelCase keys in jqLite#data
This change aligns jqLite with jQuery 3.
The relevant bit of jQuery code is
https://github.com/jquery/jquery/blob/3.1.1/src/data/Data.js

Close #15126

BREAKING CHANGE: Previously, keys passed to the data method were left untouched.
Now they are internally camelCased similarly to how jQuery handles it, i.e.
only single (!) hyphens followed by a lowercase letter get converted to an
uppercase letter. This means keys `a-b` and `aB` represent the same data piece;
writing to one of them will also be reflected if you ask for the other one.

If you use Angular with jQuery, it already behaved in this way so no changes
are required on your part.

To migrate the code follow the examples below:

BEFORE:

/* 1 */
elem.data('my-key', 2);
elem.data('myKey', 3);

/* 2 */
elem.data('foo-bar', 42);
elem.data()['foo-bar']; // 42
elem.data()['fooBar']; // undefined

/* 3 */
elem.data()['foo-bar'] = 1;
elem.data()['fooBar'] = 2;
elem.data()['foo-bar']; // 1

AFTER:

/* 1 */
// Rename one of the keys as they would now map to the same data slot.
elem.data('my-key', 2);
elem.data('my-key2', 3);

/* 2 */
elem.data('foo-bar', 42);
elem.data()['foo-bar']; // undefined
elem.data()['fooBar']; // 42

/* 3 */
elem.data()['foo-bar'] = 1;
elem.data()['fooBar'] = 2;
elem.data()['foo-bar']; // 2
2016-10-13 07:47:16 +01:00
Michał Gołębiowski 73050cdda0 fix(jqLite): align jqLite camelCasing logic with JQuery
jqLite needs camelCase for it's css method; it should only convert one dash
followed by a lowercase letter to an uppercase one; it shouldn't touch
underscores, colons or collapse multiple dashes into one. This is behavior
of jQuery 3 as well.

Also, jqLite's css camelCasing logic was put in a separate function and
refactored: now the properties starting from an uppercase letter are used by
default (i.e. Webkit, not webkit) and the only exception is for the -ms- prefix
that is converted to ms, not Ms. This makes the logic clearer as we're just
always changing a dash followed by a lowercase letter by an uppercase one; this
is also how it works in jQuery.

The camelCasing for the $compile and $sce services retains the previous behaviour.

Ref #15126
Fix #7744

BREAKING CHANGE: before, when Angular was used without jQuery, the key passed
to the css method was more heavily camelCased; now only a single (!) hyphen
followed by a lowercase letter is getting transformed. This also affects APIs
that rely on the css method, like ngStyle.

If you use Angular with jQuery, it already behaved in this way so no changes
are needed on your part.

To migrate the code follow the example below:

Before:

HTML:

// All five versions used to be equivalent.
<div ng-style={background_color: 'blue'}></div>
<div ng-style={'background:color': 'blue'}></div>
<div ng-style={'background-color': 'blue'}></div>
<div ng-style={'background--color': 'blue'}></div>
<div ng-style={backgroundColor: 'blue'}></div>

JS:

// All five versions used to be equivalent.
elem.css('background_color', 'blue');
elem.css('background:color', 'blue');
elem.css('background-color', 'blue');
elem.css('background--color', 'blue');
elem.css('backgroundColor', 'blue');

// All five versions used to be equivalent.
var bgColor = elem.css('background_color');
var bgColor = elem.css('background:color');
var bgColor = elem.css('background-color');
var bgColor = elem.css('background--color');
var bgColor = elem.css('backgroundColor');

After:

HTML:

// Previous five versions are no longer equivalent but these two still are.
<div ng-style={'background-color': 'blue'}></div>
<div ng-style={backgroundColor: 'blue'}></div>

JS:

// Previous five versions are no longer equivalent but these two still are.
elem.css('background-color', 'blue');
elem.css('backgroundColor', 'blue');

// Previous five versions are no longer equivalent but these two still are.
var bgColor = elem.css('background-color');
var bgColor = elem.css('backgroundColor');
2016-10-13 07:47:15 +01:00
Michał Gołębiowski beab3baec3 chore(jqLite): remove the ready handlers instead of setting a flag
This change aligns jqLite with the jQuery implementation.

Closes #15237
2016-10-12 19:31:55 +02:00
Michał Gołębiowski e008df6c8c docs(jqLite): remove the removal plan info for bind/unbind
We're not going to remove the aliases before jQuery does.
2016-10-12 19:31:55 +02:00
Michał Gołębiowski 8e82bf51b1 refactor(jqLite): deprecate jqLite#ready
Use jqLite(fn) instead of jqLite(document).ready(fn).
2016-10-12 19:31:55 +02:00
Michał Gołębiowski 369fb7f4f7 feat(jqLite): implement jqLite(f) as alias to jqLite(document).ready(f)
jQuery has supported this form for a long time. As of jQuery 3.0 this form is
the preferred one and all others are deprecated so jqLite(f) is now also
supported.

All internal invocations of jqLite(document).ready(f) (& equivalent) have been
replaced by jqLite(f).

Tests for these methods have been added as jqLite#ready had no explicit tests
so far.
2016-10-12 19:31:55 +02:00
mohamed amr 4f44e01894 fix($parse): treat falsy values as defined in assignment expressions
Closes #14990
Closes #14994
2016-10-12 09:17:23 +02:00
Peter Bacon Darwin 606ea5d23e fix($compile): ensure that hidden input values are correct after history.back
Due to the nature of some browser's PageCache/BFCache, returning to an Angular
app sometimes causes `input[hidden]` elements to retain the last value
that was stored before the page was navigated away from previously.

This is particularly problematic if the input has an interpolated value.
E.g. `<input type="hidden" value="{{ 1 + 2 }}">` since when the browser
returns, instead of the original interpolation template, the HTML contains
the previous value `<input type="hidden" value="3">`.

This commit instructs the browser not to attempt to reinstate the previous
value when navigating back in history by setting `autocomplete="off"` on
the hidden input element element.
2016-10-11 13:33:53 +01:00
Peter Bacon Darwin ec83b04df1 revert:fix(input): ensure that hidden input values are correct after history.back
This reverts commit 298f8c4d13.
There was a regression in angular-material that relied upon the input directive
having `link.pre` property.
2016-10-11 13:28:56 +01:00
Peter Bacon Darwin 8d394de91f docs(CHANGELOG): add 1.2.31 and 1.4.13 release info 2016-10-10 23:07:52 +01:00
Peter Bacon Darwin 298f8c4d13 fix(input): ensure that hidden input values are correct after history.back
Due to the nature of some browser's PageCache/BFCache, returning to an Angular
app sometimes causes `input[hidden]` elements to retain the last value
that was stored before the page was navigated away from previously.

This is particularly problematic if the input has an interpolated value.
E.g. `<input type="hidden" value="{{ 1 + 2 }}">` since when the browser
returns, instead of the original interpolation template, the HTML contains
the previous value `<input type="hidden" value="3">`.

This commit instructs the browser not to attempt to reinstate the previous
value when navigating back in history by setting `autocomplete="off"` on
the hidden input element element.
2016-10-10 20:09:15 +01:00
Michał Gołębiowski 138fbf0d6c refactor(jqLite): wrap the jqueryVersion binding in a span
Protractor's by.binding selector selects the whole element in which the binding
is contained as otherwise it can't know which bit of text has been interpolated.

It's safer to wrap the binding in a span so that we're sure what the e2e tests
are exactly testing.
2016-10-10 06:28:02 +01:00
Jason Bedard a02c8863f9 fix($parse): validate assignment lval in parser phase
The parser always threw an error in the case of an invalid left-value
assignment but it was an unhelpful:

```
Cannot set property 'undefined' of undefined
```

This commit provides a more meaningful error message, so it is not a
breaking change.

Closes #15234
2016-10-10 05:56:56 +01:00
BobChao87 faf0c3e4c1 refactor(ngModelSpec): use valueFn over curry
Refactor ngModelSpec to use internal helper function `valueFn`.
Use instead of multiple-defining a function called `curry`.

PR (#15231)

Addresses a quick change mentioned in PR 15208 from Issue #14734
2016-10-09 20:07:08 +02:00
Frank Stepanski 39a3b58ed2 docs(README.md): expand the "Interconnection with HTML" section
Closes #15150
2016-10-08 21:41:34 +03:00
Martin Staffa f41bd7691d docs(changelog): add missing commit and remove empty lines 2016-10-07 21:01:46 +02:00
Georgios Kalpakas b3a3ed34b9 docs($http): display the actual default Accept header 2016-10-07 18:27:01 +03:00
Jason Bedard 34434cf528 refactor($q): separate Promise from Deferred
Closes #15064

BREAKING CHANGE:

Previously, the `Deferred` object returned by `$q.defer()` delegated the
`resolve()`, `reject()` and `notify()` methods to `Deferred.prototype`. Thus, it
was possible to modify `Deferred.prototype` and have the changes reflect to all
`Deferred` objects.

This commit removes that delegation, so modifying the above three methods on
`Deferred.prototype` will no longer have an effect on `Deferred` objects.
2016-10-07 12:02:25 +03:00
Vincent Gillot cdf3d5e054 docs(guide/component-router): fix typo ($routeOnReuse --> $routerOnReuse)
Closes #15224
2016-10-07 11:44:09 +03:00
Michał Gołębiowski 4e6c14dcae feat(jqLite): don't throw for elements with missing getAttribute
jQuery falls back to prop here but this feature is not very well tested
& documented so let's just skip it here.

Closes #15181
2016-10-06 12:15:39 +02:00
Michał Gołębiowski d5b7803064 refactor(jqLite): deprecate bind/unbind
The on/off aliases have been available since Angular 1.2. bind/unbind have
been deprecated in jQuery 3.0 so we're following suit in jqLite.
2016-10-06 12:15:39 +02:00
Michał Gołębiowski bb3cfd3d8f tests(jqLite): add basic tests for the bind/unbind aliases 2016-10-06 12:15:39 +02:00
Michał Gołębiowski 304c765359 perf(jqLite): move bind/unbind definitions out of the loop
The bind/unbind aliases to on/off were being assinged in every iteration
of the function assigning traversal methods to the prototype. Now it happens
only once.
2016-10-06 12:15:39 +02:00
Michał Gołębiowski 095cacb79b chore(jqLite): fix a typo in a test name 2016-10-06 12:15:39 +02:00
Michał Gołębiowski c8ba433f18 refactor(jqLite): refactor the attr method
The attr method was refactored to be divided into setter & getter parts
and to handle boolean attributes in each one of them separately instead of
dividing into boolean & non-boolean ones and then handling setter & getter
in both of them. This is because handling boolean & non-boolean attributes
has common parts; in particular handling of the `null` value or using
getAttribute to get the value in the getter.
2016-10-06 12:15:39 +02:00
Michał Gołębiowski 3faf450573 feat(jqLite): don't remove a boolean attribute for .attr(attrName, '')
This change aligns jqLite with jQuery.

Ref #15126

BREAKING CHANGE: Before, using the `attr` method with an empty string as a value
would remove the boolean attribute. Now it sets it to its lowercase name as
was happening for every non-empty string so far. The only two values that remove
the boolean attribute are now null & false, just like in jQuery.

To migrate the code follow the example below:

Before:

elem.attr(booleanAttrName, '');

After:

elem.attr(booleanAttrName, false);

or:

elem.attr(booleanAttrName, null);
2016-10-06 12:15:39 +02:00
Michał Gołębiowski 4e36245522 feat(jqLite): remove the attribute for .attr(attribute, null)
This change aligns jqLite with jQuery.

Also, the extra `2` second parameter to `setAttribute` has been removed;
it was only needed for IE<9 and latest jQuery doesn't pass it either.

Ref #15126

BREAKING CHANGE: Invoking `elem.attr(attributeName, null)` would set the
`attributeName` atribute value to a string `"null"`, now it removes the
attribute instead.

To migrate the code follow the example below:

Before:

elem.attr(attributeName, null);

After:

elem.attr(attributeName, "null");
2016-10-06 12:15:39 +02:00
Michał Gołębiowski 7ceb5f6fcc refactor(jqLite): Don't get/set props when getting/setting bool attrs
This is done automatically by browsers in cases where it's needed; the
workaround was only needed for IE<9. The new behavior means boolean attributes
will not be reflected on elements where browsers don't reflect them.

This change aligns jqLite with jQuery 3.

Fixes #14126

BREAKING CHANGE: Previously, all boolean attributes were reflected into
properties in a setter and from a property in a getter, even on elements that
don't treat those attributes in a special way. Now Angular doesn't do it
by itself but relies on browsers to know when to reflect the property. Note that
this browser-level conversions differs between browsers; if you need to change
dynamic state of an element you should modify the property, not the attribute.

See https://jquery.com/upgrade-guide/1.9/#attr-versus-prop- for a more detailed
description about a related change in jQuery 1.9.

To migrate the code follow the example below:

Before:

CSS:
input[checked="checked"] { ... }

JS:
elem1.attr('checked', 'checked');
elem2.attr('checked', false);

After:

CSS:
input:checked { ... }

JS:
elem1.prop('checked', true);
elem2.prop('checked', false);
2016-10-06 12:15:39 +02:00
Michał Gołębiowski 1f16c79396 docs(jqLite): Document that removeAttr doesn't support multiple attributes
jQuery supports removing multiple attributes in one go, jqLite doesn't.
This is now documented.
2016-10-06 12:15:39 +02:00
Peter Bacon Darwin 1ea3d889fa chore(doc-gen): improve version dropdown info 2016-10-06 10:07:00 +01:00
BobChao87 7bc71adc63 fix(ngModel): treat synchronous validators as boolean always
Change synchronous validators to convert the return to boolean value.
Prevent unexpected behavior when returning `undefined`.

Closes #14734
Closes #15208

BREAKING CHANGE: Previously, only a literal `false` return would resolve as the
synchronous validator failing. Now, all traditionally false JavaScript values
are treated as failing the validator, as one would naturally expect.

Specifically, the values `0` (the number zero), `null`, `NaN` and `''` (the
empty string) used to considered valid (passing) and they are now considered
invalid (failing). The value `undefined` was treated similarly to a pending
asynchronous validator, causing the validation to be pending. `undefined` is
also now considered invalid.

To migrate, make sure your synchronous validators are returning either a
literal `true` or a literal `false` value. For most code, we expect this to
already be the case. Only a very small subset of projects will be affected.

Namely, anyone using `undefined` or any falsy value as a return will now see
their validation failing, whereas previously falsy values other than `undefined`
would have been seen as passing and `undefined` would have been seen as pending.
2016-10-05 20:42:02 +01:00
Georgios Kalpakas e8aebb38ff test(*): introduce the toEqualMinErr() custom Jasmine matcher
Closes #15216
2016-10-05 19:11:45 +03:00
Georgios Kalpakas fbf30b28e0 refactor(*): use the toThrowMinErr() matcher when possible 2016-10-05 19:11:12 +03:00
Georgios Kalpakas b54a39e202 feat($http): remove deprecated callback methods: success()/error()
Closes #15157

BREAKING CHANGE:

`$http`'s deprecated custom callback methods - `success()` and `error()` - have been removed.
You can use the standard `then()`/`catch()` promise methods instead, but note that the method
signatures and return values are different.

`success(fn)` can be replaced with `then(fn)`, and `error(fn)` can be replaced with either
`then(null, fn)` or `catch(fn)`.

Before:

```js
$http(...).
  success(function onSuccess(data, status, headers, config) {
    // Handle success
    ...
  }).
  error(function onError(data, status, headers, config) {
    // Handle error
    ...
  });
```

After:

```js
$http(...).
  then(function onSuccess(response) {
    // Handle success
    var data = response.data;
    var status = response.status;
    var statusText = response.statusText;
    var headers = response.headers;
    var config = response.config;
    ...
  }, function onError(response) {
    // Handle error
    var data = response.data;
    var status = response.status;
    var statusText = response.statusText;
    var headers = response.headers;
    var config = response.config;
    ...
  });

// or

$http(...).
  then(function onSuccess(response) {
    // Handle success
    var data = response.data;
    var status = response.status;
    var statusText = response.statusText;
    var headers = response.headers;
    var config = response.config;
    ...
  }).
  catch(function onError(response) {
    // Handle error
    var data = response.data;
    var status = response.status;
    var statusText = response.statusText;
    var headers = response.headers;
    var config = response.config;
    ...
  });
```

**Note:**
There is a subtle difference between the variations showed above. When using
`$http(...).success(onSuccess).error(onError)` or `$http(...).then(onSuccess, onError)`, the
`onError()` callback will only handle errors/rejections produced by the `$http()` call. If the
`onSuccess()` callback produces an error/rejection, it won't be handled by `onError()` and might go
unnoticed. In contrast, when using `$http(...).then(onSuccess).catch(onError)`, `onError()` will
handle errors/rejections produced by both `$http()` _and_ `onSuccess()`.
2016-10-05 19:02:39 +03:00
Peter Bacon Darwin fb66341871 feat($http): JSONP callback must be specified by jsonpCallbackParam config
The query parameter that will be used to transmit the JSONP callback to the
server is now specified via the `jsonpCallbackParam` config value, instead of
using the `JSON_CALLBACK` placeholder.

* Any use of `JSON_CALLBACK` in a JSONP request URL will cause an error.
* Any request that provides a parameter with the same name as that given
by the `jsonpCallbackParam` config property will cause an error.

This is to prevent malicious attack via the response from an app inadvertently
allowing untrusted data to be used to generate the callback parameter.

Closes #15161
Closes #15143
Closes #11352
Closes #11328

BREAKING CHANGE

You can no longer use the `JSON_CALLBACK` placeholder in your JSONP requests.
Instead you must provide the name of the query parameter that will pass the
callback via the `jsonpCallbackParam` property of the config object, or app-wide via
the `$http.defaults.jsonpCallbackParam` property, which is `"callback"` by default.

Before this change:

```
$http.json('trusted/url?callback=JSON_CALLBACK');
$http.json('other/trusted/url', {params:cb:'JSON_CALLBACK'});
```

After this change:

```
$http.json('trusted/url');
$http.json('other/trusted/url', {callbackParam:'cb'});
```
2016-10-05 14:39:50 +01:00
Peter Bacon Darwin 6476af83cd feat($http): JSONP requests now require a trusted resource URL
The $http service will reject JSONP requests that are not trusted by
`$sce` as "ResourceUrl".
This change makes is easier for developers to see clearly where in their
code they are making JSONP calls that may be to untrusted endpoings and
forces them to think about how these URLs are generated.

Be aware that this commit does not put any constraint on the parameters
that will be appended to the URL. Developers should be mindful of what
parameters can be attached and how they are generated.

Closes #11352

BREAKING CHANGE

All JSONP requests now require the URL to be trusted as resource URLs.
There are two approaches to trust a URL:

**Whitelisting with the `$sceDelegateProvider.resourceUrlWhitelist()`
method.**

You configure this list in a module configuration block:

```
appModule.config(['$sceDelegateProvider', function($sceDelegateProvider) {
  $sceDelegateProvider.resourceUrlWhiteList([
    // Allow same origin resource loads.
    'self',
    // Allow JSONP calls that match this pattern
    'https://some.dataserver.com/**.jsonp?**`
  ]);
}]);
```

**Explicitly trusting the URL via the `$sce.trustAsResourceUrl(url)`
method**

You can pass a trusted object instead of a string as a URL to the `$http`
service:

```
var promise = $http.jsonp($sce.trustAsResourceUrl(url));
```
2016-10-05 14:19:55 +01:00
Peter Bacon Darwin 9d08b33a0d test($route): ensure mock $sce delegate is implemented correctly
The mock calls to `valueOf(v)` and `getTrustedResourceUrl(v)` were not dealing
with the case where `v` was null.
2016-10-05 13:05:49 +01:00
Georgios Kalpakas e13eeabd7e fix($q): treat thrown errors as regular rejections
Previously, errors thrown in a promise's `onFulfilled` or `onRejected` handlers were treated in a
slightly different manner than regular rejections:
They were passed to the `$exceptionHandler()` (in addition to being converted to rejections).

The reasoning for this behavior was that an uncaught error is different than a regular rejection, as
it can be caused by a programming error, for example. In practice, this turned out to be confusing
or undesirable for users, since neither native promises nor any other popular promise library
distinguishes thrown errors from regular rejections.
(Note: While this behavior does not go against the Promises/A+ spec, it is not prescribed either.)

This commit removes the distinction, by skipping the call to `$exceptionHandler()`, thus treating
thrown errors as regular rejections.

**Note:**
Unless explicitly turned off, possibly unhandled rejections will still be caught and passed to the
`$exceptionHandler()`, so errors thrown due to programming errors and not otherwise handled (with a
subsequent `onRejected` handler) will not go unnoticed.

Fixes #3174
Fixes #14745

Closes #15213

BREAKING CHANGE:

Previously, throwing an error from a promise's `onFulfilled` or `onRejection` handlers, would result
in passing the error to the `$exceptionHandler()` (in addition to rejecting the promise with the
error as reason).

Now, a thrown error is treated exactly the same as a regular rejection. This applies to all
services/controllers/filters etc that rely on `$q` (including built-in services, such as `$http` and
`$route`). For example, `$http`'s `transformRequest/Response` functions or a route's `redirectTo`
function as well as functions specified in a route's `resolve` object, will no longer result in a
call to `$exceptionHandler()` if they throw an error. Other than that, everything will continue to
behave in the same way; i.e. the promises will be rejected, route transition will be cancelled,
`$routeChangeError` events will be broadcasted etc.
2016-10-05 14:49:02 +03:00
Justas Brazauskas 823295fee0 docs(*): fix typos in comments and docs
Closes #15206
2016-10-03 13:16:08 +03:00
mrLarbi 9062bae05c feat($anchorScroll): convert numeric hash targets to string
This allows `$anchorScroll(7)` to scroll to `<div id="7">` (although technically, the target ID is a
string, not a number).

Fixes #14680

Closes #15182
2016-09-30 18:49:20 +03:00
Georgios Kalpakas 3253b55861 docs(ngCsp): fix "directive"'s restrict and hide comment from output 2016-09-30 13:43:33 +03:00
Georgios Kalpakas 2be5ac631b docs(ngAnimate): fix typo ("an the" --> "an")
Fixes #15194
2016-09-30 12:26:17 +03:00
tijwelch 26a6a9b624 docs($http): fix typo in headersGetter
Closes #15198
2016-09-30 10:16:44 +03:00
GregoryPorter 714b53ac6f docs(tutorial): fix typos
- **step_04:** `controllers is one file` --> `controllers in one file`
- **step_06:** `.components.js` --> `.component.js`

Closes #15197
2016-09-30 10:08:12 +03:00
Georgii Dolzhykov ddb4ef13a9 docs(angular.mock.inject): improve formatting
Without backticks, underscores are rendered as italics.

PR (#15186)
2016-09-26 15:55:06 +02:00
pharkare 723d64d370 docs(tutorial/index): fix spelling error for word 'standalone'
PR (#15187)
2016-09-26 15:54:02 +02:00
Georgios Kalpakas 3fe3da8794 fix($compile): set attribute value even if ngAttr* contains no interpolation
Previoulsy, when the value of an `ngAttrXyz` attribute did not contain any interpolation, then the
`xyz` attribute was never set.

BTW, this commit adds a negligible overhead (since we have to set up a one-time watcher for
example), but it is justifiable for someone that is using `ngAttrXyz` (instead of `xyz` directly).

(There is also some irrelevant refactoring to remove unnecessary dependencies from tests.)

Fixes #15133

Closes #15149
2016-09-25 17:30:49 +03:00
Elliot Cameron f60447072d docs(guide/filter): imrpove explanation of "pure function"
Improve the explanation of what a "pure function" is in simple words. The previous explanation
could be confusing, especially since the term "idempotent" (here used in it's broader
"Computer Science" meaning) is overloaded and has much stricter semantics in Mathematics or pure
Functional Programming.

Closes #15173
2016-09-25 16:15:18 +03:00
Adrian Bordinc 90f947b186 docs($compile): Fix a typo in the warning header
Closes #15184
2016-09-25 15:34:00 +03:00
Joao Dinis cf241c425b docs(guide/concepts): insert comma
Closes #15166
2016-09-21 15:13:15 +03:00
Georgios Kalpakas 8d4d3d527d refactor($resource): use route.defaults (already merged provider.defaults + options)
Closes #15160
2016-09-21 14:24:13 +03:00
Georgios Kalpakas bf61c1471d refactor($resource): use local references of Angular helpers 2016-09-21 14:23:28 +03:00
Georgios Kalpakas 6eb4ffc085 fix($resource): pass options when binding default params
`Resource.bind()`, which creates an new Resource class with the same propertiesexcept for the
additional bound default parameters, was not passing the original Resource class' `options`,
resulting in different behavior.
This commit fixes it by passing the `options` when creating the new Resource class.
2016-09-21 14:23:28 +03:00
davidcigital b59bc0b01d docs(ngCsp): update explanation of CSP rules and how they affect Angular
Update the description of CSP, mainly regarding `unsafe-eval` and `unsafe-inline`. The way it was
presented previously was slightly misleading as it indicated that these were rules forbidding
certain things, when in fact it's a keyword in the CSP that disables the very rule that was
described. The updated text clarifies this better.

Closes #15142
2016-09-19 19:18:46 +03:00
Matt Gilson f1cc58c7d2 docs(angular.toJson): add missing param type
Reference:
[JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify).

Closes #15156
2016-09-19 19:06:23 +03:00
Georgios Kalpakas e1e2fe1c08 docs($templateCache): fix typo (template --> templateCache) 2016-09-19 17:57:31 +03:00
Stepan Suvorov bb8e955a02 docs(cacheFactory): remove ng-include practice from docs
Generally we don't use `ngInclude` any more, so this commit updates the
example snippet to use component instead.

Closes #15153
2016-09-19 08:04:53 +01:00
thorn0 16dccea887 fix($compile): bindToController should work without controllerAs
Fixes #15088

Closes #15110
2016-09-16 19:10:12 +03:00
Georgios Kalpakas a1bdffa12f fix($compile): do not overwrite values set in $onInit() for <-bound literals
See #15118 for more details.

Fixes #15118

Closes #15123
2016-09-16 16:23:57 +03:00
Georgios Kalpakas 52bf2bd11e refactor(ngOptions): access copy() directly (angular.copy --> copy) 2016-09-16 16:23:47 +03:00
Peter Bacon Darwin 32aa7e7395 fix(ngTransclude): use fallback content if only whitespace is provided
If the transcluded content is only whitespace then we should use the
fallback content instead. This allows more flexibility in formatting
your HTML.

Closes #15077
Closes #15140

BREAKING CHANGE:

Previously whitespace only transclusion would be treated as the transclusion
being "not empty", which meant that fallback content was not used in that
case.

Now if you only provide whitespace as the transclusion content, it will be
assumed to be empty and the fallback content will be used instead.

If you really do want whitespace then you can force it to be used by adding
a comment to the whitespace.
2016-09-15 13:36:48 +01:00
Peter Bacon Darwin 1547c751aa refactor($parse): remove Angular expression sandbox
The angular expression parser (`$parse`) attempts to sandbox expressions
to prevent unrestricted access to the global context.

While the sandbox was not on the frontline of the security defense,
developers kept relying upon it as a security feature even though it was
always possible to access arbitrary JavaScript code if a malicious user
could control the content of Angular templates in applications.

This commit removes this sandbox, which has the following benefits:

* it sends a clear message to developers that they should not rely on
the sandbox to prevent XSS attacks; that they must prevent control of
expression and templates instead.
* it allows performance and size improvements in the core Angular 1
library.
* it simplifies maintenance and provides opportunities to make the
parser more capable.

Please see the [Sandbox Removal Blog Post](http://angularjs.blogspot.com/2016/09/angular-16-expression-sandbox-removal.html)
for more detail on what you should do to ensure that your application is
secure.

Closes #15094
2016-09-15 11:18:26 +01:00
Prashant Singh Pawar 76d3dafdea fix($compile): don't throw tplrt error when there is a whitespace around a top-level comment
Added new conditional for NODE_TYPE_TEXT inside removeComments method of $compile
Added corresponding unit tests.

Closes #15108
PR (#15132)
2016-09-15 12:10:27 +02:00
Jason Bedard 9e24e774a5 perf(form, ngModel): change controllers to use prototype methods
This makes the largetable-bp ng-model benchmarks 10-15% faster (down 90-100ms for me). The actual controller instantiation doesn't change too much but the overall numbers seem consistently faster, I assume all due to reducing memory usage / gc. Specifically on creation there is ~40% less memory GCed, on destruction there is about ~25% less.

PR (#13286)

BREAKING CHANGE:
The use of prototype methods instead of new methods per instance removes the ability to pass 
NgModelController and FormController methods without context.

For example

`$scope.$watch('something', myNgModelCtrl.$render)`

will no longer work because the `$render` method is passed without any context. 
This must now be replaced with

```
$scope.$watch('something', function() {
  myNgModelCtrl.$render();
})
```

or possibly by using `Function.prototype.bind` or `angular.bind`.
2016-09-14 22:21:09 +02:00
Jérome Freyre 21e4db9e07 docs(input[range]): fix erroneous examples
PR (#15135)
2016-09-14 13:56:45 +02:00
Martin Staffa 07849779ba chore(benchmarks): fix order-by benchmark 2016-09-12 18:24:29 +02:00
Georgios Kalpakas 912d5b9ad3 docs(ngView): remove obsolete known issue 2016-09-12 17:27:37 +03:00
Georgii Dolzhykov d14c7f3c31 docs($compile): remove obsolete sentence
Fixes #15109

Closes #15119
2016-09-10 20:30:14 +03:00
Jason Bedard 78e6a58368 refactor($q): remove unnecessary checks/helpers/wrappers
- Remove internal `makePromise()` helper.
- Remove unnecessary wrapper functions.
- Remove unnecessary check for promises resolving multiple times.
  (By following the Promises/A+ spec, we know this will never happen.)
- Switch from function expressions to (named) function declarations.

Closes #15065
2016-09-10 16:03:13 +03:00
Austin O'Neil 51c516e7d4 docs(ngOptions): correct links
remove redundant link to ngOptions and add link to ngRepeat

PR (#15117)
2016-09-09 23:34:29 +02:00
Mohsen Azimi 51a2eb7d6f docs($q): fix typo in race() test description (array --> object)
Closes #15111
2016-09-09 00:07:27 +03:00
Tyler Romeo 3f759b191d fix($sniffer): don't use history.pushState in sandboxed Chrome Packaged Apps
While sandboxed Chrome Packaged Apps (CPAs) have the same restrictions wrt
accessing `history.pushState` as "normal" CPAs, they can't be detected in the
same way, as they do not have access to the same APIs.
Previously, due to their differences from normal CPAs, `$sniffer` would fail to
detect sandboxed CPAs and incorrectly assume `history.pushState` is available
(which resulted in an error being thrown).
This commit fixes the detection of sandboxed CPAs in `$sniffer`.

See #11932 and #13945 for previous work.

Closes #15021
2016-09-08 23:52:39 +03:00
Georgios Kalpakas a83a209df6 docs(ngModelOptions): minor fixes/improvements 2016-09-08 23:39:00 +03:00
Martin Staffa cc8ea72f3a docs(ngSwitch): add separator example 2016-09-08 21:23:41 +02:00
Lucas Galfaso 0b22173000 feat(ngSwitch): allow multiple case matches via optional attribute ngSwitchWhenSeparator
Adds an optional attribute `ngSwitchWhenSeparator` that allows multiple tokens to match a given `ngSwitchWhen`.

Closes #3410
Closes #3516

Closes #10798
2016-09-08 21:10:14 +02:00
Martin Staffa 4941e047b7 docs($compile): link to sections from properties in example 2016-09-08 15:58:05 +02:00
Austin O'Neil c729554281 docs(guide/component): clarify when to use directives instead of components
Clarify that components cannot be used to perform actions in compile
and prelink functions.

Closes #15042
PR (#15100)
2016-09-08 15:21:10 +02:00
sethbattin 8ec3f4b518 docs($resourceProvider): include '$' in di in example
The injection argument is missing the '$' in the two examples.  The code fails as written.  This change corrects it.

(#15099)
2016-09-08 15:18:32 +02:00
Michał Gołębiowski d882fde2e5 feat(jqLite): return [] for .val() on <select multiple> with no selection
Fixes #14370

BREAKING CHANGE: For the jqLite element representing a select element in
the multiple variant with no options chosen the .val() getter used to return
null and now returns an empty array.

To migrate the code follow the example below:

Before:

HTML:

    <select multiple>
        <option>value 1</option>
        <option>value 2</option>
    </select>

JavaScript:

    var value = $element.val();
    if (value) {
        /* do something */
    }

After:

HTML:

    <select multiple>
        <option>value 1</option>
        <option>value 2</option>
    </select>

JavaScript:

    var value = $element.val();
    if (value.length > 0) {
        /* do something */
    }
2016-09-08 09:55:24 +02:00
Michał Gołębiowski 121f64936e refactor(jqLite): use the toEqualOneOf matcher in jqLite tests 2016-09-08 09:55:24 +02:00
Michał Gołębiowski dbb8483b4d refactor(matchers): add the toEqualOneOf matcher 2016-09-08 09:55:24 +02:00
Michał Gołębiowski 6341f4260a refactor(jqLite): run more tests on jQuery 2.2, add version detection helpers 2016-09-08 09:55:24 +02:00
Georgios Kalpakas 704123a81b docs($compile): be more explicit about linking not having taken place inside cloneAttachFn
Fixes #15093
2016-09-07 19:10:23 +03:00
Georgios Kalpakas c0cbe54bc6 test($compile): extend $onChanges() test to account for one more case
Discussed in https://github.com/angular/angular.js/pull/15098/files#r77770755.
2016-09-07 15:03:45 +03:00
Georgios Kalpakas 7d7efbf545 fix($compile): avoid calling $onChanges() twice for NaN initial values
Closes #15098
2016-09-07 12:19:27 +01:00
Peter Bacon Darwin 3cb5bad15d test($compile): add tests for provider settings
See https://github.com/angular/angular.js/pull/15095#issuecomment-244970426
2016-09-07 08:52:00 +01:00
Peter Bacon Darwin dfb8cf6402 feat($compile): add preAssignBindingsEnabled option
A new option to enable/disable whether directive controllers are assigned bindings before
calling the controller's constructor.

If enabled (true), the compiler assigns the value of each of the bindings to the
properties of the controller object before the constructor of this object is called.

If disabled (false), the compiler calls the constructor first before assigning bindings.

The default value is enabled (true) in Angular 1.5.x but will switch to false in Angular 1.6.x.

See #14580
Closes #15095
2016-09-07 08:51:59 +01:00
Martin Staffa de1ede7f44 docs(error/noident): add missing comma
Closes #15086
2016-09-05 22:57:59 +02:00
BobChao87 45129cfd06 fix($sanitize): reduce stack height in IE <= 11
Update Internet Explorer-only helper function stripCustomNsAttrs to be less
recursive. Reduce stack height of function causing out of stack space error.

Closes #14928
Closes #15030
2016-09-05 22:53:07 +02:00
gdi2290 aa306c14cb refactor(*): introduce isNumberNaN
window.isNaN(‘lol’); //=> true
Number.isNaN(‘lol’); //=> false

isNaN converts it’s arguments into a Number before checking if it’s NaN.
In various places in the code base, we are checking if a variable is a Number and
NaN (or not), so this can be simplified with this new method (which is not exported on the
global Angular object).

Closes #11242
2016-09-05 22:22:48 +02:00
Martin Staffa 9fbad3c7c2 chore(*): use binaries from node_modules/.bin
Closes #15071
2016-09-05 22:04:36 +02:00
John-David Dalton 6100f10fa9 chore(npm): use require.resolve when possible to avoid hard coded module paths 2016-09-05 22:04:36 +02:00
Peter Bacon Darwin 87a2ff76af feat(ngModelOptions): allow options to be inherited from ancestor ngModelOptions
Previously, you had to apply the complete set of ngModelOptions at every point where
you might want to modify just one or two settings.

This change allows more general settings to be applied nearer to the top of the DOM
and then for more specific settings to override those general settings further down
in the DOM.

Furher there is now a new service `$modelOptions` that acts as the top level options
that are inherited by all ngModelOptions directives that do not already have an
ngModelOptions ancestor directive.

Closes #10922

BREAKING CHANGE:

Previously, if a setting was not applied on ngModelOptions, then it would default
to undefined. Now the setting will be inherited from the nearest ngModelOptions
ancestor.

It is possible that an ngModelOptions directive that does not set a property,
has an ancestor ngModelOptions that does set this property to a value other than
undefined. This would cause the ngModel and input controls below this ngModelOptions
directive to display different behaviour. This is fixed by explictly setting the
property in the ngModelOptions to prevent it from inheriting from the ancestor.

For example if you had the following HTML:

```
<form ng-model-options="{updateOn: 'blur'}">
  <input ng-model="...">
</form>
```

Then before this change the input would update on the default event not blur.
After this change the input will inherit the option to update on blur.
If you want the original behaviour then you will need to specify the option
on the input as well:

```
<form ng-model-options="{updateOn: 'blur'}">
  <input ng-model="..." ng-model-options="{updateOn: 'default'}">
</form>
```

The programmatic API for `ngModelOptions` has changed. You must now read options
via the `getOption` method, rather than accessing the option directly as a property
of the options object. This does not affect the usage in templates and only
affects custom directives that might have been reading options for their own purposes.
2016-09-02 20:40:12 +01:00
Brian Glick 5be6f993aa docs(currency): add missing line break
Insert missing line break between currency examples

PR  (#15083)
2016-09-01 20:08:52 +02:00
Packt 81d52dfe39 docs(guide/External Resources): add a paid-online course
Closes #15075
2016-09-01 11:40:26 +01:00
Jason Bedard 11f2731f72 perf($compile): validate directive.restrict property on directive init
This allows the removal of try/catch from addDirective to avoid V8 deopt.

Previously the directive.restrict property was not validated. This would
potentially cause exceptions on each compilation of the directive
requiring a try/catch and potentially causing repeated errors.

New validation when directive.restrict is specified:
* must be a string
* must contain at least one valid character (E, A, C, M)

Cases which previously silently failed (now throw an error):
* values with an indexOf method (such as strings, arrays) which returned
 returned -1 for all valid restrict characters

Cases which previously worked unintentionally (now throw an error):
* arrays with single-character strings of valid restrict characters

PR (#13263)
2016-08-30 22:48:46 +02:00
Jason Bedard 1e1fbc75f5 fix($compile): disallow linking the same element more then once
Previously the following would invoke the element link function multiple
times, causing unknown and potentially buggy results:

    var link = $compile(html);
    link(scope);
    link(scope);

This was always unsupported. Now this throws a multilink error.

PR (#13422)
2016-08-30 22:45:32 +02:00
Martin Staffa 53a3bf6634 feat($compile): throw error when directive name or factory fn is invalid
Closes: #15056
PR (#15057)
2016-08-28 16:53:08 +02:00
Georgios Kalpakas e3a378e7a3 feat($resource): pass status/statusText to success callbacks
Fixes #8341
Closes #8841
PR (#14836)
2016-08-26 18:36:22 +02:00
Martin Staffa c75698df55 fix(select): add/remove selected attribute for selected/unselected options 2016-08-26 14:16:59 +02:00
Martin Staffa 2785ad7259 fix(select, ngOptions): make the handling of unknown / empty options consistent
- when the model does not match any option, the select generates an unknown option with the value
'? hashedModelVal ?' (select) or simply '?' (ngOptions) and inserts it into the select. This
option is then auto-selected by the browser. Once the user selects an option / the application sets
a matching model, the unknown option is removed from the select. It is therefore not user-selectable.

Alternatively, the application can provide an option with the value='', the so-called empty option.
The empty option takes over the role of the unknown option, in that it is selected when there's no
matching model, but it is not removed when a option and model match, and it can also be selected by
the user. The empty option has the value='' and sets the model to  if selected.

Previously, these concepts where a bit mushy, especially in ngOptions.

This fix now delegates the bulk of the work to the selectCtrl, as the concept of unknown and empty
option are the same for both directives. Only the generation of the empty option is different.

The commit also adjusts a test for an officially unsupported use-case: multiple empty options.
The new behavior is that the empty option that is registered last is used. The other one is still
present. Otherwise, this behavior is unspecified, and the docs are clear that only a single empty
option is allowed. We support dynamically generated empty options, but not multiple ones. I've left
the test to highlight that this might be someone's use case, and the we are aware of it.
2016-08-26 14:16:59 +02:00
Raphael Jamet ad9a99d689 fix($compile): lower the $sce context for src on video, audio, and track.
Previously, video, audio, and track sources were $sce.RESOURCE_URL. This is not justified as
no attacks are possible through these attributes as far as I can tell. This change is not
breaking, and uses of $sce.trustAsResourceUrl before assigning to src or ng-src attributes
will just be silently ignored.
2016-08-26 09:58:02 +02:00
Martin Staffa 7fb81ecf12 Revert "fix($compile): lower the $sce context for src on video, audio, source, and track"
This reverts commit 485320129d, because I did not author most of
this commit. I merged via Github and for some reason it used the last commit in a series of commits
to establish the author.
2016-08-26 09:55:16 +02:00
Martin Staffa 485320129d fix($compile): lower the $sce context for src on video, audio, source, and track
Previously, video, audio, source, and track sources were $sce.RESOURCE_URL. This is not justified as
no attacks (script execution) are possible through these attributes as far as we can tell. Angular2 also uses the same categorization.

This change is not breaking, and uses of $sce.trustAsResourceUrl before assigning to src or ng-src attributes will just be silently ignored.

This has also been given a LGTM by @mprobst via email.

PR (#15039)
Closes #14019
2016-08-26 09:52:11 +02:00
Georgios Kalpakas 13c2522baf fix($compile): correctly merge consecutive text nodes on IE11
As explained in #11781 and #14924, IE11 can (under certain circumstances) break up a text node into
multiple consecutive ones, breaking interpolated expressions (e.g. `{{'foo'}}` would become
`{{` + `'foo'}}`). To work-around this IE11 bug, #11796 introduced extra logic to merge consecutive
text nodes (on IE11 only), which relies on the text nodes' having the same `parentNode`.

This approach works fine in the common case, where `compileNodes` is called with a live NodeList
object, because removing a text node from its parent will automatically update the latter's
`.childNodes` NodeList. It falls short though, when calling `compileNodes` with either a
jqLite/jQuery collection or an Array. In fails in two ways:

1. If the text nodes do not have a parent at the moment of compiling, there will be no merging.
   (This happens for example on directives with `transclude: {...}`.)
2. If the text nodes do have a parent, just removing a text node from its parent does **not** remove
   it from the collection/array, which means that the merged text nodes will still get compiled and
   linked (and possibly be displayed in the view). E.g. `['{{text1}}', '{{text2}}', '{{text3}}']`
   will become `['{{text1}}{{text2}}{{text3}}', '{{text2}}', '{{text3}}']`.

--
This commit works around the above problems by:

1. Merging consecutive text nodes in the provided list, even if they have no parent.
2. When merging a text node, explicitly remove it from the list (unless it is a live, auto-updating
   list).

This can nonetheless have undesirable (albeit rare) side effects by overzealously merging text
nodes that are not meant to be merged (see the "BREAKING CHANGE" section below).

Fixes #14924

Closes #15025

BREAKING CHANGE:

**Note:** Everything described below affects **IE11 only**.

Previously, consecutive text nodes would not get merged if they had no parent. They will now, which
might have unexpectd side effects in the following cases:

1. Passing an array or jqLite/jQuery collection of parent-less text nodes to `$compile` directly:

    ```js
    // Assuming:
    var textNodes = [
      document.createTextNode('{{'),
      document.createTextNode('"foo"'),
      document.createTextNode('}}')
    ];
    var compiledNodes = $compile(textNodes)($rootScope);

    // Before:
    console.log(compiledNodes.length);   // 3
    console.log(compiledNodes.text());   // {{'foo'}}

    // After:
    console.log(compiledNodes.length);   // 1
    console.log(compiledNodes.text());   // foo

    // To get the old behavior, compile each node separately:
    var textNodes = [
      document.createTextNode('{{'),
      document.createTextNode('"foo"'),
      document.createTextNode('}}')
    ];
    var compiledNodes = angular.element(textNodes.map(function (node) {
      return $compile(node)($rootScope)[0];
    }));
    ```

2. Using multi-slot transclusion with non-consecutive, default-content text nodes (that form
   interpolated expressions when merged):

   ```js
   // Assuming the following component:
   .compoent('someThing', {
     template: '<ng-transclude><!-- Default content goes here --></ng-transclude>'
     transclude: {
       ignored: 'veryImportantContent'
     }
   })
   ```

   ```html
   <!-- And assuming the following view: -->
   <some-thing>
     {{
     <very-important-content>Nooot</very-important-content>
     'foo'}}
   </some-thing>

   <!-- Before: -->
   <some-thing>
     <ng-transclude>
       {{       <-- Two separate
       'foo'}}  <-- text nodes
     </ng-transclude>
   </some-thing>

   <!-- After: -->
   <some-thing>
     <ng-transclude>
       foo  <-- The text nodes were merged into `{{'foo'}}`, which was then interpolated
     </ng-transclude>
   </some-thing>

   <!-- To (visually) get the old behavior, wrap top-level text nodes on -->
   <!-- multi-slot transclusion directives into `<span>` elements; e.g.: -->
   <some-thing>
     <span>{{</span>
     <very-important-content>Nooot</very-important-content>
     <span>'foo'}}</span>
   </some-thing>

   <!-- Result: -->
   <some-thing>
     <ng-transclude>
       <span>{{</span>       <-- Two separate
       <span>'foo'}}</span>  <-- nodes
     </ng-transclude>
   </some-thing>
   ```
2016-08-25 19:15:10 +03:00
Georgios Kalpakas cb31067c2a docs(tutorial/step_03): improve explanation of camel-/kebab-casing
Related to #15051.
2016-08-25 18:36:20 +03:00
Wei Wang 3d686a988d feat($location): add support for selectively rewriting links based on attribute
In HTML5 mode, links can now be selectively rewritten, by setting `mode.rewriteLinks` to a string
(denoting an attribute name). Anchor elements that have the specified attribute will be rewritten,
while other links will remain untouched.

This can be useful in situations where it is desirable to use HTML5 mode without a `<base>` tag, but
still support rewriting specific links only. See #14959 for more details on a possible usecase.

Closes #14976
2016-08-22 17:39:55 +03:00
Benjamin Blackwood 8df43677e2 docs($resource): add status param to transformResponse signature
Add `status` param to `transformResponse` signature to keep inline with 1b74097.

Closes #15041
2016-08-18 15:50:30 +03:00
Martin Staffa e50e91c7a8 docs($componentController): add more info
Closes #15038
2016-08-17 22:09:49 +02:00
Duly Bonheur c54f7a93e0 docs(ngRepeat): improve example description
The example seems to also be filtering by age. It threw me off a bit because I was getting results when I entered numbers in the input field.

PR (#15037)
2016-08-17 21:48:47 +02:00
Martin Staffa e1da4bed8e feat(input[number]): support step
input[number] will now set the step error if the input value
(ngModel $viewValue) does not fit the step constraint set in the step / ngStep attribute.

Fixes #10597
2016-08-17 21:22:01 +02:00
Martin Staffa 9a8b8aaa96 feat(input[range]): support step
Step support works like min / max, but with the following caveat.
Currently, only Firefox fully implements the spec. Other browsers
(Chrome, Safari, Edge) have issues when the step value changes
after the input has been changed. They do not adjust the input value
to a valid value, but instead set the stepMismatch validity state.

Angular will take this validity state, and forward it as the ngModel
"step" error. Adjusting the error ourselves would add too much code,
as the logic is quite involved.
2016-08-17 21:22:01 +02:00
Georgios Kalpakas 88f3517db2 docs(guide/concepts): improve wording 2016-08-17 17:28:00 +03:00
Martin Staffa a272a3c0bd fix(input[range]): correctly handle min/max; remove ngMin/ngMax support
This commit fixes the handling of min/max, and removes support for ngMin/ngMax:

min/max:
Previously, interpolated min/max values on input range were not set when the first $render happens,
because the interpolation directive only sets the actual element attribute value after
a digest passes. That means that the browser would not adjust
the input value according to min/max and the range input and model would
not be initialzed as expected. 
With this change, input range will set the actual element attribute value during its own
linking phase, as it is already available on the attrs argument passed to the link fn.

ngMin/ngMax
Since ng prefixed attributes do not set their corresponding element attribute, the range input would always have min = 0, and max = 100 (in supported browsers), regardless of the value
in ngMin/ngMax. This is confusing and not very useful, so it's better to not support these attributes at all.

The commit also fixes a test which used an interpolation inside an attribute that expects an expression.

Fixes #14982 
PR (#14996)
2016-08-12 19:58:08 +02:00
Martin Staffa eacfe4148e feat($controller): throw when requested controller is not registered
Previously, it would throw the ng:areq error, which is less
specific and just informs that the requested controller is not defined. 
Given how commonly controllers are used
in Angular, it makes sense to have a specific error.

The ng:areq error is still thrown when the registered controller
is not a function.

Closes #14980
PR (#15015)
2016-08-12 19:12:12 +02:00
Georgios Kalpakas 6304cde2fc chore(build): fix version placeholder matching
During the `build` task, the version placeholders will be replaced with the actual values using a
RegExp, which expects the placeholders to be surrounded by double quotes. By replacing the quotes
from double to single in #15011, the RegExp was not able to match the placeholders.

(For reference, the RegExps that match and replace the version placeholders are in
[lib/grunt/utils.js][1].)

[1]: https://github.com/angular/angular.js/blob/859348c7f61ff5f93b9f81eb7f46842bd018d8e3/lib/grunt/utils.js#L125-L130

Closes #15016
2016-08-12 18:18:30 +03:00
Michał Gołębiowski 859348c7f6 chore(*): change remaining /* @this */ to /** @this */
Ref ec565ddd9c
2016-08-11 01:16:40 +02:00
Michał Gołębiowski 9360aa2d27 chore(eslint): enable quotes: ["error", "single"]
The quotes rule had to be disabled for e2e tests generated from ngdoc
because dgeni templates use double quotes as string delimiters.

Since we can't have guarantees that dgeni template wrappers will follow
the same JS code style the Angular 1 repo uses, we should find a way
to enforce our ESLint setup only for the parts in this repo, perhaps
via prepending a generated `/* eslint-enable OUR_RULES */` pragma.

Closes #15011
2016-08-10 21:52:38 +02:00
Georgios Kalpakas 42a00611f8 docs(CONTRIBUTING.md): minor improvements
Closes #15008
2016-08-10 20:45:21 +03:00
Martin Staffa b6340d1654 docs(ngValue): improve use case description 2016-08-09 22:08:20 +02:00
mohamed amr e6afca00c9 fix(ngValue): set the element's value property in addition to the value attribute
Input elements use the value attribute as their default value if the value property is not set.
Once the value property has been set (by adding input), it will not react to changes to
the value attribute anymore. Setting both attribute and property fixes this behavior, and
makes it possible to use ngValue as a one-way bind.

Closes #14031
Closes #13984

POSSIBLE BREAKING CHANGE:

`ngValue` now also sets the value *property* of its element. Previously, it would only set the
value *attribute*. This allows `ngValue` to be used as a one-way binding mechanism on `input[text]`
and `textarea` elements without `ngModel`. Previously, these input types would not update correctly
when only the value attribute was changed.
This change should not affect any applications, as `ngValue` is mainly used on `input[radio]` and
`option` elements, both of which are unaffected by this change.
2016-08-09 22:08:20 +02:00
Benjamin Dopplinger c7010bef6e docs(contributing.md): fix indentation for proper Markdown syntax
PR (#15007)
2016-08-09 10:30:36 +02:00
Georgios Kalpakas b62f33f29a docs(ngMock/$httpBackend): improve description of .flush() 2016-08-09 00:25:08 +03:00
sarychev 72b663219e feat(ngMock/$httpBackend): flush requests in any order
Previously, requests were flushed in the order in which they were made.
With this change, it is possible to flush requests in any order. This is useful for simulating more
realistic scenarios, where parallel requests may be completed in any order.

Partially addresses #13717.

Closes #14967
2016-08-08 21:52:30 +03:00
Georgios Kalpakas fdf8e0f988 fix($httpBackend): complete the request on timeout
When using the [timeout attribute](https://xhr.spec.whatwg.org/#the-timeout-attribute) and an XHR
request times out, browsers trigger the `timeout` event (and execute the XHR's `ontimeout`
callback). Additionally, Safari 9 handles timed-out requests in the same way, even if no `timeout`
has been explicitly set on the XHR.
In the above cases, `$httpBackend` would fail to capture the XHR's completing (with an error), so
the corresponding `$http` promise would never get fulfilled.

Note that using `$http`'s `timeout` configuration option does **not** rely on the XHR's `timeout`
property (or its `ontimeout` callback).

Fixes #14969
Closes #14972
2016-08-08 19:12:17 +03:00
Georgios Kalpakas ec565ddd9c chore(package): fix some warnings/errors
Related to #14952. Fixed the following warnings/errors:

1. **Warning**: Closure Compiler complained about `/* @this */` (annotations in non-JSDoc comments).
   Fixed by changing `/* @this */` to `/** @this */`.

2. **Warning**: Dgeni complained about `/** @this */` (invalid tags found).
   Fixed by adding an empty `this` tag definition in `docs/config/tag-defs/`.

3. **Error**: ESLint complained about CRLF linebreaks in `build/docs/examples/`. These are generated
   by dgeni and (apparently) use the system's default linebreak (e.g. CRLF on Windows).
   Fixed by disabling the `linebreak-style` rule for `build/docs/examples/`.

Closes #14997
2016-08-08 18:40:29 +03:00
Georgios Kalpakas 975a6170ef fix(aria/ngModel): do not overwrite the default $isEmpty() method for checkboxes
Previously, `ngAria` would overwrite the default `ngModelController.$isEmpty()` method for custom
`checkbox`-shaped controls (e.g. `role="checkbox"` or `role="menuitemcheckbox"`), using the same
implementation as `input[checkbox]` (i.e. `value === false`). While this makes sense for
`input[checkbox]` which also defines a custom parser, it doesn't make sense for a custom `checkbox`
out-of-the-box. For example, an unintialized value (`undefined`) would make the checkbox appear as
"checked".

If the user wants to provide a custom parser (e.g. setting falsy values to `false`), then they
should also provide a custom `$isEmpty()` method.

As a side effect, this commit solves issue #14621. (We could have solved it in different ways.)

Fixes #14621
Closes #14625

BREAKING CHANGE:

Custom `checkbox`-shaped controls (e.g. checkboxes, menuitemcheckboxes), no longer have a custom
`$isEmpty()` method on their `NgModelController` that checks for `value === false`. Unless
overwritten, the default `$isEmpty()` method will be used, which treats `undefined`, `null`, `NaN`
and `''` as "empty".

**Note:** The `$isEmpty()` method is used to determine if the checkbox is checked ("not empty" means
          "checked") and thus it can indirectly affect other things, such as the control's validity
          with respect to the `required` validator (e.g. "empty" + "required" --> "invalid").

Before:

```js
var template = '<my-checkbox role="checkbox" ng-model="value"></my-checkbox>';
var customCheckbox = $compile(template)(scope);
var ctrl = customCheckbox.controller('ngModel');

scope.$apply('value = false');
console.log(ctrl.$isEmpty());   //--> true

scope.$apply('value = true');
console.log(ctrl.$isEmpty());   //--> false

scope.$apply('value = undefined'/* or null or NaN or '' */);
console.log(ctrl.$isEmpty());   //--> false
```

After:

```js
var template = '<my-checkbox role="checkbox" ng-model="value"></my-checkbox>';
var customCheckbox = $compile(template)(scope);
var ctrl = customCheckbox.controller('ngModel');

scope.$apply('value = false');
console.log(ctrl.$isEmpty());   //--> false

scope.$apply('value = true');
console.log(ctrl.$isEmpty());   //--> false

scope.$apply('value = undefined'/* or null or NaN or '' */);
console.log(ctrl.$isEmpty());   //--> true
```

--
If you want to have a custom `$isEmpty()` method, you need to overwrite the default. For example:

```js
.directive('myCheckbox', function myCheckboxDirective() {
  return {
    require: 'ngModel',
    link: function myCheckboxPostLink(scope, elem, attrs, ngModelCtrl) {
      ngModelCtrl.$isEmpty = function myCheckboxIsEmpty(value) {
        return !value;   // Any falsy value means "empty"

        // Or to restore the previous behavior:
        // return value === false;
      };
    }
  };
})
```
2016-08-08 17:28:52 +03:00
Georgios Kalpakas e8d7496b62 perf($parse): improve performance of assignment expressions
There was a ~5% improvement in the added `parsed-expressions-bp/assignment` benchmark (which only
contains assignment expressions). In real-world applications, the time spent in assignment
expressions will be a tiny fragment of the overall processing time, though.

Closes #14957
2016-08-08 15:48:52 +03:00
Michał Gołębiowski 49f077736d chore(*): minor code style tweaks
This is a followup to the migration to ESLint.

Ref #14952

Closes #15006
2016-08-08 15:01:12 +03:00
Kevin Visscher 3393aac049 docs(error/reqslot): fix typo
Closes #15003
2016-08-08 14:31:41 +03:00
Martin Staffa 4fe0987966 style(benchmarks): fix eslint errors 2016-08-08 11:33:37 +02:00
dherman b58a7f8a12 chore(styleDirective): remove an unneccessary directive definition
Since the style directive is defined as a non-terminal element directive
with no behavior on link, we may as well not define anything at all.
PR (#14983)
2016-08-08 11:08:48 +02:00
Roshan Jossey 38a49641fd docs(guide/external-resources): add links to Atom and Vim packages
Add links to packages for Atom and Vim editors under editor support
subsection under tools section.
PR (#15000)
2016-08-08 11:02:47 +02:00
David Rodenas 4c2964d01b perf($compile): add provider option to turn off compilation of css class and comment directives
When the functions `cssClassDirectivesEnabled()` / `commentDirectivesEnabled()` on the `$compileProvider` are called with `false`, then the compiler won't look for directives on css classes / comment elements.

This can result in a compilation speed-up of around 10%.

PR (#14850)
2016-08-08 11:01:08 +02:00
Michał Gołębiowski 5fc993361f fix(jenkins): Fix the format for passing parameters to Grunt tasks
The Jenkins build.sh script has to be updated as the previous way of
specifying parameters to the code run in Grunt tasks stopped working
with the newest Grunt. This has been previously fixed for the Travis
build.sh but wasn't done for the Jenkins one.

Also, the contribute docs were updated to account for the new format.
2016-08-06 01:02:21 +02:00
Michał Gołębiowski c3220325a0 chore(*): switch from JSHint/JSCS to ESLint
Thanks to @narretz for help in fixing style violations and to @gkalpak
for a very extensive review.

Closes #14952
2016-08-05 22:18:32 +02:00
Michał Gołębiowski 517b9bd6ed chore(package.json): Remove the deprecated licenses field
The "licenses" field is deprecated in favor of the "license" field... which
we already have specified.
2016-08-05 20:24:58 +02:00
Michał Gołębiowski 8c00386e0d chore(package.json): update Karma & BrowserStack-related packages 2016-08-05 20:24:42 +02:00
Michał Gołębiowski 6f737293ee chore(package.json): remove the engineStrict field
The engineStrict field is deprecated in npm 2 and removed in npm 3.
2016-08-05 19:42:53 +02:00
Michał Gołębiowski b1c665095c chore(*): Add .nvmrc
If one uses nvm to manage Node.js versions, the .nvmrc file makes `nvm use`
switch to the version specified in .nvmrc. There are scripts that invoke
it automatically when cd'ing to directories containing .nvmrc so that you
never run build commands using a wrong Node version, see:
https://github.com/creationix/nvm/blob/v0.31.2/README.markdown#zsh
2016-08-05 19:42:42 +02:00
Michał Gołębiowski bdb794ebcf chore(bower): change the name in bower.json
This avoids warnings with newer versions of Bower.
2016-08-05 19:42:37 +02:00
Michał Gołębiowski 0606b15384 chore(package.json): upgrade Protractor
The previous version depended on a vulnerable request version.

Ref gh-14961
2016-08-05 19:42:28 +02:00
Michał Gołębiowski 3134e78fc0 chore(package.json): add grunt-cli to devDependencies, update grunt-* packages
The Travis build.sh script has to be updated as the previous way of
specifying parameters to the code run in Grunt tasks stopped working
with the newest Grunt.
2016-08-05 19:37:02 +02:00
Martin Staffa 1660ddd89e docs($resource): clarify overwriting a default action
Closes #14821
2016-08-03 11:10:37 +02:00
Gordon Zhu 494d12fd40 docs(guide/External Resources): remove stale resources
This commit removes two resources  (Firebase Foundations and Angular Course) that I authored but no longer maintain.
PR (#14973)
2016-08-01 09:58:37 +02:00
Georgios Kalpakas 7bef522042 docs($filter): improve description formatting 2016-07-31 10:46:19 +03:00
Georgios Kalpakas 4ef2169168 docs(textarea): add known issue about interpolation in placeholder in IE
Closes #5025

Closes #14965
2016-07-31 07:59:03 +03:00
Vitaly P 31f20b6db1 docs($filter): add link to built-in filters page 2016-07-30 16:57:19 +02:00
Martin Staffa 9130166767 feat(input): add support for binding to input[type=range] (#14870)
Thanks to @cironunes for the initial implementation in https://github.com/angular/angular.js/pull/9715

Adds support for binding to input[range] with the following behavior / features:

- Like input[number], it requires the model to be a Number, and will set the model to a Number
- it supports setting the min/max values via the min/max and ngMin/ngMax attributes
- it follows the browser behavior of never allowing an invalid value. That means, when the browser
converts an invalid value (empty: null, undefined, false ..., out of bounds: greater than max, less than min)
to a valid value, the input will in turn set the model to this new valid value via $setViewValue.
-- this means a range input will never be required and never have a non-Number model value, once the
ngModel directive is initialized.
-- this behavior is supported when the model changes and when the min/max attributes change in a way
that prompts the browser to update the input value.
-- ngMin / ngMax do not prompt the browser to update the values, as they don't set the attribute values.
Instead, they will set the min / max errors when appropriate
- browsers that do not support input[range] (IE9) handle the input like a number input (with validation etc.)

Closes #5892
Closes #9715
Close #14870
2016-07-29 14:29:09 +02:00
Georgios Kalpakas cd2f6d9d3b test(e2e): fix e2e tests in Firefox 2016-07-29 11:43:36 +03:00
Peter Bacon Darwin 13b7bf0bb5 docs(examples): give all examples a name
Closes #14958
2016-07-28 10:58:58 +01:00
Chung-Min Cheng 9ac9fb1565 docs(guide/animations): clean up example
Remove unnecessary inline styles, merge styles for identical selectors and clean up.

Closes #14960
2016-07-28 12:34:54 +03:00
Georgios Kalpakas c0795c97a5 docs(ngModel/numfmt): remove redundant argument 2016-07-27 12:04:03 +03:00
Georgios Kalpakas 4fa214ce32 fix($parse): block assigning to fields of a constructor prototype
This commit also adds the missing `isecaf` error page and more tests for assignment to constructors.

Fixes #14939

Closes #14951
2016-07-27 10:58:02 +03:00
Georgios Kalpakas 8ddfa2a491 fix($parse): correctly escape unsafe identifier characters
This commit also adds a couple of tests for `$parseProvider.setIdentifierFns()`.

Closes #14942
2016-07-26 10:18:09 +03:00
Georgios Kalpakas d6423804a9 test($parse): test custom literals with CSP both enabled and disabled
(This commit also includes a minor clean-up.)
2016-07-26 10:17:24 +03:00
Georgios Kalpakas 10a6e1a663 chore(travis): update sauce-connect
Closes #14936
2016-07-25 18:50:10 +03:00
Giuseppe Scoppino 544df1879b docs(guide/component): document $doCheck in the component guide
The docs for `$compile` were updated in e235f20 to include information about the recently
implemented `$doCheck` lifecycle hook for component controllers. The lifecycle hook documentation is
mirrored in the Component guide, and this change mirrors the update made to the `$compile` docs, to
the component guide docs.

Closes #14946
2016-07-25 18:17:28 +03:00
Martin Staffa b4769c371e fix(ngOptions): remove selected attribute from unselected options
When the select model changes, we add the "selected" attribute to the selected option, so that
screen readers know which option is selected.

Previously, we failed to remove the attribute from the selected / empty option when the model changed
to match a different option, or the unknown / empty option.

When using "track by", the behavior would also show when a user selected an option, and then the
model was changed, because track by watches the tracked expression, and calls the $render function
on change.

This fix reads the current select value, finds the matching option and removes the "selected"
attribute.

IE9 had to be special cased, as it will report option.hasAttribute('selected') === true even
if the option's property and attribute have been unset (even the dev tools show not selected attribute).

I've added a custom matcher that accounts for this behavior. In all other browsers, property and
attribute should always be in the same state. Since few people will use screen readers with IE9, I
hope this is a satisfactory solution to the problem.

Fixes #14892
Fixes #14419
Related #12731
PR (#14894)
2016-07-23 17:20:16 +02:00
Martin Staffa ca812b0aeb chore(travis): use Chrome 51 and FF 47 in unit tests
PR (#14943)
2016-07-23 16:07:02 +02:00
Martin Staffa 5fd42b6cb8 docs(form): clarify what $setPristine does 2016-07-22 21:33:33 +02:00
Martin Staffa ce3571280d docs(guide/External Resources): move it after the introduction 2016-07-22 21:30:43 +02:00
Martin Staffa 1d4216a8bc chore(travis): use Firefox 47
This commit also adds a new capability to the protractor configs that
ensures that all angularjs.org tests run correctly on Firefox. See
https://github.com/SeleniumHQ/selenium/issues/1202
2016-07-22 21:28:59 +02:00
Martin Staffa 95660555aa chore(npm): update protractor to 4.0.0
4.0.0 is the first version with Selenium 2.53.x, and we need that as lower versions have problems
with current Firefox versions.
See https://github.com/SeleniumHQ/selenium/issues/1202 and https://github.com/SeleniumHQ/selenium/issues/2110.

We are currently running tests on FF28.

As part of the update the deprecated webdriver fn getInnerHtml has been replaced with getAttribute('innerHTML')
2016-07-22 21:28:59 +02:00
Peter Bacon Darwin 228754fe96 docs(CHANGELOG.md): add release notes for v1.5.8 2016-07-22 16:04:08 +01:00
Georgios Kalpakas 83bc247967 docs(CHANGELOG.md): add release notes for v1.2.30 2016-07-21 12:37:47 +03:00
Georgios Kalpakas 482a3ae9f9 test($anchorScroll): add e2e tests
Fixes #9535
Closes #9583

Closes #14932
2016-07-20 11:37:43 +03:00
Brad ce40d5cbda docs($httpParamSerializer): fix typo (remove superfluous quote)
Closes #14934
2016-07-20 10:47:49 +03:00
Georgios Kalpakas 5dfb328c94 refactor(test/e2e): make file/directory names consistent 2016-07-19 21:42:24 +03:00
Georgios Kalpakas 5f6949fdae fix($resource): fulfill promise with the correct value on error
This fixes a regression introduced with 71cf28c. See #14837 for more info.

Fixes #14837
Closes #14839
2016-07-18 14:55:14 +01:00
Georgios Kalpakas 4487cffb13 test($resource): add some tests wrt handling response errors
The test currently fail on master, but should pass on 1.5.x.
A subsequent commit will fix the regressions on master.

(This commit should be backportable to 1.5.x.)

Related to #14837.
2016-07-18 14:53:22 +01:00
Georgios Kalpakas c13c666728 feat(ngRoute): allow ngView to be included in an asynchronously loaded template
During its linking phase, `ngView` relies on the info provided in `$route.current` for
instantiating the initial view. `$route.current` is set in the callback of a listener to
`$locationChangeSuccess`, which is registered during the instantiation of the `$route` service.

Thus, it is crucial that the `$route` service is instantiated _before_ the initial
`$locationChangeSuccess` event is fired. Since `ngView` declares `$route` as a dependency, the
service is instantiated in time, if `ngView` is present during the initial load of the page.

Yet, in cases where `ngView` is included in a template that is loaded asynchronously (e.g. in
another directive's template), the directive factory might not be called soon enough for `$route`
to be instantiated before the initial `$locationChangeSuccess` event is fired.

This commit fixes it, by enabling eager instantiation of `$route` (during the initialization phase).
Eager instantiation can be disabled (restoring the old behavior), but is on by default.

Fixes #1213
Closes #14893

BREAKING CHANGE:

In cases where `ngView` was loaded asynchronously, `$route` (and its dependencies; e.g. `$location`)
might also have been instantiated asynchronously. After this change, `$route` (and its dependencies)
will - by default - be instantiated early on.

Although this is not expected to have unwanted side-effects in normal application bebavior, it may
affect your unit tests: When testing a module that (directly or indirectly) depends on `ngRoute`, a
request will be made for the default route's template. If not properly "trained", `$httpBackend`
will complain about this unexpected request.

You can restore the previous behavior (and avoid unexpected requests in tests), by using
`$routeProvider.eagerInstantiationEnabled(false)`.
2016-07-18 13:12:28 +03:00
Georgios Kalpakas 47583d9800 fix($http): avoid Possibly Unhandled Rejection error when the request fails
Calling `promise.finally(...)` creates a new promise. If we don't return this promise, the user
won't be able to attach an error handler to it and thus won't be able to prevent a potential PUR
error.

This commit also improves the test coverage for the increment/decrement `outstandingRequestCount`
fix.

Closes #13869
Closes #14921
2016-07-18 10:09:52 +01:00
Georgios Kalpakas dc7f625f48 refactor($http): clean up code
Closes #14921
2016-07-18 10:09:45 +01:00
Georgios Kalpakas 5db625723b refactor($http): move functions together and order alphabetically
Closes #14921
2016-07-18 10:09:37 +01:00
William Bagayoko 4f6f2bce4a fix($http): properly increment/decrement $browser.outstandingRequestCount
Calling `$http` will not increment `$browser.outstandingRequestCount` until after all (potentially)
asynchronous request interceptors have been processed and will decrement it before any (potentially)
asynchronous response interceptors have been processed.
This can lead to `$browser.notifyWhenNoOutstandingRequests` firing
prematurely, which can be problematic in end-to-end tests.

This commit fixes this, by synchronizing the increment/decrement
operations with `$http`'s internal interceptor promise chain.

Fixes #13782
Closes #13862
Closes #14921

BREAKING CHANGE:

HTTP requests now update the outstanding request count synchronously.
Previously the request count would not have been updated until the
request to the server is actually in flight. Now the request count is
updated before the async interceptor is called.

The new behaviour is correct but it may change the expected behaviour in
a small number of e2e test cases where an async request interceptor is
being used.
2016-07-18 10:09:29 +01:00
Georgios Kalpakas 56d456360b chore(protractor): use directConnect locally to speed up tests
Closes #14919
2016-07-18 09:44:03 +01:00
Georgios Kalpakas 26acedde7c refactor(test/e2e): remove explicit call to waitForAngular()
Protractor automatically calls `waitForAngular()`, before every WebDriver action.

Closes #14920
2016-07-18 09:44:03 +01:00
Georgios Kalpakas fa81df4779 refactor(test/e2e): restore consistency across tests (just because) 2016-07-18 09:39:00 +01:00
John (J5) Palmieri 26dac5784a doc(guide/Animations): point to $animate.pin() to enable animation for elements outside an Angular app
Add a section inside of the ngAnimate documentation to point to $animate.pin().
It was not clear in the documentation why animations were being disabled inside of
modals and popup menus. This documentation explains in what situations elements may
be dynamically placed outside of the application DOM and points to the API documentation
on how to enable animations for these types of elements.

Related #14907
Closes #14918
2016-07-15 18:06:06 +02:00
Martin Staffa cd06cccc7f docs(ngSelected): note that it doesn't interact with ngModel
Closes #14916
Related #14876
2016-07-15 17:49:57 +02:00
Georgios Kalpakas aea62af5b8 docs(guide): fix links to tutorial steps 2016-07-15 10:49:23 +03:00
Peter Bacon Darwin c8a64817d2 style(ngViewSpec): fix missing end of file newline 2016-07-14 21:47:01 +01:00
Peter Bacon Darwin d808631d3a style(ngViewSpec): ensure only one top level describe block 2016-07-14 11:34:28 +01:00
Kate Miháliková 267ee9c892 fix(ngMock): trigger digest in $httpBackend.verifyNoOutstandingRequest()
Firing a digest at the beginning of the verification process, ensures that requests fired
asynchronously - e.g. in the `resolve` handler of a promise as happens with `$http` - will get
detected as well.
Previously, in order to reliably verify that there was no outstanding request, users needed to
manually trigger a digest, before calling `verifyNoOutstandingRequest()`. Failing to do so, could
prevent `verifyNoOutstandingRequest()` from detecting pending requests and cover bugs in application
code.
This is no longer the case, since a digest will always be fired autommatically as part of a call to
`verifyNoOutstandingRequest()`.

Fixes #13506
Closes #13513

BREAKING CHANGE:

Calling `$httpBackend.verifyNoOutstandingRequest()` will trigger a digest. This will ensure that
requests fired asynchronously will also be detected (without the need to manually trigger a digest).
This is not expected to affect the majority of test-suites. Most of the time, a digest is (directly
or indirectly) triggered anyway, before calling `verifyNoOutstandingRequest()`.
In the unlikely case that a test needs to verify the timing of a request with respect to the digest
cycle, you should rely on other means, such as mocking and/or spying.
2016-07-13 21:46:02 +03:00
Michał Gołębiowski 859b1e300c test(jQuery): Run tests with jQuery 3
Closes #14874
2016-07-13 10:08:48 +02:00
Georgios Kalpakas 489224ba85 refactor($animate): avoid unnecessary lookup
Closes #14902
2016-07-12 22:32:07 +03:00
Ronan Connolly 76ca4f4c20 docs(guide/unit-testing): add missing heading
Closes #14901
2016-07-12 18:30:35 +03:00
Steve Berube c253b8e577 docs(guide/animations): use the arguments of enabled() in correct order
Closes #14900
2016-07-12 17:49:32 +03:00
Lioman 914b5c87ff docs(FAQ): fix heading
Add whitespace to H1

PR: (#14896)
2016-07-11 18:22:57 +02:00
Georgios Kalpakas 5fe823948f chore(Jenkins): fix e2e tests on Jenkins
Follow-up to c72e13f and a82a8a5.

Closes #14889
2016-07-11 13:36:14 +03:00
Georgios Kalpakas f8a3faf5c9 docs(guide/module): remove newline in the middle of sentence 2016-07-10 11:46:36 +03:00
Oliver Salzburg c0f0d136f0 docs($http): fix default $http cache name
The name of the cache is the string "$http", not the symbol itself.

Closes #14885
2016-07-09 10:22:36 +03:00
Martin Staffa a82a8a5210 chore(protractor): use jasmine2 as framework 2016-07-07 15:29:25 +02:00
Martin Staffa c72e13fdb6 chore(package.json): update jasmine-reporters to 2.2.0 2016-07-07 15:29:06 +02:00
Martin Staffa e8c2e11975 fix(select): don't register options when select has no ngModel
When option elements use ngValue, value or interpolated text to set
the option value, i.e. when the parent select doesn't have an ngModel,
there is no necessity in registering the options with the select controller.

The registration was usually not a problem, as the ngModelController is set to a noop controller,
so that all further interactions are aborted ($render etc)

However, since f02b707 ngValue sets a hashed value inside the option value
(to support arbitrary value types). This can cause issues with tests that expect unhashed values.
The issue was found in angular-material, which uses select + ngValue to populate mdSelect.

POSSIBLE BREAKING CHANGE:

Option elements will no longer set their value attribute from their text value when their select
element has no ngModel associated. Setting the value is only needed for the select directive to
match model values and options. If no ngModel is present, the select directive doesn't need it.

This should not affect many applications as the behavior was undocumented and not part of a public
API. It also has no effect on the usual HTML5 behavior that sets the select value to the option text
if the option does not provide a value attribute.

PR (#14864)
2016-07-06 15:04:20 +02:00
Lee Adcock ad41baa1fd fix(ngAria): bind to keydown instead of keypress in ngClick
Previously, `ngAria` would provide keyboard support for non-native buttons (via `ngClick`), by
binding the `ngClick` handler to the `keypress` event. In an attempt to better emulate the behavior
of native buttons, `ngAria` will now bind to the `keydown` event (instead of `keypress`).

The configuration flag for this feature has been renamed from `bindKeypress` to `bindKeydown`, to
closer describe the underlying behavior.

Fixes #14063
Closes #14065

BREAKING CHANGE:

If you were explicitly setting the value of the `bindKeypress` flag, you need to change your code to
use `bindKeydown` instead.

Before: `$ariaProvider.config({bindKeypress: xyz})`
After: `$ariaProvider.config({bindKeydown: xyz})`

**Note:**
If the element already has any of the `ngKeydown`/`ngKeyup`/`ngKeypress` directives, `ngAria` will
_not_ bind to the `keydown` event, since it assumes that the developer has already taken care of
keyboard interaction for that element.

Although it is not expected to affect many applications, it might be desirable to keep the previous
behavior of binding to the `keypress` event instead of the `keydown`. In that case, you need to
manually use the `ngKeypress` directive (in addition to `ngClick`).

Before:

```html
<div ng-click="onClick()">
  I respond to `click` and `keypress` (not `keydown`)
</div>
```

After:

```html
<div ng-click="onClick()" ng-keypress="onClick()">
  I respond to `click` and `keypress` (not `keydown`)
</div>
<!-- OR -->
<div ng-click="onClick()">
  I respond to `click` and `keydown` (not `keypress`)
</div>
```

Finally, it is possible that this change affects your unit or end-to-end tests. If you are currently
expecting your custom buttons to automatically respond to the `keypress` event (due to `ngAria`),
you need to change the tests to trigger `keydown` events instead.
2016-07-06 15:54:49 +03:00
Georgios Kalpakas 30436957ed docs(guide/component): improve tests
Fixes #14739
2016-07-06 13:39:31 +03:00
Georgios Kalpakas acb545ec3e fix($resource): pass all extra, owned properties as params
Previously, a property would not be passed as query param, if `Object.prototype` had a property with
the same name.

Fixes #14866
Closes #14867

BREAKING CHANGE:

All owned properties of the `params` object that are not used to replace URL params, will be passed
to `$http` as `config.params` (to be used as query parameters in the URL), even if
`Object.prototype` has a property with same name. E.g.:

Before:

```js
var Foo = $resource('/foo/:id');
Foo.get({id: 42, bar: 'baz', toString: 'hmm'});
    // URL: /foo/42?bar=baz
    // Note that `toString` is _not_ included in the query,
    // because `Object.prototype.toString` is defined :(
```

After:

```js
var Foo = $resource('/foo/:id');
Foo.get({id: 42, bar: 'baz', toString: 'hmm'});
    // URL: /foo/42?bar=baz&toString=hmm
    // Note that `toString` _is_ included in the query, as expected :)
```
2016-07-06 13:00:35 +03:00
Jack c4da2f0193 docs(guide/directive): remove confusing best practice
Prior to this point, the docs do not mention returning a postLink function, and all the examples use
the definition object form. So, this message is confusing to new readers who may misinterpret
"returning a function" as returning the factory function mentioned in the previous section.

Since this page is only a "gentle introduction" to directives, and using the definition object is a
best practice, it is best to just remove the message altogether.

Closes #14871
2016-07-06 12:06:36 +03:00
Georgios Kalpakas b928043c3b docs(tutorial): fix typo in images (phoneList --> phoneDetail)
Fixes #14858

Closes #14868
2016-07-05 21:49:18 +03:00
Georgios Kalpakas a2c1675ff9 docs(guide/interpolation): add known issue (do not change the content of interpolated strings)
Closes #12813

Closes #14825
2016-07-05 00:08:56 +03:00
Peter Bacon Darwin 951acb1287 chore(package.json): update dgeni-packages dependency to 0.14.0 2016-07-04 21:31:07 +01:00
Igor Zhukov 6280ec89e3 fix(copy): fix handling of typed subarrays
Previously, it would return a copy of the whole original typed array, not its slice.
Now, the `byteOffset` and `length` are also preserved.

Fixes #14842

Closes #14845
2016-07-04 23:21:22 +03:00
franciscovelez 6a219ad8db docs(guide/Expressions): link to English MDN
It is better to link to the English version of MDN rather than German version

PR (#14863)
2016-07-04 15:36:41 +02:00
Georgios Kalpakas 14519f84f5 docs(copy): mention ignoring non-enumerable properties
This also improves the example a bit:
- better code formatting
- initialization of `form` to an empty object
- avoid using `email`, which doesn't get coppied when invalid (and might confuse users)

Fixes #14853
2016-07-04 10:08:44 +03:00
David Rodenas Pico 3aedb1a70d perf($compile): wrap try/catch of collect comment directives into a function to avoid V8 deopt
Closes #14848
2016-07-04 08:55:00 +03:00
jfisher446 dcf8aab85d docs(tutorial/step_04): fix syntactic error (add missing 'a')
Closes #14860
2016-07-04 08:41:07 +03:00
Peter Bacon Darwin 7b50f498eb chore(benchpress): add benchmarks for select with ngValue 2016-07-01 13:00:56 +02:00
Martin Staffa ba36bde673 perf(select): don't prepend unknown option if already prepended 2016-07-01 13:00:56 +02:00
Martin Staffa 47c15fbcc1 fix(select): handle model updates when options are manipulated
These rules follow ngOptions behavior:

- when an option that is currently selected, is removed or its value changes, the model
is set to null.
- when an an option is added or its value changes to match the currently selected model,
this option is selected.
- when an option is disabled, the model is set to null.
- when the model value changes to a value that matches a disabled option,
this option is selected (analogue to ngOptions)
2016-07-01 13:00:56 +02:00
Martin Staffa f02b707b5e feat(select): support values of any type added with ngValue
select elements with ngModel will now set ngModel to option values added by ngValue.
This allows setting values of any type (not only strings) without the use of ngOptions.

Interpolations inside attributes can only be strings, but the ngValue directive uses attrs.$set,
which does not have any type restriction. Any $observe on the value attribute will therefore receive
the original value (result of ngValue expression). However, when a user selects an option, the browser
sets the select value to the actual option's value attribute, which is still always a string.
For that reason, when options are added by ngValue, we set the hashed value of the original value in
the value attribute and store the actual value in an extra map. When the select value changes, we
read access the actual value via the hashed select value.

Since we only use a hashed value for ngValue, we will have extra checks for the hashed values:
- when options are read, for both single and multiple select
- when options are written, for multiple select

I don't expect this to have a performance impact, but it should be kept in mind.

Closes #9842
Closes #6297

BREAKING CHANGE:

`<option>` elements added to `<select ng-model>` via `ngValue` now add their values in hash form, i.e.
`<option ng-value="myString">` becomes `<option ng-value="myString" value="string:myString">`.

This is done to support binding options with values of any type to selects.

This should rarely affect applications, as the values of options are usually not relevant to the
application logic, but it's possible that option values are checked in tests.
2016-07-01 13:00:56 +02:00
mmuppa 47fbbabe0b docs(misc/Develop): using https:// works more widely than git@
Closes #14838
2016-07-01 11:17:50 +01:00
Peter Bacon Darwin 20051e5c59 docs(guide): tweaks to the index and external resources guides
Closes #14843
2016-07-01 11:06:18 +01:00
Martin Staffa 708e3d97f3 docs(guide): create new page for external resources
The official and external resources  have been split into two different guide sections. Official stays at the index, external gets its own page.

The external resources have also been reorganized and updated, but
I haven't checked if all material is still relevant.
2016-07-01 09:24:59 +01:00
Jeff Andrews f7405e3b98 fix(ngMocks): allow ErrorAddingDeclarationLocationStack to be recognized as an Error
Change `ErrorAddingDeclarationLocationStack`'s prototype so test frameworks (such as Jasmine 2.x)
are able to recognize it as `Error`.

Fixes #13821

Closes #14344
2016-06-29 13:41:57 +03:00
Martin Staffa 7ce7e09c51 test(input): ensure Date objects work for min/max in date input types
Tests that
- interpolated Date objects work for min/max
- Date objects work for ng-min/ng-max
2016-06-28 11:10:18 +02:00
Martin Staffa fa80a61a05 fix(ngBind): use same string representation as $interpolate
Fixes #11716

BREAKING CHANGE:

`ngBind` now uses the same logic as $interpolate (i.e. {{myString}}) when
binding, which means values other than strings are now transformed as following:
- null / undefined become empty string
- with an object's custom toString() function, except if the object is a Date, Array, or Number
- otherwise with JSON.stringify

Previously, ngBind would use always use toString().

The following examples show the different output:
```js
$scope.myPlainObject = {a: 1, b: 2};
$scope.myCustomObject = {a: 1, b: 2, toString: function() {return 'a+b';}};
```

Plain Object:
```html
<!-- Before: -->
<span ng-bind="myPlainObject">[object Object]</span>

<!-- After: -->
<span ng-bind="myPlainObject">{"a":1,"b":2}</span>
```

Object with custom toString():

```html
<!-- Before: -->
<span ng-bind="myCustomObject">[object Object]</span>

<!-- After: -->
<span ng-bind="myCustomObject">a+b</span>
```

If you want the output of `toString()`, you can use it directly on the value in ngBind:

```html
<span ng-bind="myObject.toString()">[object Object]</span>
```
2016-06-28 11:10:17 +02:00
Martin Staffa a5fd2e4c03 feat($interpolate): use custom toString() function if present
Except on Numbers, Dates and Arrays.

Thanks to @danielkrainas for the initial implementation of this feature.

This behavior is consistent with implementations found in other languages such as Ruby, Python,
and CoffeeScript.
http://rubymonk.com/learning/books/1-ruby-primer/chapters/5-strings/lessons/31-string-basics
https://docs.python.org/2/library/stdtypes.html#string-formatting-operations
http://coffeescriptcookbook.com/chapters/strings/interpolation

The commit also exposes a private $$stringify method on the angular global, so that ngMessageFormat
can use the same logic without duplicating it.

Fixes #7317
Closes #8350
Fixes #11406

BREAKING CHANGE:

When converting values to strings, interpolation now uses a custom toString() function on objects
that are not Number, Array or Date (custom means that the `toString` function is not the same as
`Object.prototype.toString`). Otherwise, interpolation uses JSON.stringify() as usual.

Should you have a custom toString() function but still want the output of JSON.stringify(),
migrate as shown in the following examples:

Before:

```html
<span>{{myObject}}</span>
```

After - use the `json` filter to stringify the object:

```html
<span>{{myObject | json}}</span>
```
2016-06-28 11:08:47 +02:00
atenhar 3cda897283 docs(tutorial/step_03): fix grammar and typos
Closes #14834
2016-06-28 09:38:35 +03:00
Nicholas Serra 2456ab63a6 fix($resource): add semicolon to whitelist of delimiters to unencode in URL params
The unencoding happens in methods `encodeUriQuery`/`encodeUriSegment`. Both core and `ngResource`
used to have identical implementations of these methods. Due to this duplication, the
implementations got out-of-sync.

Specifically, the semicolon has been added to the whitelist of unencoded characters in core since
`v1.3.0-beta.18`. See 3625803 for more info.

This commit fixes the problem and the underlying cause by reusing core's methods in `ngResource`.
(The methods are exposed as private helpers on `window.angular`.)

Closes #14309
2016-06-27 17:42:42 +03:00
Georgios Kalpakas 7a191eb400 fix($jsonpCallbacks): do not overwrite callbacks added by other apps
Closes #14824
2016-06-27 14:46:17 +03:00
Georgios Kalpakas c855c3fb9f fix($injector): fix class detection RegExp
Mentioned in https://github.com/angular/angular.js/pull/14531#discussion_r61410683.

Closes #14533
2016-06-27 13:28:32 +03:00
Georgios Kalpakas f6c3b35745 test($resource): make test for function as param more explicit
Related to aa8d783.

Closes #14820
2016-06-27 11:50:59 +03:00
Georgios Kalpakas 6050f0be30 fix($animate): do not get affected by custom, enumerable properties on Object.prototype
Fixes #14804

Closes #14830
2016-06-27 11:44:37 +03:00
Liran Tal 56a9eab849 docs(guide/filter): add link to list of built-in filters
Closes #14828
2016-06-26 20:26:43 +03:00
Deplay 2e0e77ee80 refactor(jqLite): remove unused code in jqLiteBuildFragment()
Closes #14822
2016-06-25 22:08:05 +03:00
GARCIA Guillaume fb3bbc9a00 docs(*): correct bower version separator (@ --> #)
Closes #14819
2016-06-25 21:54:34 +03:00
Martin Staffa c434bde109 docs(ngReadonly): note input type restrictions
Closes #14816
2016-06-23 12:00:54 +02:00
Chirayu Krishnappa aa8d783cff feat($resource): pass the resource to a dynamic param functions
Closes #4899
2016-06-22 12:11:14 +01:00
Martin Staffa 22ec93be8f fix(ngAnimate): allow removal of class that is scheduled to be added with requestAnimationFrame
Also affects the reverse case, adding a class that is scheduled to be removed with rAF.

The following case can happen when ngClass updates an element's classes in very quick order in the following way:

- First animation adds class "a"
- A digest passes, but "a" is not yet added to the element
- Second animation adds class "b"
- No digest passes, and "a" is still not added to the element,
  because requestAnimationFrame hasn't been flushed yet
- Third animation removes class "a"
- the third animation gets merged into the second animation

Before this change:

- Because the element doesn't have class "a" yet, ngAnimate
resolves that it cannot remove class "a". However,
the first animation is still running, and finally adds "a"

After this change:

- ngAnimate reacts to the temporary class "add-a", which indicates
that "a" is about to be added and decides that "a" can be removed
after all.

This is a very rare case where setting the element's class
is not fast enough, and subsequent animations operate on incorrect assumptions.

"In the wild", this is caused by rapidly updating ngClass,
which uses inidvidual addClass and removeClass calls when both operations happen in a single digest.

Fixes #14582
PR  (#14760)
2016-06-22 12:35:24 +02:00
Peter Bacon Darwin 99223a0278 docs($http): fix a dangling link 2016-06-22 11:18:35 +01:00
Peter Bacon Darwin b94626cb9b docs($compile): reorganize the life-cycle hooks docs
Closes #14811
2016-06-22 11:18:35 +01:00
Peter Bacon Darwin e62e59f281 docs($compile): add additional runnable examples for the $doCheck hook
Closes #14811
2016-06-22 11:18:28 +01:00
Peter Bacon Darwin 4c662e17a1 fix($compile): ensure $doCheck hooks can be defined in the controller constructor
Closes #14811
2016-06-22 11:18:16 +01:00
Zach Bjornson e235f20cc1 feat($compile): backport $doCheck
Backuport ngDoCheck from Angular 2.

Closes #14656
2016-06-22 11:17:48 +01:00
Peter Bacon Darwin 78e1ba1ef9 refact($http): use the $jsonpCallbacks service
Use the built-in service to handling callbacks to `$http.jsonp` requests.

Closes #3073
Closes #14795
2016-06-21 19:06:15 +01:00
Peter Bacon Darwin 83b5ddb941 feat($jsonpCallbacks): new service to abstract how JSONP callbacks are handled
You can now override this service if you have specific requirements about
the behaviour and formatting of the JSON_CALLBACK that is sent to the server
for `$http.jsonp` requests.

Closes #14795
2016-06-21 19:06:15 +01:00
Georgios Kalpakas d406a15e8c fix(modules): allow modules to be loaded in any order when using angular-loader
Some modules used to assume that the angular helpers would always be available when their script was
executed. This could be a problem when using `angular-loader` and the module file happened to get
loaded before the core `angular.js` file.
This commit fixes the issue by delaying the access to angular helpers, until they are guaranteed to
be available.

Affected modules:
- `ngAnimate`
- `ngMessageFormat`
- `ngMessages`
- `ngRoute`
- `ngSanitize`

Fixes #9140

Closes #14794
2016-06-17 23:56:14 +03:00
Georgios Kalpakas 4585b939ea docs(misc/downloading): mention ngMessageFormat 2016-06-17 20:44:12 +03:00
Peter Bacon Darwin 41f3269bfb fix(ngTransclude): ensure that fallback content is compiled and linked correctly
Closes #14787
2016-06-17 10:26:16 +01:00
Yihang Ho 0ba14e1853 feat($q): implement $q.race
Implement $q.race. $q.race takes in an array or hash of promises and
returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.

Closes #12929
Closes #14757
2016-06-17 10:20:44 +01:00
Abdulkader d9b42ddbbd feat($swipe): add pointer support
Add pointer events to $swipe to support IE11 on touch devices

Closes #14061
Closes #14791
2016-06-17 09:51:09 +01:00
Georgios Kalpakas 7ab00f4c62 docs($resource): clarify how a @-prefix param is used 2016-06-17 00:44:11 +03:00
Georgios Kalpakas 02aef572a5 docs(angular.mock.dump): remove incorrect statement
Fixes #14790
2016-06-17 00:25:50 +03:00
Roman Rodych 56b9b209ca refactor(input[number]): remove redandant second argument to parseFloat()
Closes #14793
2016-06-16 22:15:33 +03:00
Iain Apreotesei ab526d5a52 style(indexPage.template.html): change bad punctuation in documentation footer
PR  (#14792)
2016-06-16 16:52:54 +02:00
Martin Staffa fd6dc0b7d4 chore(changelog.js): don't add empty breaking change section 2016-06-16 14:38:27 +02:00
Georgios Kalpakas 2b182eb020 feat(filterFilter): allow overwriting the special $ property name
Previously, the special property name that would match against any
property was hard-coded to `$`.
With this commit, the user can specify an arbitrary property name,
by passing a 4th argument to `filterFilter()`. E.g.:

```js
var items = [{foo: 'bar'}, {baz: 'qux'}];
var expr  =  {'%': 'bar'};

console.log(filterFilter(items, expr, null, '%'));   // [{foo: 'bar'}]
```

Fixes #13313
PR (#13356)
2016-06-16 14:09:49 +02:00
Georgios Kalpakas ff5f645b00 docs($interpolate): fix heading 2016-06-15 21:43:38 +03:00
Martin Staffa 6bc81ae6ef fix(ngOptions): don't duplicate groups with falsy values
Previously, ngOptions would fail to remove optgroups with falsy values when the options were changed / removed.

Related #14781 
PR (#14784)
2016-06-15 19:39:16 +02:00
Georgios Kalpakas bb4cd4a5ce docs(CHANGELOG.md): move entry from "Features" to "Bugs" 2016-06-15 20:06:03 +03:00
Georgios Kalpakas 458ac0b44c docs(CHANGELOG.md): add release notes for v1.5.7 2016-06-15 19:14:27 +03:00
Georgios Kalpakas d16b60e0d3 docs(CHANGELOG.md): add release notes for v1.4.12 2016-06-15 19:14:16 +03:00
Martin Staffa 40b657b619 docs(guide/filters): clarify when filters are executed
Closes #14590
PR  (#14758)
2016-06-15 16:55:22 +02:00
Martin Staffa 356e6b18d6 docs($compile): add link to transcludeFn description
Closes #14764
2016-06-15 15:39:35 +02:00
Martin Staffa 915e7a109c chore(version-info): make online build compatible with Windows
Since we cannot write to dev/null on Windows, don't write to a file at all, but simply use stdout and extract the output from --write-out from the process response. Credit to @petebacondarwin for the idea.

The commit also avoids a premature error when no cdnVersion could be found online, and improves the log wrt the origin of the versions.

PR (#14780)
2016-06-15 15:12:30 +02:00
Daniel Herman 2adaff083f fix(ngTransclude): only compile fallback content if necessary
If the instance of the directive does provide transcluded content, then the fallback
content should not be compiled and linked as it will never be used.

If the instance of the directive does not provide transcluded content, then the
transcluded scope that was created for this non-existent content is never used,
so it should be destroy in order to clean up unwanted memory use and digests.

Fixes #14768
Fixes #14765
Closes #14775
2016-06-15 12:20:18 +01:00
Peter Bacon Darwin 857d78d17d chore(version-info): add offline-build support
Previously it was slow and problematic to run builds if you were not connected
to the internet because the build scripts make requests to github and the
Google CDN to find out version information.

You can now disable these requests by setting the NG1_BUILD_NO_REMOTE_VERSION_REQUESTS
environment variable to a non-empty value

Closes #14769
2016-06-15 10:30:52 +01:00
Peter Bacon Darwin 16d915c045 chore(app.scenario): test docs app against production libraries
We have had issues where the docs application has gone down because
our build included invalid URLs to the production angular libraries.

This change runs a subset of the docs e2e tests directly against these
production libraries to ensure that they are accessible. If not then these
tests will fail and the CI build will abort, preventing the docs app from
being updated.

Closes #14769
2016-06-15 10:30:52 +01:00
Peter Bacon Darwin 29f19f91fb chore(Gruntfile): kill the build if the CDN version was not found
Closes #14769
2016-06-15 10:30:52 +01:00
Martin Staffa 02eaabc1c7 docs(changelog.md): add 1.5.0-beta.0 entry
This was a preparation release for the 1.5.x branch,
which only contains one fix over the previous 1.4.6
release.
2016-06-15 11:18:14 +02:00
Peter Bacon Darwin 8cd984866b docs(ngMessageFormat): fix e2e test in example 2016-06-14 19:19:31 +01:00
Peter Bacon Darwin b7f786e8a2 style(ngMessageFormat): fix jscs whitespace error 2016-06-14 18:51:36 +01:00
Martin Staffa 9575667946 chore(docsApp): don't display module components if none exist
Some modules (ngMessageFormat, ngParseExt) don't have their own api surface
because they integrate with core services ($interpolate and $parse respectively).

Closes #14770
2016-06-14 18:32:48 +01:00
Martin Staffa 9a7431c71b docs(ngMessageFormat): move docs for $$messageFormat to module namespace.
This is a private service that should not be documented.
The docs have been moved to the ngMessageFormat module namespace.

Closes #14770
2016-06-14 18:32:36 +01:00
Martin Staffa a82a62e5a6 docs(ngMessageFormat): add more examples
Closes #14770
2016-06-14 18:32:25 +01:00
Georgios Kalpakas 9686f3a241 revert: "chore(version-info): disable remote requests when offline"
This reverts commit 6a134605f1.
The connectivity status is not always detected correctly. Skipping version info related tasks, broke
the deployment of the API docs.

Related #https://github.com/angular/angularjs.org/issues/202
2016-06-13 20:44:51 +03:00
Wesley Cho 4d350de038 docs($q): add note about optional arguments for promise.then()
- Add note about optional arguments in the promise.then api

Closes #8562
PR (#14754)
2016-06-13 17:19:39 +02:00
Wesley Cho 116e1d7d17 docs(guide): add notes about using ngAttr for IE
- Add note about using the value attribute for the progress tag with IE in the IE compat / interpolation guide
- Add note about placeholder attribute in textarea to the ie compat guide

Closes #7218
PR (#14753)
2016-06-13 17:18:35 +02:00
Pete Bacon Darwin 6a134605f1 chore(version-info): disable remote requests when offline
When the internet is not accessible build scripts are unnecessarily slow
because of failed attempts to download git tag and CDN version information
from remote servers.

This commit does a synchronous check of internet connectivity before attempting
any remote requests.

Closes #14759
2016-06-13 15:57:53 +01:00
Geoffrey Bauduin 3ddf2f6f6f docs($exceptionHandler): add missing end bracket in example
PR  (#14756)
2016-06-13 11:37:47 +02:00
Wesley Cho 9f68b0e29d docs(ngOpen): add note about browser compatibility
- Add note about browser compatibility and recommend ng-show/ng-hide

Closes ##7337
PR (#14752)
2016-06-13 11:21:03 +02:00
Peter Bacon Darwin 7551b8975a fix(ngMock/$httpBackend): fail if a url is provided but is undefined
While the `url` parameter is optional for `$httpBackend.when`,
`$httpBackend.expect` and related shortcut methods, it should not have the
value of `undefined` if it has been provided.

This change ensures that an error is thrown in those cases.

Closes #8442
Closes #8462
Closes #10934
Closes #12777

BREAKING CHANGE

It is no longer valid to explicitly pass `undefined` as the `url` argument
to any of the `$httpBackend.when...()` and `$httpBackend.expect...()`
methods.

While this argument is optional, it must have a defined value if it is
provided.

Previously passing an explicit `undefined` value was ignored but this
lead to invalid tests passing unexpectedly.
2016-06-12 20:23:38 +01:00
Wesley Cho f467dc3dd5 feat(limitTo): add support for array-like objects
Fixes #14657

Closes #14694
2016-06-10 21:13:04 +03:00
Martin Staffa 3360b44be6 fix(ngMessages): create new scope for ngMessage, clean it up correctly
Previously, ngMessage elements used the same scope as ngMessages. When ngMessage
has interpolation in the textContent, then removing the message would not remove
the watcher from the scope - it would only be removed when the whole ngMessages
element was removed.

This commit changes the ngMessage transclude function to create a new child scope
instead, which can be destroyed safely when the message element is removed and
the message is detached

Fixes #14307
PR (#14308)
2016-06-10 14:45:36 +02:00
Georgios Kalpakas e9865654b3 feat($route): implement resolveRedirectTo
`resolveRedirectTo` can be set to a function that will (eventually) return the new URL to redirect
to. The function supports dependency injection and should return the new URL either as a string or
as a promise that will be resolved to a string.

If the `resolveRedirectTo` function returns `undefined` or returns a promise that gets resolved to
`undefined`, no redirection will take place and the current route will be processed normally.

If the `resolveRedirectTo` function throws an error or the returned promise gets rejected, no
further processing will take place (e.g. no template fetched, no `resolve` functions run, no
controller instantiated) and a `$routeChangeError` will be broadcasted.

`redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route
definition, will cause the latter to be ignored.

Fixes #5150

Closes #14695

BREAKING CHANGE:

Previously, if `redirectTo` was a function that threw an Error, execution was aborted without firing
a `$routeChangeError` event.
Now, if a `redirectTo` function throws an Error, a `$routeChangeError` event will be fired.
2016-06-10 15:10:50 +03:00
CarlosMiguelDesarrollo a84e3e7270 chore(ngAnimate): delete an unused conditional statement
Delete a conditional statement that appears to have only been for debugging.
It is marked with a TODO tag to be deleted.

Closes #14282
2016-06-10 12:27:07 +01:00
Georgios Kalpakas 53ab8bcde1 fix($routeProvider): do not deep-copy route definition objects
Deep-copying route definition objects can break specific custom implementations of `$sce` (used to
trust a `templateUrl` as RESOURCE_URL). The purpose of copying route definition objects was to guard
against the user's modifying the route definition object after route registration, while still
capturing inherited properties.
As suggested by @IgorMinar in https://github.com/angular/angular.js/pull/14699#discussion_r66480539,
we can achieve both _and_ support custom `$sce` implementations, by shallow-copying instead.

This is an alternative implementation for #14699, which avoids the breaking change.

Fixes #14478
Closes #14699

Closes #14750
2016-06-10 14:02:59 +03:00
Raphael Jamet 04cad41d26 fix($compile): secure link[href] as a RESOURCE_URLs in $sce.
User-controlled imports or stylesheets can run script in your origin,
which warrants that we require that they are safe `RESOURCE_URL`s.

Closes #14687

BREAKING CHANGE

`link[href]` attributes are now protected via `$sce`, which prevents interpolated
values that fail the `RESOURCE_URL` context tests from being used in interpolation.

For example if the application is running at `https://docs.angularjs.org` then the
following will fail:

```
<link href="{{ 'http://mydomain.org/unsafe.css' }}" rel="stylesheet">
```

By default, `RESOURCE_URL` safe URLs are only allowed from the same domain and protocol
as the application document.

To use URLs from other domains and/or protocols, you may either whitelist them or
wrap it into a trusted value by calling `$sce.trustAsResourceUrl(url)`.
2016-06-10 11:14:14 +01:00
Martin Staffa 3b4bfa1771 refactor(ngMock): extract browserTrigger from ngScenario
`ngScenario` is deprecated, and we expect to remove it from the project in 1.6,
but we use the `browserTrigger` helper throughout our unit tests.

So in preparation for removing `ngScenario` we are relocating `browserTrigger`
to the `ngMock` folder.

Although many people are using browserTrigger in their own application testing
we are still not yet ready to make this a public API; so developers use
this helper at their own risk.

Closes #14718

BREAKING CHANGE

Although it is not a public API, many developers are using `browserTrigger`
in their own application testing. We have now moved this helper from
`ngScenario/browserTrigger.js` to `ngMock/browserTrigger.js`.
2016-06-10 10:52:37 +01:00
mirabilos f3f5cf72ee fix(input[email]): improve email address validation
**Limit size of local-part and total path size in eMail addresses**

RFC 5321 §4.5.3.1.1 ⇒ local-part can have up to 64 octets
RFC 5321 §4.5.3.1.3 ⇒ path “including the punctuation and
element separators” can have up to 256 octets
RFC 5321 §4.1.2 specifies path as ‘<’ + mailbox¹ + ‘>’ in
the best case, leaving us 254 octets

The limitation of the total path size to 254 octets leaves
at most 252 octets (one local-part, one ‘@’) for the domain,
which means we don’t need to explicitly check the domain
size any more (removing the assertion after the ‘@’).

① RFC 821/5321 “mailbox” is the same as RFC 822 “addr-spec”

**Optimise eMail address regex for speed**

There is no need to make it case-insensitive; the local-part
already catches the entire range, and the host part is easily
done. Furthermore, this makes the regex locale-independent,
avoiding issues with e.g. turkish case conversions.

cf. http://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/mailfrom.php?rev=HEAD

**Limit eMail address total host part length**

RFC 1035 §2.3.4 imposes a maximum length for any DNS object;
RFC 5321 §2.3.5 references this (and requires FQDNs, but there
have been cases where a TLD had an MX RR and thus eMail addresses
like “localpart@tld” are valid).

Credits: Natureshadow <d.george@tarent.de>

**Limit eMail address individual host part length**

A “label” (each of the things between the dots (‘.’) after the ‘@’ in
the eMail address) MUST NOT be longer than 63 characters.

cf. http://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/mailfrom.php?rev=HEAD
and RFC 1035 §2.3.4

**Fix eMail address local-part validation**

A period (‘.’) may not begin or end a local-part

cf. http://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/mailfrom.php?rev=HEAD
and RFC 822 / 5321

Closes #14719
2016-06-10 10:45:54 +01:00
Georgios Kalpakas 2274dc7bb7 docs(misc/downloading): update content - include missing modules
Closes #14746
2016-06-10 10:41:09 +01:00
Martin Staffa f82e135aa0 refactor(ngList): access ngList attribute directly
The original way is not necessary since $compile doesn't remove
white-space anymore
2016-06-09 22:59:59 +02:00
Lucas Galfaso 47724baffe feat(input[radio]): allow ng-trim to work for input[type=radio]
Allow input[type=radio] elements to specify ng-trim.

Closes: #12091
Fixes: #11859
2016-06-09 22:59:58 +02:00
Martin Staffa 305ba1a3fb fix($compile): don't add leading white-space in attributes for a specific merge case
If the replaced element had an attribute with an empty ("") value, merging the attribute from
the template would result in a leading white-space.
2016-06-09 22:59:56 +02:00
Siddique Hameed 97bbf86a19 fix($compile): don't trim white-space in attributes
This allows developers to use white-space in their attributes, for example as value for
input[type=radio], as a separator in ngList, or as a value in any custom directive binding.
It's also consistent with the HTML spec, which allows white-space in attributes, and consistent
with Angular2, which also allows white-space in attributes.

Fixes #5513
Fixes #14539
Closes #5597

BREAKING CHANGE:

White-space in attributes is no longer trimmed automatically. This includes leading and trailing
white-space, and attributes that are purely white-space.

To migrate, attributes that require trimming must now be trimmed manually.

A common cases where stray white-space can cause problems is when
attribute values are compared, for example in an $observer:

Before:
```
$attrs.$observe('myAttr', function(newVal) {
  if (newVal === 'false') ...
});
```

To migrate, the attribute value should be trimmed manually:
```
$attrs.$observe('myAttr', function(newVal) {
  if (newVal.trim() === 'false') ...
});
```

Note that `$parse` trims expressions automatically, so attributes with expressions (e.g. directive
bindings) are unlikely to be affected by stray white-space.
2016-06-09 22:56:31 +02:00
Martin Staffa 3ba29c464d fix($compile): don't add merged attributes twice to $attrs
In replace directives, attribute values from the template are added twice
to the replaced element when both the replaced element and the template
element have the attribute. This does not affect the DOM, as it normalizes
duplicate values. The values are however duplicated in the $attrs object
that is available to directive link functions.

Fixes #8159
Closes #14737
2016-06-09 16:19:34 +01:00
J. Roberto Vidal 78a23ccea2 docs($resource): document Resource#toJSON
Document the `toJSON` method of `Resource` instances as part of its public API.

See #14637
Closes #14725
2016-06-09 16:00:41 +01:00
Stepan Suvorov 186bd0df0e docs(misc/downloading): update Angular version in example
Closes #14741
2016-06-09 11:06:11 +03:00
Stepan Suvorov 38242e99f1 updated version of angular for script src 2016-06-09 11:05:34 +03:00
Georgios Kalpakas f3377da6a7 feat(ngMessagesInclude): don't break on empty (or whitespace-only) templates
Fixes #12941

Closes #14726
2016-06-07 23:14:51 +03:00
Georgios Kalpakas 8fcf5f9aa1 style(ngMessages): fix indentation 2016-06-07 23:14:51 +03:00
mirabilos 4969548e1d docs(guide/Security): warn about $http.jsonp()
Warn users about security issues with JSONP that are *not* mitigated by AngularJS

Closes #14727
2016-06-07 18:34:11 +01:00
Stephen Fluin 418fb9ccd1 docs(guide/Component Router): improving comms 2016-06-07 16:31:55 +01:00
Martin Staffa 2f618459b2 docs(changelog, guide/migration): mention rare BC for ngInclude
See https://github.com/angular/angular.js/issues/13555#issuecomment-165118890
for detailed explanation.

Closes #13555
2016-06-07 10:43:21 +02:00
Georgios Kalpakas 297a7914ab style(ngMocks): remove unnecessary jsHint comment 2016-06-07 11:17:20 +03:00
Georgios Kalpakas 96266b9d9e fix(ngMock#$controller): properly assign bindings to all types of controllers (e.g. class-based)
The decorated version of `$controller` is able to assign bindings to a controller instance prior to
instantiation, emulating the behavior of `$compile` with directive controllers.

There are cases, that the actual controller instance is different than the pre-populated one (e.g.
when the controller constructor function returns a value or when the controller is an ES2015 Class).
While `$compile` accounts for such situation, by re-asigning the bindings after the controller has
been instantiated, `ngMock`'s `$controller` didn't.

This commit fixes it, by re-applying the bindings if the actual controller instance is different
than the original one (similar to how `$compile` would do it).

Fixes #14437

Closes #14439
2016-06-07 11:03:58 +03:00
Georgios Kalpakas 48c8b230cb feat(orderBy): add support for custom comparators
Add an optional, 4th argument (`comparator`) for specifying a custom comparator function, used to
compare the values returned by the predicates. Omitting the argument, falls back to the default,
built-in comparator. The 3rd argument (`reverse`) can still be used for controlling the sorting
order (i.e. ascending/descending).

Additionally, the documentation has been expanded to cover the algorithm used by the built-in
comparator and a few more unit and e2e tests (unrelated to the change) have been added.

Helps with #12572 (maybe this is as close as we want to get).

Fixes #13238
Fixes #14455

Closes #5123
Closes #8112
Closes #10368

Closes #14468
2016-06-06 22:20:37 +03:00
Peter Bacon Darwin 743bfcfe08 test($resource): check we do not throw if response.data is the resource object
Closes #4508
2016-06-06 18:13:09 +01:00
Peter Bacon Darwin 362d11b519 fix($parse): allow arguments to contain filter chains
Thanks to @esarbanis for the original PR that got out-dated due to the
big $parse overhaul.

Closes #4175
Closes #4168
Closes #14720
2016-06-06 15:20:31 +01:00
Guillaume Salles b9ac3362ee fix($location) : initialize $$absUrl to empty string
Initialize `$$absUrl` to an empty string, in order to avoid exception, when base href
and current location have different domains.

Fixes #11091
Fixes #13565

Closes #14488
2016-06-06 15:50:05 +03:00
Peter Bacon Darwin 4ee5717a96 docs(tutorial/step-9): fix typo 2016-06-06 13:35:37 +01:00
Martin Staffa 86aff733fc docs(ngComponentRouter): add deprecation notice and better install notes
Yes, that contradicts itself.

Closes #14655
Closes #14717
2016-06-06 13:29:57 +01:00
Peter Bacon Darwin 6ec775e0cd test(browserTrigger): fix typo in eventData property 2016-06-06 13:27:43 +01:00
Peter Bacon Darwin c8bfbfc5d7 test(browserTrigger): allow event bubbling
In some browsers, events don't bubble when they are dispatched on node inside
a detached tree. When this is the case, the bubbling is made manually.
This may be convenient when unit testing directives, for example.

Closes #5178
2016-06-06 11:45:15 +01:00
Peter Bacon Darwin 3ba8bb7109 test(browserTrigger): support key events
Support for key events like keypress, keyup or keydown.

Closes #8688
2016-06-06 11:45:08 +01:00
Andrew Schmadel ff0395f111 fix(ngMockE2E): allow $httpBackend.passThrough() to work when ngMock is loaded
Allow $httpBackend.passThrough() to work normally when ngMock is loaded
concurrently with ngMockE2E, as is typically the case when writing tests with
angular.mock.module()

Fixes #1434
Closes #13124
2016-06-06 11:14:41 +01:00
Martin Staffa cd3673e514 docs(angular.element): note restrictions of addClass and removeClass
Closes #12851
Closes #12793
2016-06-03 21:50:32 +02:00
Georgios Kalpakas f82eba814b docs($exceptionHandler): include better example
The previous example overwrote the `$exceptionHandler` in order to re-throw the error. This is not
recommended, since it would leave the application in an inconsistent state and prevent proper
clean-up.
The new example simulates logging the error both to the backend and the console.

Fixes #14704
2016-06-03 20:55:27 +03:00
Georgios Kalpakas 96e34e3c44 refactor($resource): explicitly set $resourceProvider.defaults.cancellable to false
Previously, it was just `undefined` and had the same behavior (since we only check for falsy-ness).
Just making it explicit, that this property is also available on `defaults` and is "not true" by
default.

Closes #14711
2016-06-03 16:58:35 +03:00
Georgios Kalpakas 618e3f2558 docs($resourceProvider): improve wording and formatting
Closes #11910
2016-06-03 16:58:35 +03:00
Yiling Lu 140820f4c5 docs($resourceProvider): provide info and example for configuring $resourceProvider 2016-06-03 16:58:35 +03:00
Wesley Cho 146dad7365 docs($animate): detail options object
- Document options object used in various $animate methods

Fixes #12645
PR: #14700
2016-06-03 13:28:18 +02:00
Martin Staffa 8e55b784de fix(ngSanitize): call attribute setter in linky for all links
Fixes #14707 
PR: #14710
2016-06-03 13:21:38 +02:00
Martin Staffa 87eff27e97 fix(select): remove workaround for Chrome bug
In the Chrome issue (https://bugs.chromium.org/p/chromium/issues/detail?id=381459)
I noticed that the bug can't be reproduced in Chrome 45 and the issue was
closed subsequently. I've also tested again with Chrome 51 and it still works.

Additionally, the Chrome hack was kept in the select code, but wasn't ported to
the ngOptions code when the two split in 7fda214c4f,
and no regression happened.

Nevertheless, a test has been added to guard against a future regression.

Related: #6828
PR: #14705
2016-06-03 13:21:05 +02:00
ZachLamb a478f69783 docs(tutorial/step_04): fix type (JacaScript --> JavaScript)
Closes #14661
2016-06-01 11:07:30 +03:00
Lucas Mirelmann cfc8b41771 refactor($location): Simplify expression. 2016-05-28 14:57:43 +02:00
Peter Bacon Darwin f58d4fb748 docs(CHANGELOG): fix typo 2016-05-27 22:34:36 +01:00
Martin Staffa 794e99e69f docs(changelog): update with changes for 1.5.6 2016-05-27 17:59:59 +02:00
Lucas Galfasó d23c1453cd fix($timeout): make $flush handle new $timeouts added in $timeout callbacks
If a $timeout handler calls $timeout itself, this new $timeout should be
added to the mock deferred queue with a "now" time based on when the original
handler was triggered.

Previously it was being added with a now time of when the `$timeout.flush`
method was originally called.

Closes #5420
Closes #14686
2016-05-27 16:17:10 +01:00
Peter Bacon Darwin de544807c2 fix($compile): cope with $onChanges hooks throwing
Previously, if one of these hooks threw an error, then the compilation
was terminated unceremoniously. In particular any other `$onChanges`
hooks that had been scheduled were not executed, nor was the queue cleaned
up properly.

Closes #14444
Closes #14463
2016-05-27 16:12:03 +01:00
Martin Staffa 55b7f7d80e docs(changelog): update with changes for 1.4.11 2016-05-27 12:42:04 +02:00
Victor Oliveira da Silva 85db30a3be docs(ngRepeat): fix typo
Closes #14681
2016-05-26 21:55:33 +03:00
Georgii Dolzhykov 5e7c4abb18 chore(package.json): remove unused grunt-jasmine-node
Closes #14363
2016-05-26 00:55:56 +03:00
Martin Staffa 4a5723f83b chore(angularFiles): add missing files
ngMessageFormat test files were missing from angularTest
ngMessages and ngAnimate were missing from karmaModules.

This change highlighted a number of problems in the tests and code,
which are now fixed.

Closes #14314
Closes #14669
2016-05-25 17:38:28 +01:00
Peter Bacon Darwin bf59aa5564 docs(tutorial/step-9): fix typo in inline link 2016-05-25 16:59:46 +01:00
Hadrien Tulipe 7875652298 docs(ngAnimateMock): document how to require mocked service in tests
Closes #14668
Closes #14670
2016-05-25 16:56:21 +01:00
Robin Böhm 4d5f5ffc78 refactor(ngMock): use exactly equal in browserTrigger
Closes #6763
2016-05-25 15:32:26 +02:00
David Goldberg 36b149332a style(src/Angular.js): make comment formatting consistent
Corrected formatting errors on lines 258, 695, 696, 1096, 1219, 1451, and 1536
by adding periods at the end of single line comments that were missing them
in order to be consistent with the formatting found in the file.

Capitalized the first letter in the first word of the comments on lines 695, 696, 1096,
to be consistent with the formatting of the rest of the file.

Added a space after the // in the comment on line 1536 to be
consistent with the formatting of the file.

Closes #11832
2016-05-25 15:17:40 +02:00
Martin Staffa d803354d7c docs(angular.element): note restriction in toggleClass 2016-05-25 14:58:05 +02:00
Kamron Batman 6ce34dd45c style(docs/gulpfile.js) make spacing consistent
Updated gulpfile.js in Docs so that spacing is consistency.
2016-05-25 14:53:45 +02:00
thorn0 cb2f8c0d75 perf($rootScope): make queues more efficient
By using a pointer to the current start of the queue and only clearing
up the queue storage later, we save lots of time that was spent manipulating
arrays with `slice`

Closes #14545
2016-05-25 13:21:49 +01:00
Ajay 9e28b64352 docs($provide): document decorator method
Closes #14562
2016-05-25 12:56:33 +01:00
Peter Briers 74eb569238 docs(ngAnimate): remove unnecessary transition prefixes
We can remove the vendor-prefixing from our docs, since all major browsers
support these properties, without prefixes.

Closes #14586
2016-05-25 12:38:19 +01:00
Jacob Reid 66af3d5729 docs(tutorial): fix typos
Closes #14662
Closes #14663
Closes #14664
2016-05-25 12:17:41 +01:00
Peter Bacon Darwin a4e4feed90 refactor(*): faster check for a string starting with a substring
Thanks to @spamdaemon for the original PR to make this improvement.

In naive tests on Chrome I got the following results:

```
             Matches   Misses
indexOf      33ms      1494ms
lastIndexOf  11ms      11ms
```

Closes #3711
2016-05-24 19:09:23 +01:00
Jeff Ardilio 7f4b356c2b fix($route): don't process route change controllers and templates for redirectTo routes
If a route defines a `redirectTo` value, the current route should stop processing the route
and instead wait to process the route of the redirect.

Currently, what is happening is that Angular detects a redirectTo value and updates $location,
but then continues processing the route that was intended to be redirected.
Templates are loaded, resolves are processed, ng-view then updates the view with a new template
and instantiates the controller all for a route that should have been redirected.

A common use case for assigning a function to the redirectTo is to validation authentication,
permission check, or some other logic to determine if the route should continue or redirect
else where. In the end, this happens, but in between, unexpected results may occur by updating
the view and instantiating controllers for logic that wasn't expected to be executed.

http://plnkr.co/edit/8QlA0ouuePH3p35Ntmjy?p=preview

This commit checks for a url change after a potential redirect, it the url changed, and is
not `null` nor `undefined`, exit out and don't process current route change.

Closes #3332
Closes #14658

BREAKING CHANGE

The $route service no longer instantiates controllers nor calls resolves or template functions
for routes that have a `redirectTo` unless the `redirectTo` is a function that returns
`undefined`.
2016-05-24 19:01:16 +01:00
Peter Bacon Darwin 4c95ad8d89 refactor($route): consolidate route locals processing into a single handler 2016-05-24 19:01:16 +01:00
Peter Bacon Darwin c39936ee26 refactor($route): move resolving locals into its own function 2016-05-24 19:01:16 +01:00
Peter Bacon Darwin 4adc9a9117 refactor($route): move getting the template into its own function 2016-05-24 19:01:15 +01:00
Martin Staffa b226f3028e Revert: revert changes to contribute.ngdoc
Reverts d9d20e6 and febda8f which sneaked in by accident
2016-05-24 18:16:46 +02:00
Martin Staffa d0af0ca76e style(loader): make jshint happy 2016-05-24 18:12:12 +02:00
Sibu Stephen d9d20e6968 Update contribute.ngdoc
Closes #12875
2016-05-24 17:54:23 +02:00
Sibu Stephen febda8f7bf Essential note when cloning into Angular repository
1) First change - Whenever cloning into directory there are chances of some users using "sudo" without knowing what it does exactly and what's the purpose of using sudo, leading them into a confusion and this lead to changes in git config and permission issues of which users may not be able to figure out at one spot.
2)  Second Change- There are chances of version unstability  issues in node which at times causes npm error and warnings while installing packages, I too had undergone some issues with node version conflicts at times, users who are not aware of this will be benefited with a Note prior.
2016-05-24 17:54:21 +02:00
Martin Staffa 00cdc945ba docs(guide/Decorators): update info about the order of decorator application 2016-05-24 17:44:28 +02:00
Martin Staffa 01abe6ae58 test(loader): add tests for order of decorations 2016-05-24 17:44:28 +02:00
robertmirro 6a2ebdba5d fix(loader): module.decorator order of operations is now irrelevant
`module.decorator` is now processed via the configBlocks order of operations and:
  1. no longer throws error if declared before the provider being decorated.
  2. guarantees the correct provider will be decorated when multiple, same-name
  providers are defined.

(1) Prior to this fix, declaring `module.decorator` before the provider that it
decorates results in throwing an error:

```js
angular
  .module('theApp', [])
  .decorator('theFactory', moduleDecoratorFn)
  .factory('theFactory', theFactoryFn);

// Error: [$injector:modulerr] Failed to instantiate module theApp due to:
// Error: [$injector:unpr] Unknown provider: theFactoryProvider
```

The result of this fix now allows for the declaration order above.

(2) Prior to this fix, declaring `module.decorator` before the final, same-named
provider results in that provider **not** being decorated as expected:

**NOTE:** Angular does not use provider name spacing, so the final declared
provider is selected if multiple, same-named providers are declared.

```js
angular
  .module('theApp', [])
  .factory('theFactory', theFactoryFn)
  .decorator('theFactory', moduleDecoratorFn)
  .factory('theFactory', theOtherFactoryFn);
```

`theOtherFactoryFn` is selected as 'theFactory' provider, but prior to this fix it is **not**
decorated via `moduleDecoratorFn`. This fix ensures that `theOtherFactoryFn` will be decorated as
expected when using the declaration order above.

Closes #12382
Closes #14348

BREAKING CHANGE:

`module.decorator` declarations are now processed as part of the `module.config`
queue and may result in providers being decorated in a different order if
`module.config` blocks are also used to decorate providers via
`$provide.decorator`.

For example, consider the following declaration order in which 'theFactory' is
decorated by both a `module.decorator` and a `$provide.decorator`:

```js
angular
  .module('theApp', [])
  .factory('theFactory', theFactoryFn)
  .config(function($provide) {
    $provide.decorator('theFactory', provideDecoratorFn);
  })
  .decorator('theFactory', moduleDecoratorFn);
```

Prior to this fix, 'theFactory' provider would be decorated in the following
order:
  1. moduleDecoratorFn
  2. provideDecoratorFn

The result of this fix changes the order in which 'theFactory' is decorated
because now `module.decorator` declarations are processed in the same order as
`module.config` declarations:
  1. provideDecoratorFn
  2. moduleDecoratorFn
2016-05-24 17:44:28 +02:00
Georgios Kalpakas c2033d7ff0 docs(tutorial): update to use v1.5.x and best practices
This is a major re-structuring of the tutorial app's codebase, aiming at applying established best
practices (in terms of file naming/layout and code organization) and utilizing several new features
and enhancements (most notably components) introduced in recent versions of Angular (especially
v1.5).

Apart from the overall changes, two new chapters were introduced: one on components and one on code
organization.

--
In the process, several other things were (incidentally) taken care of, including:

* Dependencies were upgraded to latest versions.
* Animations were polished.
* Outdated links were updated.
* The app's base URL was changed to `/` (instead of `/app/`).

BTW, this has been tested with the following versions of Node (on Windows 10) and everything worked
fine:

* 0.11.16
* 4.2.6
* 4.4.2
* 5.10.0
* 6.2.0

--
This was inspired by (and loosely based on) #13834.
Again, mad props to @teropa for leading the way :)

--
**Note:**
The old version of the tutorial, that is compatible with Angular version 1.4 or older, has been
saved on the `pre-v1.5.0-snapshot` branch of
[angular-phonecat](https://github.com/angular/angular-phonecat). The `v1.4.x` version of the
tutorial should be pointed to that branch instead of `master`.

--
Related to angular/angular-phonecat#326.
Related to angular/angular-seed#341.

Closes #14416
2016-05-24 14:07:08 +03:00
marija 4ae4cc9d46 perf(ngClass): improve even-odd checking
This now uses the same technique as ngRepeat.
2016-05-23 23:33:04 +02:00
marija 4fed5d873c refactor($sniffer): avoid unnecessary call to substring 2016-05-23 23:33:04 +02:00
Alireza Mirian f37568499e docs(guide/Conceptual Overview): clarify service instantiation sentence
Change a sentence which describes how currencyConverter service is instantiated.

Closes #12924
2016-05-23 23:33:04 +02:00
Martin Staffa e1f4b35031 docs(input[text]): remove deprecated tt tag
Closes #14547
2016-05-23 23:33:04 +02:00
Peter Bacon Darwin ad59781f7d chore(docs): add horizontal rules between known issues 2016-05-23 22:18:02 +01:00
Peter Bacon Darwin 2ca6db5374 chore(docs): fix api.template.html to display git links 2016-05-23 21:59:53 +01:00
Xavier Haniquaut c5cdadb601 docs(error/$compile): add reqslot error description
Explains what could generate a `reqslot` error.

Closes #14618
2016-05-23 14:20:44 +01:00
Peter Bacon Darwin 3bcbd63e47 chore(docs): add horizontal rules between known issues 2016-05-23 14:02:42 +01:00
Peter Bacon Darwin c8e09c8a40 docs($interpolate): add known issue about custom interpolation symbols
Closes #14610
Closes #6493
2016-05-23 13:52:25 +01:00
Jukka ab247d6203 fix(ngMessagesInclude): do not compile template if scope is destroyed
Messages imported with `ngMessagesInclude` are loaded asynchronously and
they can arrive after the ngMessages element has already been removed from DOM.

Previously we tried to compile these messages and that caused a `$compile:ctreq`
error. Now they are silently ignored if `ngMessagesInclude`'s scope has already
been destroyed.

Closes #12695
Closes #14640
2016-05-23 12:56:56 +01:00
Wesley Cho e67c3f8ab6 docs(contributing): fix the styleguide link
Update the link to Google's JavaScript style guide to the updated version

Closes #14652
2016-05-23 12:48:56 +01:00
Georgios Kalpakas 3f8efe73fc fix($animate): don't break on anchored animations without duration
If the `from` element of an animation does not actually have an animation
then there will be no animation runner on that element. This is possible
if the element has the `ng-animate-ref` attribute but does not have any
CSS animations or transitions defined.

In this case, it is not necessary to try to update the host of the
non-existent runner.

Fixes #14641
Closes #14645
2016-05-22 19:02:26 +01:00
Bijay Deo 1581827a51 fix(ngMock): match HTTP request regardless of the order of query params
Closes #12762
2016-05-21 10:43:54 +01:00
Peter Bacon Darwin eaa1119d42 docs(toJson): documented the Safari RangeError known issue
Closes #14221
Closes #13415
2016-05-21 10:15:31 +01:00
Georgios Kalpakas efa72a8401 docs(ngMock/$exceptionHandler): fix formatting
Too much indentation, made text get formatted as code block.
2016-05-20 21:22:14 +03:00
Adrian Moos 51cfb61e46 fix($brower): set the url even if the browser transforms it
While $location expects that $browser stores the URL unchanged, "some browsers" transform the URL
when setting or defer the acutal update. To work around this, $browser.url() kept the unchanged
URL in pendingLocation.

However, it failed to update pendingLocation in all code paths, causing
$browser.url() to sometimes incorrectly report previous URLs, which horribly confused $location.

This fix ensures that pendingLocation is always updated if set, causing url() to report the
current url.

Fixes #14427
Closes #14499
2016-05-20 15:20:06 +01:00
Peter Bacon Darwin 9355aea2e2 docs(misc/contribute): specify node version 2016-05-18 16:46:04 +01:00
Peter Bacon Darwin cf862b5eb5 docs(ngMock): final installation description fix 2016-05-18 08:41:52 +01:00
Georgios Kalpakas 24705824d3 fix($compile): properly bind context to linking functions for directives with templateUrl
Also, fix some styling issues.
2016-05-17 22:17:33 +03:00
Paulo Cesar 7d0fe19734 fix($compile): always use the DDO as this in pre-/post-linking functions
Closes #9306
2016-05-17 20:43:08 +03:00
Peter Bacon Darwin 921f80e1ea docs(ngMock): fix installation instructions 2016-05-17 18:24:55 +01:00
Thomas Kowalski ce9f67b08d docs(guide/component-router): remove unused code
Closes #14613
2016-05-17 11:59:31 +03:00
Peter Bacon Darwin 05d2703b4e docs(ngMock): fix installation formatting
The `@installation` section should be formatted with markdown, not
nunjucks template directives.

Closes #14604
2016-05-16 22:46:31 +01:00
Lucas Mirelmann 3b5751dce8 fix($parse): call once stable bind-once expressions with filter
When an expression has the following:
- Bind-once
- A stateless filter at the end
- Optionally an expression interceptor

Then call the filter once.

Closes: #14583
Closes: #14589
2016-05-16 13:03:24 +02:00
Sander Boom 5d1e15cb1b docs(guide/$location): fix typo
Closes #14607
2016-05-14 01:51:15 +03:00
Mark Pieszak bfaf773ae2 docs(readme): remove "(beta)" from Angular 2 link
Closes #14599
2016-05-13 23:16:03 +03:00
Georgios Kalpakas f6d8be8ad3 docs(ngComponentRouter): specify correct version of npm package
The latest npm package does not contain the angular 1 version of the router.

Related to 824ce30.
2016-05-13 19:09:56 +03:00
Peter Bacon Darwin eebbca0a8b chore(package.json): update to use dgeni-packages@0.13.0 2016-05-12 11:04:51 +01:00
Peter Bacon Darwin 6b92ff08cd chore(npm/check-node-modules): cope with no npm-shrinkwrap file 2016-05-12 10:25:34 +01:00
Pete Bacon Darwin f1f892d6c0 fix($compile): don't run unnecessary update to one-way bindings
The watch handler was triggering on its first invocation, even though
its change had already been dealt with when setting up the binding.

Closes #14546 
Closes #14580
2016-05-10 22:30:54 +01:00
Anthony Trimble 3b714740fd docs($httpBackend): fix a typo
Fix comment typo
(#14576)
2016-05-10 03:15:35 -07:00
Peter Bacon Darwin 824ce30041 docs(guide/component-router): specify correct version of npm package
The latest npm package does not contain the angular 1 version of the router.

Closes #14564
Closes #14560
2016-05-07 21:39:14 +01:00
Maksim Ryzhikov 5b053b18d0 fix(ngAnimate): properly handle empty jqLite collections
Previously `stripCommentsFromElement()` would return an empty Array (instead of a jqLite collection)
which would cause an exception to be thrown: "element.parent not a function".
This commit fixes it, by ensuring that the returned value is always a jqLite collection.

Closes #14558

Closes #14559
2016-05-06 08:13:01 -06:00
Sreenivasan K 81bf7ed73e fix(ngAnimate) : make svg elements work with classNameFilter
(#14529)

Closes #14508
2016-05-06 07:07:01 -07:00
dmandelin d7274f066e docs($sanitizeProvider): fix param comment for enableSvg
Change the text of the doc comment for the parameter of enableSvg to match the type of the comment and the behavior of the code (#14543).
2016-05-06 06:35:28 -07:00
FGasper 0bd2efb994 docs($location): clarify return value for path method
docs for return of path() inaccurately describe the function’s return when a value is passed in.

Closes #14544
2016-05-06 06:17:21 -07:00
Stephen Barker 938bd45626 docs(guide/decorators): add decorator guide
+ explain decorators and how they are implemented in angular
+ explain how different types of services can be selected
+ explain `$delegate` objects and how they differ between services
+ warn of the risks/caveats of `$delegate` modification
+ note the exposure of `decorator` through the module api
+ show an example of decorating a core service
+ show an example of decorating a core directive
+ show an example of decorating a core filter

Closes #12163
Closes #14372
2016-05-06 05:51:22 -07:00
Martin Staffa 996b1e4378 style(validators.js): remove trailing whitespace 2016-05-06 14:26:52 +02:00
Michael Warner 4978a06ad2 docs(ngRequired): add 'restrict' info
The Angular Docs do not show the restrictions

Closes #14541
2016-05-06 04:52:48 -07:00
Ivo Mirra aaa069a65a fix($compile): removing unnecessary white space in element-transclusion comments
Fixes #14549

Closes #14550
2016-05-05 18:49:54 -06:00
Martin Probst 707664a3c4 fix(ng-bind-html): watch the unwrapped value using $sce.valueOf() (instead of toString())
Custom `$sce` implementations might not provide a `toString()` method on the wrapped object, or it
might be compiled away in non-debug mode. Watching the unwrapped value (retrieved using
`$sce.valueOf()`) fixes the problem.

The performance of this should be equivalent - `toString()` on objects usually touches all fields,
plus we will also avoid the (potentially big) string allocation.

Fixes #14526
Closes #14527
2016-04-28 20:18:57 +03:00
Mark Pieszak 06e96407a9 docs(README.md): add link to Angular 2 repo
Might be helpful for those completely new to Angular in general, that intended to view the upcoming
2.0 version.

Closes #14532
2016-04-28 19:45:35 +03:00
Georgios Kalpakas afcedff34c fix($injector): add workaround for class stringification in Chrome v50/51
Partially fixes #14240.

Closes #14531
2016-04-28 14:21:38 +03:00
Petr Mikota 3dcc01646a docs(guide/component-router): add missing backticks
Closes #14530
2016-04-28 11:38:04 +03:00
Weijing Jay Lin b67d145bf3 docs(identity): add example
Closes #14528
2016-04-28 11:05:45 +03:00
Georgios Kalpakas 8dc1f8e00e fix($injector): add workaround for fat-arrow stringification in Chrome v50/51
Closes #14487

Closes #14495
2016-04-28 10:55:17 +03:00
Georgios Kalpakas 0780666e41 feat($compile): support omitting required controller name if same as the local name
Basically, making `require: {someDir: '?^someDir'}` equivalent to `require: {someDir: '?^'}`.

Closes #14513
2016-04-28 10:41:17 +03:00
Fabricio Ronchi 6d2e0718d2 docs(ngAria): remove redundant table column
Closes #14518
2016-04-28 10:37:06 +03:00
Martin Staffa d71dc2f5af perf($animate): listen for document visibility changes
perf(ngAnimate): listen for document visibility changes

Accessing the document for the hidden state is costly for
platforms like Electron. Instead, listen for visibilitychange
and store the state.

(#14071)
Closes #14066
2016-04-26 14:01:09 -07:00
Michael de Wit b9d76bfa55 docs(guide/component): several unit-test fixes and remove obsolete testcase
Fixes #14426

Closes #14443
2016-04-26 20:23:12 +03:00
Perry Hooker 2310e1090a fix($compile): properly handle setting srcset to undefined
Previously, calling `Attributes#$set('srcset', value)` on an `<img>` element would throw if `value`
were undefined, as it assumed `value` is always a string.
This commit fixes the issue, by skipping the unnecessary string manipulation when `value` is not
defined.

Closes #14470

Closes #14493
2016-04-26 09:06:26 +03:00
andrea 92752e5b42 docs(guide/index): fixed formatting with subtitles
The "Books" and "Videos" subtitles had no space between text and the '#' so it didn't render as a
subtitle.

Closes #14514
2016-04-26 08:32:13 +03:00
Tim van Dalen 4ad95607eb docs($anchorScroll): fix link to HTML5 spec
Closes #14364
2016-04-26 00:22:24 +03:00
Raphael Jamet 8576baf751 fix($templateRequest): trust empty templates in $templateCache as well
Implicitly trust empty templates added to `$templateCache` as is the case for all other templates.

Fixes #14479

Closes #14496
2016-04-25 20:19:53 +03:00
Sam 8d1ee0c3b9 docs(guide/Unit Testing): covert 'focussed' to AE spelling
We prefer American English spelling.
(#14503)
2016-04-24 07:46:41 -07:00
Georgios Kalpakas c95a3d8088 docs($interpolate): add known issue about end-symbol in expression
This has been discussed in #8642.

Closes #14494
2016-04-22 14:40:50 +03:00
Georgios Kalpakas 25a7aefc12 fix(filters): always call splice() with 2 arguments or more
When calling `.splice()` without a 2nd argument (`deleteCount`), most browsers will splice to the
end of the array. As it turns out, this is the behavior specified in [ES2015][es6]. In [ES5][es5],
the spec seems to imply that nothing should happen.

To avoid inconsistent behavior among browsers implementing different versions of the EcmaScript
standart or when ES5 shims are included (e.g. https://github.com/es-shims/es5-shim/), this commit
ensures that all calls to `.splice()` provide at least two arguments.

[es5]: http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.12
[es6]: http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.splice

Fixes #14467

Closes #14489
2016-04-22 12:39:41 +03:00
Abhishek Garg 0727bfc141 docs($http): add better explanation for error status codes
Add explanation for error status codes in `$http` and mention negative codes normalization.
This alleviates confusion about which status codes will trigger the error callback and what values
to expect in such callbacks.

Fixes #11945

Closes #14459
2016-04-22 12:19:35 +03:00
andreyjkee 253cb8d4e9 fix(ngMocks): pass eventHandlers to $httpBackend if passThrough is active
Closes #14471
2016-04-21 23:08:39 +02:00
Martin Staffa d2ec9d7184 docs(guide/Expressions): mention absence of bitwise operators
Closes #14485
2016-04-21 16:26:47 +02:00
Abhishek Garg 1676b8477f docs(changelog): make labels and list style consistent
Remove 'Breaking Changes' label where there are no breaking changes.

Only for '1.4.0-rc.2', breaking changes have different styling (bold without bulleted list). Change to be consistent with others

(#14482)
2016-04-21 07:23:30 -07:00
Amy c414ece5cf docs($sce): add missing article
...teeny letter missing.  Just a grammar change.
(#14480)
2016-04-21 07:18:15 -07:00
jody tate 186c8cb9e4 docs(ngAria): fix markdown heading syntax
(#14477)
2016-04-21 07:16:45 -07:00
Martin Staffa b5983e4b21 docs(ngMock): add custom installation instructions
ngMock should be used in a test runner context, not directly in the application

Closes #14248
2016-04-21 15:56:16 +02:00
Martin Staffa f30b0ed849 docs: reorganize module overview page template 2016-04-21 15:56:16 +02:00
Michał Gołębiowski d985944652 chore(jQuery): bump jQuery version from 2.2.1 to 2.2.3 2016-04-20 13:36:39 +02:00
Ken Powers e14b486e07 docs(guide/Components): snake -> kebab
The example given is not in snake_case, it is in kebab-case.

Closes #14464
2016-04-19 11:31:19 -07:00
Lucas Mirelmann eb9f7d484d chore(i18n): Update locales to version 29
Closes: #14450
2016-04-18 22:15:40 +02:00
Lucas Mirelmann b5a0c8d2ea feat($parse): Add support for ES6 object initializers
- Add support for computed property names
- Add support for short notation in properties definitions

Eg. The expressions `{x}` and `{[x + 'foo']: 1}` are now valid.
2016-04-18 22:01:30 +02:00
Lucas Mirelmann c1eaf3480b fix($parse): Handle sign of -undefined consistently
When csp is disabled, evaluating `-undefined` is `-0` and when csp is enabled
the evaluation is `0`. In most cases this is not an issue as `0 === -0`, but
there is an edge case as `1/0 === Infinity` and `1/-0 === -Infinity`

Close: #14451
2016-04-18 16:29:10 +02:00
Martin Staffa 997f482b38 docs(ngMockE2E): add $httpBackend mock example 2016-04-18 14:08:10 +02:00
Peter Bacon Darwin 0cb94ed3a3 chore(CHANGELOG): fix version number for 1.5.5 2016-04-18 12:31:31 +01:00
Peter Bacon Darwin c3de164b83 chore(CHANGELOG): add 1.5.5 release notes 2016-04-18 12:29:22 +01:00
Martin Staffa 165a862a0b chore(gitignore): exclude .log and .stackdump files 2016-04-17 13:34:55 -07:00
Jeremy 7148627eae docs(guide/Component Router): fix a typo in npm install instructions
Related #14452
2016-04-17 13:33:35 -07:00
Peter Bacon Darwin 0d7f1ed428 docs(CHANGELOG): remove changes from 1.5.4
1.5.4 was only partially released.
These changes will be included in the 1.5.5 release
2016-04-16 09:29:03 +01:00
z.ky 5656eb3c0b docs($http): fix typo
Fix a typo in the $http API Reference
2016-04-15 10:23:03 -07:00
Georgios Kalpakas ddac3b3348 fix($http): pass event object to eventHandlers/uploadEventHandlers
Fixes #14436
2016-04-15 14:10:25 +01:00
Peter Bacon Darwin 0d55298b56 revert: refactor($compile): move setting of controller data to single location
Reverted from commit 83a6b15020 since it caused
the Angular Material tabs directives to break.
2016-04-15 14:07:28 +01:00
Jannick Fahlbusch 56861c0ae9 chore(docsApp): open plnkr.co with HTTPS
Plnkr should be opened via HTTPS instead of HTTP to supress warnings about an insecure connection

Closes #14445
2016-04-15 14:37:50 +02:00
cloverharvest b4c7df3713 docs($http): fix a typo (his --> this)
Closes #14430
2016-04-15 01:24:14 +03:00
Adam Demuri 1f05b96022 docs(component): document 'require' in angular.component
Closes #14429
2016-04-15 01:09:31 +03:00
Peter Bacon Darwin c4fb0eca92 docs(CHANGELOG): add release notes for 1.5.4 2016-04-14 09:16:39 +01:00
Pete Bacon Darwin 2840aec8f1 feat($componentController): provide isolated scope if none is passed (#14425)
Closes #14425
2016-04-13 18:11:20 +01:00
Martin Staffa 97b3e003bc perf(ngOptions): use documentFragment to populate select
This changes the way option elements are generated when the ngOption collection changes.
Previously, we would re-use option elements when possible (updating their text and
label). Now, we first remove all currently displayed options and the create new options for the
collection. The new options are first appended to a documentFragment, which is in the end appended
to the selectElement.

Using documentFragment improves render performance in IE with large option collections
(> 100 elements) considerably.

Creating new options from scratch fixes issues in IE where the select would become unresponsive
to user input.

Fixes #13607
Fixes #13239
Fixes #12076
2016-04-13 18:40:03 +02:00
Georgios Kalpakas f785c0c98d docs(ngView): add known issue about asynchronously loaded ngView
Closes #14424
2016-04-13 18:25:46 +03:00
Georgios Kalpakas 75bf80700e revert: "fix(ngRoute): allow ngView to be included in an asynchronously loaded template"
This reverts commit 5e37b2a7fd.
Eagerly loading `$route`, could break tests, because it might request the root or default route
template (something `$httpBackend` would know nothing about).

It will be re-applied for `v1.6.x`, with a breaking change notice and possibly a way to disable
the feature is tests.

Fixes #14337
2016-04-13 18:23:59 +03:00
Jason Bedard fe1127a322 perf($compile): use createMap() for directive bindings to allow fast forEach
Closes #12529
2016-04-13 11:49:40 +03:00
Peter Bacon Darwin 709dc1cf0e docs(images): add svg and visio versions of the graffle image 2016-04-12 14:19:55 +01:00
Peter Bacon Darwin 3207b51e83 docs(guide): add svg and visio versions of the graffle images 2016-04-12 14:16:43 +01:00
Peter Bacon Darwin e818d4a959 docs(tutorial): add svg and visio versions of the graffle images 2016-04-12 14:13:33 +01:00
Georgii Dolzhykov 1c62d632a5 docs(Module): fix parameter names for .decorator()
Closes #14413
2016-04-12 14:50:46 +03:00
aortyl 761c70c7b9 docs(guide/scope): add comma for readability
Closes #14411
2016-04-11 22:21:29 +03:00
Jason Bedard 83a6b15020 refactor($compile): move setting of controller data to single location
Closes #13421
2016-04-11 18:54:20 +01:00
Georgios Kalpakas 9264cef03f fix($compile): do not use noop() as controller for multiple components
Currently, custom annotations are copied from the CDO onto the controller constructor.
Using `noop()` when no controller has been specified, pollutes it with custom annotations and
makes one component's annotations available to all other components that have `noop()` as their
controller.

Fixes #14391
Closes #14402
2016-04-11 18:42:48 +01:00
a510 a0b5e1a858 fix($injector): ensure functions with overridden toString() are annotated properly
Closes #14361
2016-04-11 12:58:50 +03:00
David Rodenas Pico 74eb4684dc fix(ngClass): fix watching of an array expression containing an object
Closes #14405
2016-04-11 12:38:45 +03:00
Georgios Kalpakas d088fbeae3 refactor($compile): remove unnecessary call to isDefined()
(As discussed in https://github.com/angular/angular.js/pull/14406/files#r59131398.)
2016-04-11 12:31:45 +03:00
Gene McCulley ee8d8e12fb docs(numberFilter): fix the description of the returned value
Closes #14408
2016-04-11 12:26:56 +03:00
Peter Bacon Darwin 4a0bd6ce69 fix($compile): still trigger $onChanges even if the inner value already matches the new value
Closes #14406
2016-04-10 20:30:35 +01:00
Rouven Weßling 5d695e5566 chore(IE8): remove more special code for IE8
Closes #9478
2016-04-09 22:38:16 +02:00
Jurko Gospodnetić 92c3b753d4 fix(ngMock): fix collecting stack trace in inject() on IE10+, PhantomJS
Add support for collecting current stack trace information in browsers
(e.g. IE10+, PhantomJS) that do not automatically store the current stack trace
information in a newly created `Error` object's `stack` property, but
only add it there once the `Error` gets thrown.

The original implementation works fine in Firefox & Chrome, but fails on IE10+
and PhantomJS where it, for example, breaks Karma's error reporting in cases
when an exception is thrown in a test like the following:

```
it('the holy crusade', inject(function() {
  var x = {};
  x.holyGrail();
}));
```

In this case, the ngMock `inject()` implementation would incorrectly add the
word `undefined` at the end of the collected error stack trace information,
thus causing the main error description to be reported back to Karma as
`undefined`.

The added test makes sure this functionality:

- works as expected in browsers supporting JavaScript stack trace
  collection, e.g. Chrome, Firefox, IE10+, Opera & PhantomJS
- does not add any bogus stack track information in browsers that do
  not support JavaScript stack trace collection, e.g. IE9

Fixes #13591
Closes #13592

Closes #13593
2016-04-09 20:49:10 +03:00
Georgios Kalpakas a084030afa test(helpers): fix error message generation for toHaveBeenCalledOnce[With] matchers
Jasmine 2.4 (maybe earlier) does not support returning an array containing both the "normal" and the
negative error messages. It will always concatenate them.

Closes #14275
2016-04-09 17:01:45 +03:00
Jan Niehusmann 1cb8d529a6 fix($compile): handle boolean attributes in @ bindings
Commit db5e0ff handles initial values of boolean attributes. The same
change needs to be applied inside the attrs.$observe() call.

Closes #14070
2016-04-09 16:52:33 +03:00
Peter Bacon Darwin 0348347841 chore(package.json): update dgeni-packages to 0.12.0
This gives us `@knownissues` tags
2016-04-08 20:58:19 +01:00
Peter Bacon Darwin d405dfd5ed docs(jqlite): add known issue
Closes #14251
2016-04-08 19:33:43 +01:00
Peter Bacon Darwin d497822266 feat($http): support handling additional XHR events
Closes #14367
Closes #11547
Closes #1934
2016-04-08 19:15:30 +01:00
Chris Chua 50cdedef36 feat($http): support handling additional XHR events
Closes #11547
Closes #1934
2016-04-08 19:15:30 +01:00
Martin Staffa 8dc08fb1d7 docs(CONTRIBUTING): clarify guidelines for ngLocale changes 2016-04-08 19:29:19 +02:00
Martin Staffa 7477fbec61 docs(README): fix typo 2016-04-08 19:00:31 +02:00
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
Martin Staffa bbd3db14f8 perf($compile): use strict comparison for controller === '@'
In the DDO, controller can be '@', which means the controller name
is taken from the directive attribute. This is undocumented and internally
only used by ngController. There seems to be no case where converting the
controller function to a string would actually be necessary.

Related #14268
2016-03-22 11:53:48 +01:00
Steve Mao 2ad8a93657 docs($q): mention ES2015 (as a "synonym" for ES6) and remove "harmony"
Closes #14294
2016-03-22 12:03:37 +02:00
Georgios Kalpakas 9f5526f861 fix($sniffer): fix history sniffing in Chrome Packaged Apps
Although `window.history` is present in the context of Chrome Packaged Apps, it is not allowed to
access `window.history.pushState` or `window.history.state`, resulting in errors when trying to
"sniff" history support.
This commit fixes it by detecting a Chrome Packaged App (through the presence of
`window.chrome.app.runtime`). Note that `window.chrome.app` is present in the context of "normal"
webpages as well, but it doesn't have the `runtime` property, which is only available to packaged
apps (e.g. see https://developer.chrome.com/apps/api_index).

(It also also contains some style changes for making the structure and layout of `$sniffer` tests
 more consistent.)

Fixes #11932

Closes #13945
2016-03-22 11:32:18 +02:00
Wassim Chegham 7452bc4fb6 docs(guide/component-router): fix typos
Closes #14278
2016-03-22 02:13:23 +02:00
Owen Craig 4202d8a5de fix(formatNumber): handle small numbers correctly when gSize !== lgSize
By using `>=` when comparing the number length to `lgSize`, we'll provide the correct value, when
formatting numbers with different `lgSize` than `gSize`.

Fixes #14289

Closes #14290
2016-03-22 00:09:02 +02:00
Georgios Kalpakas 27ceb6a8fc test(TzDate): fix test in Australia
Probably due to implementation differences in browsers for pre-DST period (see
https://github.com/angular/angular.js/issues/5017 and especially
https://github.com/angular/angular.js/issues/5017#issuecomment-90775226 for context), some
`TzDate` tests had different behavior on different Timezones/Regions (e.g. failed in Australia,
which started to observe DST in 1971).
Since the used year (`1970`) didn't have any particular significance, this commit fixes the issue
by using a year that is more consistently handled by browsers (`2000`).

Fixes #14272

Closes #14285
2016-03-21 20:42:22 +02:00
Peter Bacon Darwin aa077e8112 feat($location): default hashPrefix to '!'
The $location service is designed to support hash prefixed URLs
for cases where the browser does not support HTML5 push-state navigation.

The Google Ajax Crawling Scheme expects that local paths within a SPA start
with a hash-bang (e.g. `somedomain.com/base/path/#!/client/side/path`).

The `$locationProvide` allows the application developer to configure the
hashPrefix, and it is normal to set this to a bang '!', but the default
has always been the empty string ''.

This has caused some confusion where a user is not aware of this feature
and wonders why adding a hash value to the location (e.g. `$location.hash('xxx')`)
results in a double hash: `##xxx`.

This commit changes the default value of the prefix to '!', which is more
natural and expected.

See https://developers.google.com/webmasters/ajax-crawling/docs/getting-started

Closes #13812
Closes #14202

BREAKING CHANGE

The hash-prefix for `$location` hash-bang URLs has changed from the empty
string "" to the bang "!". If your application does not use HTML5 mode
or is being run on browsers that do not support HTML5 mode, and you have
not specified your own hash-prefix then client side URLs will now contain
a "!" prefix. For example, rather than `mydomain.com/#/a/b/c` will become
`mydomain/#!/a/b/c`.

If you actually wanted to have no hash-prefix then you should configure
this by adding a configuration block to you application:

```
appModule.config(['$locationProvider', function($locationProvider) {
  $locationProvider.hashPrefix("");
}]);
```
2016-03-21 11:17:28 +00:00
Peter Bacon Darwin 6a56461135 chore(.gitignore): ignore Visual Studio Code settings 2016-03-21 10:43:58 +00:00
surya prakash singh 7e5e66fa3c docs(input[time]): fix a typo in the example
Closes #14220
2016-03-21 01:25:20 +02:00
Rongduan Zhu 9ea5f73f73 docs(guide/component-router): changed path to match diagram
Closes #14277
2016-03-20 23:59:30 +02:00
Georgios Kalpakas 3e9015019f docs(CHANGELOG.md): rearrange v1.5.1 to be right below v1.5.2
Moved the `v1.5.1` section above the `v1.4.10` one, so that it is right below the `v1.5.2` section
for easier reference. Also removed an empty "Breaking Changes" sub-section.

Closes #14283
2016-03-20 22:52:33 +02:00
Georgios Kalpakas 22dee1159c chore(ci-checks): fix the ddescribe-iit task for Jasmine 2
Closes #14276
2016-03-20 22:20:33 +02:00
Matias Niemelä c9b4251413 chore(CHANGELOG): update version reference 2016-03-18 15:38:18 -07:00
Matias Niemelä b0f2ee7cc4 docs(CHANGELOG): add notes for v1.5.2 2016-03-18 15:13:22 -07:00
Martin Staffa e166621c9d fix(ngAnimate.$animate): remove animation callbacks when the element is removed
The test for this didn't actually test the listener removal. The addClass animation after
the element removal didn't start because the enter animation was still in progress.
2016-03-18 15:55:25 +01:00
Jason Bedard a1010c5f74 style($compile,$controller): adding function names for debug/tracing
Closes #13420
2016-03-18 15:44:43 +01:00
Jason Bedard 71e6ccbca6 style($templateRequest): rename minError var to avoid name conflict
Closes #13701
2016-03-18 15:44:34 +01:00
Jason Bedard 03c572551d style(ngModel,ngOptions): make use of declared but unused variables 2016-03-18 15:44:28 +01:00
Jason Bedard ac35b416fb style(*): remove unused variables 2016-03-18 15:44:28 +01:00
Martin Staffa 4ef0c7bac0 docs(guide/Services): add whitespace in code example
Closes #14156
2016-03-18 15:40:57 +01:00
Huc Arnaud 038eabe8db docs(error/tplrt): add missing ' in example code
Missing a ' @ line 46 class='wrapper'

Closes #14258
2016-03-18 15:40:54 +01:00
Maxim Salnikov 25bac4e520 docs(guide/Component Router): fix typo in example code
Closes #14262
2016-03-18 15:40:45 +01:00
Georgios Kalpakas 82a4545e77 docs(CHANGELOG.md): add notes for v1.4.10 2016-03-16 21:16:10 +02:00
Michał Gołębiowski b8343e213f tests(jQuery): make the tests pass on jQuery 3.0.0-beta1
Closes #14229
2016-03-16 18:24:28 +00:00
Michał Gołębiowski 5b2f6fa91f tests(jQuery): test on both oldest & latest supported jQuery version 2016-03-16 18:23:52 +00:00
Michał Gołębiowski 867f1db04c chore(jqLite): stop patching the change jQuery special handler
Code patching the change event in jQuery doesn't exist in jQuery 2 so this patch
hasn't been needed since Angular 1.3
2016-03-16 18:23:51 +00:00
Michał Gołębiowski c011215b7f refactor(jqLite): don't pass useCapture to add/removeEventListener
The useCapture parameter defaults to false even in oldest of our supported
browsers; this is no longer needed. jQuery has removed it in 2.2 as well.
2016-03-16 18:23:51 +00:00
Georgios Kalpakas 99f7302490 docs(CHANGELOG.md): fix typo in anchor name 2016-03-16 19:54:55 +02:00
Josh Schneider 208b84bef1 docs(guide/component-router): fix incorrect hook name for $canActivate
The hook will most likely be named back to `$routerCanActivate` in the future,
but for now this change is accurate.

Closes #14237
2016-03-16 16:45:01 +00:00
Peter Bacon Darwin a9bbfff44b chore(travis): update node and browser versions 2016-03-16 13:58:57 +00:00
Georgios Kalpakas d2cc451b1a docs(CHANGELOG.md): add notes for v1.5.1 2016-03-16 14:13:54 +02:00
Peter Bacon Darwin 693bf61546 chore(jenkins): update node version to 4.4 2016-03-16 11:07:10 +00:00
Peter Bacon Darwin 511503ef3c chore(jenkins): fix node version chooser in build scripts
The `set-node-version.sh` script was being run in its own shell and so
was not actually changing the current version of node.
2016-03-16 11:07:10 +00:00
Lucas Mirelmann eb16611c51 chore(*): Upgrade to Jasmine 2.4
Highlights:
New mechanism to run async tests as Jasmine 2 removed `runs`, `waits` and `waitsFor`
The functions `iit`, `ddescribe` and `tthey` were renamed `fit`, `fdescribe` and
`fthey` as the originals came from Karma, Karma no longer bundles Jasmine and the
new function name comes from Jasmine.

Closes #14226
2016-03-16 09:15:21 +00:00
Peter Bacon Darwin a4e60cb697 docs(guide/location): include section on base[href]
Closes #14018
2016-03-14 14:45:29 +00:00
Lucas Mirelmann 81150ac77d feat($parse): Allow user-defined literals
Allow user-defined literals.

Close: #9504
Close: #9492
Close: #14194
2016-03-13 20:41:23 +01:00
lordg 7ecfa5deba docs(guide/Component Router): adjust the order in the menu
Component Router should come after the menu topic Components as Components should be understood first
before Component Routers. This made it easier to read the Component Routers topic.

Closes #14214
2016-03-11 14:21:38 +01:00
Martin Staffa 567f9b0136 chore: streamline issue/pr templates
Removes the bullet points and makes all prompts bold,
which should make it easier to see which content has been
added by the issue author
2016-03-11 14:21:16 +01:00
Thanos Korakas 0c2d3988ab docs(guide/component): use ctrl instead of this (for consistency)
Closes #14215
2016-03-11 09:34:14 +02:00
Gordon Zhu efd448d7d3 docs(guide/unit-testing): fix typo
Closes #14198
2016-03-09 00:54:07 +02:00
mohamed amr db281c133d refactor(*): use toBeUndefined consistently
Closes #14185
Fixes #14184
2016-03-07 10:35:54 +00:00
Peter Bacon Darwin 6a336ba6a0 docs(guide/component-router): initial draft for component router 0.2.0
Closes #14131
2016-03-04 13:57:15 +00:00
Martin Staffa 67a98112e4 docs($provide): clarify value and constant injectability
Closes #14168
2016-03-04 10:02:28 +01:00
Ciro Nunes f1aea54a9b docs(ngModel.NgModelController): fix typo
Closes #14157
2016-03-02 19:22:19 +01:00
Martin Staffa 663788d8c1 docs(changelog, migration): add BC notice for allowed form name values
Introduced by https://github.com/angular/angular.js/commit/94533e570673e6b2eb92073955541fa289aabe02

Closes #13771
2016-03-02 19:03:31 +01:00
Tim Ruffles af0574ebaa feat(ngMock): add sharedInjector() to angular.mock.module
Allow to opt-in to using a shared injector within a context. This allows  hooks to be
used in Jasmine 2.x.x/Mocha

Closes #14093
Closes #10238
2016-03-01 11:38:27 +00:00
Ivo Mirra 4883e95797 refactor(*): move noop functions to angular.noop
Closes #14151
2016-02-29 18:08:03 +01:00
Georgios Kalpakas 9c7c494c3e docs(errorDisplay): encode < and > in error messages
When an error message contains an HTML string (e.g. `$location:nobase` containing `<base>`), it was
interpreted as a literal HTML element, instead of text. Error messages are not expected to render
as HTML, but we still need to use `.html()` in `errorDisplay`, so that the links created by
`errorLinkFilter` are properly displayed.
This commit solves this issue by replacing `<`/`>` with `&lt;`/`&gt;`.

Related to #14016.
2016-02-29 17:19:29 +01:00
Georgios Kalpakas 321180af13 test(docs): add tests for the errors module 2016-02-29 17:19:29 +01:00
Jason Bedard e2898c9436 refactor($compile): move setup/get controller methods out of the compile node closure
Closes #13427
2016-02-29 17:19:29 +01:00
Jason Bedard c52d0957de refactor($compile): remove out of date jQuery vs jqLite comment/workaround 2016-02-29 17:19:29 +01:00
Nabil Hashmi 7bdc6cb358 docs($http): fix typo in link text (TransformationjqLiks --> Transformations)
Closes #14149
2016-02-28 23:07:45 +02:00
Martin Staffa 2c54a3c081 fix(ngOptions): always set the 'selected' attribute for selected options
We don't set selected property / attribute on options that are already selected.
That happens for example if the browser has automatically selected the first
option in a select. In that case, the selected property is set automatically, but
the selected attribute is not. This doesn't impact the functionality of the select,
but it can be problematic if option elements are selected with `option[selected]` in tests.

Closes #14115
Closes #14125
2016-02-28 16:12:38 +01:00
lordg 5078c76c5d docs(guide/Interpolation): fix code example
The function getForm is receiving a variable from the view and should be using that.

Closes #14142
2016-02-28 16:04:11 +01:00
Matt Janssen 30a7e3a144 docs(guide/Components): add missing $ctrl
docs(guide/Components): add missing $ctrl

The new component example does not work as is. It needs a missing reference to $ctrl.

Closes #14138

Closes #14143
2016-02-28 16:02:42 +01:00
Georgii Dolzhykov a6afa780b7 docs(guide/Services): improve the code example
A factory that doesn't return anything is a bad example of a factory.

Closes #14139
2016-02-28 15:56:49 +01:00
lordg 3faa01fb15 docs(guide/Templates): add title for consistency
Closes #14141
2016-02-28 15:56:44 +01:00
Martin Staffa 0f5bcb7356 docs(guide/interpolation): make some minor improvements, add info
- highlight that interpolation inside expressions is bad practice
- add info about type attr in buttons in IE
2016-02-28 15:56:39 +01:00
lordg db1cf6d293 docs(guide/Filters): add title for consistency
Closes #14143
2016-02-28 15:13:01 +01:00
mohamed amr 6253de3913 test(ngAria): remove incorrect closing div tag after input element
Closes #14146
Closes #14147
2016-02-28 14:58:50 +01:00
Lucas Mirelmann 32feb2b45f refactor($compile): Create non-descriptive comments when debugInfoEnabled is false
When debugInfoEnabled is `false` when comments generated by transclusions, ngIf,
ngRepeat and ngSwitch will not contain any information about the directive nor
the expression associated with it.

Closes: #8722
2016-02-25 20:18:59 +01:00
Georgios Kalpakas 5e37b2a7fd fix(ngRoute): allow ngView to be included in an asynchronously loaded template
During it's linking phase, `ngView` relies on the info provided in `$route.current` for
instantiating the initial view. `$route.current` is set in the callback of a listener to
`$locationChangeSuccess`, which is registered during the instantiation of the `$route` service.

Thus, it is crucial that the `$route` service is instantiated before the initial
`$locationChangeSuccess` is fired. Since `ngView` declares `$route` as a dependency, the service is
instantiated in time if `ngView` is present during the initial load of the page.

Yet, in cases where `ngView` is included in a template that is loaded asynchronously (e.g. in
another directive's template), the directive factory might not be called soon enough for `$route`
to be instantiated before the initial `$locationChangeSuccess` event is fired.

This commit fixes it, by always instantiating `$route` up front, during the initialization phase.

Fixes #1213
Fixes #6812

Closes #14088
2016-02-25 11:54:20 +02:00
Martin Staffa 0749eb44e5 docs($http): add a note about modifying data in transformRequest
Closes #12468
2016-02-24 17:35:54 +01:00
Peter Bacon Darwin c900b9c531 docs(guide/security): provide more information about security features
Thanks to Jim Manico for help updating this guide.
2016-02-24 13:19:05 +00:00
Steve Shaffer 6a4597b47d docs(guide/Internet Explorer Compatibility): Add ng-attr-type workaround for buttons in IE
Closes #14117
Closes #14119
2016-02-24 11:39:58 +00:00
Foxandxss d7cb37032b chore(ISSUE_TEMPLATE): fix typo in ISSUE_TEMPLATE
Closes #14121
2016-02-24 11:36:47 +00:00
Vadorequest 76f47d5632 feat($controllerProvider): add a has() method for checking the existence of a controller
Fixes #13951

Closes #14109
2016-02-24 00:00:13 +02:00
Georgios Kalpakas 871bebf7dc fix(ngMock): don't break if $rootScope.$destroy() is not a function
Previously, `angular-mocks` was calling `$rootScope.$destroy()` after each test as part of it's
cleaning up, assuming that it was always available. This could break if `$rootScope` was mocked
and the mocked version didn't provide the `$destroy()` method.
This commit prevents the error by first checking that `$rootScope.$destroy` is present.

Fixes #14106

Closes #14107
2016-02-23 23:18:18 +02:00
Peter Bacon Darwin 7e112c1fc3 feat($compile): add custom annotations to the controller
This means that we can access these annotations, such as
`$routeConfig` and `$routerCanActivate` without highjacking
the `ng` module.

Closes #14114
2016-02-23 18:55:18 +00:00
Georgios Kalpakas 59aef48281 refactor(ngMock): make ngMock minification-safe
It is not common, but some workflows result in `angular-mocks` being minified.

Fixes #13542

Closes #14073
2016-02-23 14:22:52 +02:00
marvin sl 2ffda41ab0 docs(guide/animations): fix typos in example
Closes #14111
2016-02-23 14:12:53 +02:00
Igor Dolgov f70237a3e8 docs(ngMock): add missing ")" in example
Closes #14112
2016-02-23 13:51:47 +02:00
Martin Staffa 3c86212710 chore: add issue and PR templates 2016-02-22 23:19:45 +01:00
Georgios Kalpakas 85ef70f428 fix(ngMock): prevent memory leak due to data attached to $rootElement
Starting with 88bb551, `ngMock` will attach the `$injector` to the `$rootElement`, but will never
clean it up, resulting in a memory leak. Since a new `$rootElement` is created for every test,
this leak causes Karma to crash on large test-suites.
The problem was not detected by our internal tests, because we do our own clean-up in
`testabilityPatch.js`.

88bb551 was revert with 1b8590a.
This commit incorporates the changes from 88bb551 and prevents the memory leak, by cleaning up all
data attached to `$rootElement` after each test.

Fixes #14094

Closes #14098
2016-02-22 15:57:10 +02:00
anh a7244fdcb0 docs(guide/component): fix $componentController usage
Fixes #14091

Closes #14092
2016-02-22 13:41:09 +02:00
Martin Staffa 565391d30a chore(travis): update Chrome and FF versions, add Safari 9
Closes #13888
2016-02-22 11:24:32 +00:00
Georgios Kalpakas a88473db8a test($resource): clean up commented out code
Closes #13891
Closes #13895
2016-02-22 11:21:02 +00:00
Ben Elliott 68f528aa04 docs(ngMessages): clarify ngMessages docs with clearer example
Closes #14103
2016-02-22 12:04:43 +01:00
Kin 3671adbba6 docs(numberFilter): improve wording for infinity description
Closes #14100
2016-02-22 12:04:43 +01:00
Kin 1edb13f784 docs(angular.forEach): fix typo 2016-02-22 12:04:43 +01:00
Ryo Utsunomiya 113a946a99 docs(guide/components): fix typo
Closes #14099
2016-02-21 10:03:15 +00:00
Gordon Zhu 70caf84634 docs(guide/index): add Firebase Foundations and Angular Course
Closes #14097
2016-02-21 07:52:03 +00:00
Matias Niemelä 1b8590a7c5 revert: fix(ngMock): attach $injector to $rootElement
This reverts commit 88bb5518eb.

The fixes applied in the reverted commit caused a memory leak
with JQuery + Karma.
2016-02-20 21:33:29 -08:00
Georgios Kalpakas 9955bd05ed docs(guide/migration): remove redundant horizontal ruler 2016-02-21 01:18:39 +02:00
Yonatan Kra 02a9543189 docs(guide/component): make clear when required controllers are available
It was unclear that the required controllers are available only just before the `$onInit` lifecycle
hook is triggered.

Closes #14096
2016-02-21 01:12:51 +02:00
TepigMC eda7ef66f7 docs(README.md): fix typo
Closes #14090
2016-02-21 00:50:58 +02:00
MicCarr 2d6c218327 docs(ngMock): fix typo in example
Closes #14069
2016-02-18 14:12:26 +02:00
Jason Bedard 7324804bf5 fix(input): re-validate when partially editing date-family inputs
Fixes #12207
Closes #13886
2016-02-18 10:54:30 +02:00
ryanhart2 84c04b0b68 docs($http): improve description of caching
Included changes:

* Point out that only GET & JSONP requests are cached.
* Explain that the URL+search params are used as cache keys (headers not considered).
* Add note about cache-control headers on response not affecting Angular caching.
* Mention `$httpProvider.defaults.cache` (in addition to `$http.defaults.cache`).
* Clear up how `defaults.cache` and `config.cache` are taken into account for determining the
  caching behavior for each request.

Fixes #11101
Closes #13003
2016-02-18 00:54:18 +02:00
Jason Bedard 735be18344 fix(formatNumber): allow negative fraction size
Closes #13913
2016-02-17 15:42:17 +02:00
Aftab Ansari 3ea4477266 docs(README.md): fix typo
Closes #14062
2016-02-17 15:30:39 +02:00
Georgios Kalpakas 0b1b9112a3 fix(copy): add support for copying Blob objects
Although `copy()` does not need to (and never will) support all kinds of objects, there is a
(not uncommon) usecase for supporting `Blob` objects:

`ngMock`'s `$httpBackend` will return a copy of the response data (so that changes in one test won't
affect others). Since returning `Blob` objects in response to HTTP requests is a valid usecase and
since `ngMocks`'s `$httpBackend` will use `copy()` to create a copy of that data, it is reasonable
to support `Blob` objects.
(I didn't run any benchmarks, but the additional check for the type of the copied element should
have negligible impact, compared to the other stuff that `copy()` is doing.)

Fixes #9669

Closes #14064
2016-02-17 14:33:50 +02:00
Martin Staffa 489835dd0b chore(docs-app): fix middle/right dropdown clicks in FF
Closes #14024
2016-02-17 11:23:05 +01:00
Martin Staffa adbc2b10d2 chore(docs-app): remove obsolete directives
Most of the directives in bootstrap.js haven't been in use since
https://github.com/angular/angular.js/commit/389d4879da4aa620ee95d789b19ff9be44eb730a:
Dropdown-related directives were moved to dropdown-toggle.js, and for
foldout, popover and syntax, the uses and tests were removed, but not the directives themselves.

The last use of tabbable was removed in
https://github.com/angular/angular.js/commit/6b7a1b82bc26bbf4640506a9a3cf37ebf254d3d2
2016-02-17 11:23:05 +01:00
biohazardpb4 ea6c2473c1 fix(ngMockE2E): pass responseType to $delegate when using passThrough
The `ngMockE2E` `$httpBackend` has a mechanism to allow requests to pass through, if one wants to
send a real HTTP request instead of mocking. The specified `responseType` of the request was never
passed through to the "real" `$httpBackend` (of the `ng` module), resulting in it being effectively
ignored.

Fixes #5415

Closes #5783
2016-02-17 00:53:38 +02:00
Georgios Kalpakas b43768a345 docs(guide/forms): make required ngModel optional in custom e-mail RegExp example 2016-02-16 22:52:21 +02:00
Alexander e47957248f docs(guide/component): use fieldType property in component's template
Closes #14059
2016-02-16 22:43:02 +02:00
srijan 019900d7c2 docs(guide/scope): fix typo in image
Closes #13724
2016-02-16 21:49:45 +02:00
Georgios Kalpakas 88bb5518eb fix(ngMock): attach $injector to $rootElement
Fixes #14022

Closes #14034
2016-02-16 21:37:58 +02:00
Martin Staffa 3940edced4 test(*): ensure console log doesn't break the app in IE9
When Angular is loaded more than once (by including the script multiple times),
a warning is logged in the console. IE9 only makes the console available when
the dev tools are open, so before this fix, the browser would throw an error

Note that Protractor doesn't actually support IE9.
2016-02-16 17:01:13 +01:00
lucienbertin 7c60e19eb8 fix(*): only call console.log when window.console exists
`window.console` only exists in IE 8 & 9 when the devtools are open

Fixes #14006
Closes #14007
Closes #14047
2016-02-16 17:00:55 +01:00
alex-teren 632fa30fe3 docs(README.md): fix casing
Closes #14050
2016-02-16 14:46:43 +02:00
Sean Murphy bf2a76d32f fix($routeProvider): properly handle optional eager path named groups
Closes #14011
2016-02-16 14:29:43 +02:00
Lucas Mirelmann 9421674dad fix(dateFilter): Correctly format BC years
- Correctly format BC years
- Fix a function name collition
- Allow TzDate to use BC years
2016-02-14 20:17:42 +01:00
Remy Sharp ece8266b01 docs(error/$location:nobase): fix <base> not showing up in heading
Closes #14016
2016-02-13 20:14:42 +02:00
Wesley Cho b8b5b885f7 docs($compile): change component example to use controllerAs
Closes #14010
2016-02-12 12:30:01 +01:00
Georgios Kalpakas e4e30961ca feat(dateFilter): add support for STANDALONEMONTH in format (LLLL)
Fixes #13999

Closes #14013
2016-02-12 13:12:33 +02:00
Lucas Mirelmann 1061c56fe1 fix($compile): allow directives to have decorators
Allow directives to have decorators that modify the directive `scope` property

Close: #10149
2016-02-12 11:24:41 +01:00
Lucas Mirelmann 7617c08da6 fix($compile): do not add <span> elements to root text nodes
BREAKING CHANGE:

Text nodes at the root of transcluded content will no longer be wrapped into <span>
elements. If there is a need for this <span> element to be present, then this should
be added to the content to be transcluded.

Before:

```html
<div directive-that-will-transclude-the-content>
  I expect this content to e wrapped
</div>
```

After:

```html
<div directive-that-will-transclude-the-content>
  <span>I expect this content to e wrapped</span>
</div>
```
2016-02-12 11:23:58 +01:00
Lucas Mirelmann a021a376fc style($compile): Style fixes 2016-02-12 11:20:02 +01:00
Martin Staffa a7d69c9d42 docs: allow plnkr links to open in new window
Closes #8328
Closes #14008
2016-02-11 06:25:57 -08:00
Gabriel Monteagudo f0f6da304c fix($resource): fix parse errors on older Android WebViews
Error is caused by reserved keyword 'finally'.

Closes #13989
2016-02-10 12:32:10 +02:00
Lee Adcock 9425015a69 fix(input[date]): support years with more than 4 digits
Previously, the date-related regular expressions only matched years with no more than 4 digits.
This commit adds support for years with more than 4 digits. It also resolves an ambiguity in
`ISO_DATE_REGEXP` by matching the whole string (when it previosuly allowed extra characters around
the date string).

Fixes #13735
Closes #13905
2016-02-10 11:58:03 +02:00
Martin Sikora 7b592f9edd docs(error/$compile:tplrt): fix typo
Closes #13992
2016-02-10 11:03:05 +02:00
Daniel Herman c966876e57 perf(ngAnimate): avoid jqLite/jQuery for upward DOM traversal
The `parentNode` property is well supported between all browsers.  Since
no other functionality was required here other than traversing upwards
using `.parent()`, we can use the DOM API directly.

Closes: #13879
2016-02-09 21:28:58 +01:00
Daniel Herman bfce0675e2 perf(ngAnimate): avoid $.fn.data overhead with jQuery
Unlike jqLite, jquery scrapes the attributes of an element looking for
data- keys that match the requested property.  When many elements are
being animated due to something like `ngRepeat` unrolling within one
digest cycle, the amount of time spent in that one function quickly adds
up.

By changing our API to use the lower level data API, we can cut the time
spent in this function by half when jQuery is loaded.
2016-02-09 21:28:42 +01:00
Daniel Herman 2e3c6404f2 perf(ngRepeat): avoid duplicate jqLite wrappers
Internally, `$animate` already wraps elements passed through with
`jqLite`, so we can avoid needless duplication here.
2016-02-09 21:28:28 +01:00
Martin Staffa b04871b43f docs(*): clarify limitations of app bootstrapping
- Note that bootstrapping on elements with transclusion directives
is dangerous and not recommended.

- group info on limitations, and add them to the guide

Closes #11421
Closes #13572
Closes #12583
2016-02-09 11:41:54 +01:00
Martin Staffa 4ba8e3463a docs(ngRepeat): clarify limitations of object iteration
Related #6266
2016-02-09 11:36:36 +01:00
Peter Bacon Darwin 9881e77ccb refactor($componentController): don't return an object from the provider constructor function
Closes #13969
Closes #13977
2016-02-08 16:09:41 -08:00
Martin Staffa 17ba2a6e7c docs(guide/Unit Testing): add info about promises
Related #1915
2016-02-08 23:50:28 +01:00
Georgios Kalpakas 3bfeda3b2b docs(guide/migration): document a BC to ngAria (d06431e)
Closes #13949
2016-02-08 23:25:23 +02:00
Martin Staffa 4fed66da6c docs(guide/animation): add info on various topics
- how to enable / disable animations

Closes #8812

- how to handle conflicts with existing animations

Closes #8033
Closes #11820

- what happens on boostrap / how to enable animations on bootstrap
2016-02-08 16:56:36 +01:00
Martin Staffa 7de7059f95 docs: clean up formatting of animation events
Closes #12670
Closes #10742
2016-02-08 16:56:36 +01:00
Aashish Nagpal cff232a8a2 docs(README.md): add purpose section
Add a new purpose section to enable newcomers (technical and non-technical)
better understand the purpose of AngularJS

Close #13963
2016-02-08 02:12:06 -08:00
John Mercer 614ecb7aa6 docs(guide): add new book
Closes #13954
2016-02-08 02:05:47 -08:00
Prayag Verma 77b1407e0d docs(guide/migration): fix typo (a --> an)
Closes #13959
2016-02-06 16:12:04 +02:00
Martin Staffa c4e47e491f docs(error/iscp): include one-way bindings, mark spaces as allowed 2016-02-05 16:12:00 +01:00
Martin Staffa 87ac4443b6 docs(guide/components): update to use one-way binding 2016-02-05 16:12:00 +01:00
Martin Staffa 75f23f0b87 style(filters): squelch a closure compiler warning
Related #13932
2016-02-05 16:05:07 +01:00
Peter Bacon Darwin 39eecd136f docs(CHANGELOG): add notes for 1.5.0 release 2016-02-05 10:04:17 +00:00
kuroky360 260cfe6dc9 refactor(toJson): use the isUndefined() function
Closes #13923
2016-02-04 10:35:48 +02:00
Georgios Kalpakas 455af41a19 docs(guide/migration): mention isolate scope one-way bindings
Closes #13940
2016-02-04 10:28:47 +02:00
campersau f3c8aa2790 refactor(ngAria): remove unused dependency from ngModel directive
Mentioned in https://github.com/angular/angular.js/commit/d06431e5309bb0125588877451dc79b935808134#commitcomment-15871053.

Closes #13942
2016-02-04 01:05:08 +02:00
Georgios Kalpakas e2312e3efd docs(ngRequired): fix link 2016-02-04 00:12:58 +02:00
Georgios Kalpakas a460ce4665 refactor(ngAria): remove redundant '?' in DDO's require
It also fixes some dangling links in Accessibility guide.
2016-02-03 23:54:43 +02:00
Marcy Sutton d06431e530 fix(ngAria): Apply ARIA attrs correctly
BREAKING CHANGE: Where appropriate, ngAria now applies ARIA to custom controls only, not native inputs. Because of this, support for `aria-multiline` on textareas has been removed.

New support added for ngValue, ngChecked, and ngRequired, along with updated documentation.

Closes #13078
Closes #11374
Closes #11830

Closes #13483
2016-02-03 23:18:49 +02:00
Georgios Kalpakas 34ec0d9629 docs(guide/migration): add TOC and fix heading levels
Closes #13938
2016-02-03 20:23:11 +02:00
Martin Staffa 4ac23c0ac5 feat($compile): add one-way binding to the isolate scope definition
This change allows the developer to bind an isolate scope / controller property
to an expression, using a `<` binding, in such a way that if the value of the
expression changes, the scope/controller property is updated but not the
converse.

The binding is implemented as a single simple watch, which can also provide
performance benefits over two way bindings.

Closes #13928
Closes #13854
Closes #12835
Closes #13900
2016-02-03 14:01:21 +00:00
Georgii Dolzhykov 507cf31ff9 docs($compile): refine explanation of isolate scope =-binding
The current version of this paragraph is in many ways inaccurate and confusing.

Closes #13921
2016-02-03 14:59:10 +02:00
Georgios Kalpakas 91414918d7 docs(guide/accessibility): fix links
Closes #13936
2016-02-03 12:17:31 +02:00
Georgios Kalpakas 52c21fe51d docs(CHANGELOG.md): more explicitly mention that the usemap posed security risks
(Related to https://github.com/angular/angular.js/pull/13826#issuecomment-178868005.)
2016-02-03 12:11:50 +02:00
Georgios Kalpakas 2f0a50b526 fix($route): allow preventing a route reload
Fixes #9824
Closes #13894
2016-02-02 23:14:14 +02:00
Georgios Kalpakas 4a80a2e8bc docs(guide/migration): update with changes from v1.5.0-rc.2
Closes #13919
2016-02-02 21:34:47 +02:00
Georgios Kalpakas 446fac84d9 docs(CHANGELOG.md): document 234053f as a BC
Closes #13927
2016-02-02 14:31:36 +02:00
thorn0 43f72066e1 refactor(injector): remove unneeded JSHint directives
Closes #13922
2016-02-02 13:51:53 +02:00
Georgios Kalpakas a909ed1a5c docs(CHANGELOG.md): fix function name ($ngOnInit --> $onInit) 2016-02-01 22:15:49 +02:00
Lucas Mirelmann 1c6edd416b fix($rootScope): Set no context when calling helper functions for $watch
When calling a $watch getter or listener, do not expose the inner workings with `this`.

Closes: #13909
2016-02-01 21:05:34 +01:00
Georgios Kalpakas 8bda5ec735 docs(guide/directive): minor fixes/improvements
Closes #13908
2016-02-01 15:12:19 +01:00
Wojciech Krzystek 23395ce07d docs($http): reword the XSRF attack overview
Previous version emphasised "gaining user's private data".
While this perfectly describes JSON vulnerability (which is based on XSRF),
data theft suits XSS more.
Pure XSRF is more about performing requests that have side effects.

Closes #13901
2016-01-31 13:21:33 +02:00
Prayag Verma c81c9e7cf4 docs(misc/downloading): fix typo (it --> in)
Closes #13899
2016-01-31 10:45:51 +02:00
Georgii Dolzhykov 344b4bcb95 docs(TRIAGING.md): fix a broken link
Closes #13904
2016-01-31 10:37:36 +02:00
Smith 34ba294f76 docs(error/$rootScope:inprog): fix typos ("a $apply" --> "an $apply")
Closes #13896
2016-01-31 10:32:10 +02:00
Prayag Verma 50ecc370b9 docs(guide/component): fix typo (defintion --> definition)
Closes #13898
2016-01-31 10:24:27 +02:00
Georgios Kalpakas 622c421696 fix(dateFilter, input): fix Date parsing in IE/Edge when timezone offset contains :
When `Date.parse`-ing a date string, IE and Edge don't recognize the timezone offset in the format
`+HH:mm` (but only without the `:`). According to [the spec][1], the timezone offset should
contain `:`. The [ISO 8601 Standard][2] allows both forms (with and without `:`).
Although the `Date` implementation in JavaScript does not 100% follow the ISO 8601 Standard (it's
just _based on it_), all other browsers seem to recognize both forms as well.

[1]: http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
[2]: https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC

Fixes #13880

Closes #13887
2016-01-30 00:05:49 +02:00
Dan Ryan db1180f3b3 docs(guide/component): fix fn parameter in example
The wrong field name was being passed into the `$ctrl.update` call in `heroDetail.html` resulting
in the wrong behavior (`name` was being updated instead of `location`)

Closes #13890
2016-01-29 16:48:18 +01:00
Georgios Kalpakas ca5b27bd0b fix(select): handle corner case of adding options via a custom directive
Under specific circumstances (e.g. adding options via a directive with `replace: true` and a
structural directive in its template), an error occurred when trying to call `hasAttribute()` on a
comment node (which doesn't support that method).
This commit fixes it by filtering out comment nodes in the `addOption()` method.

Fixes #13874
Closes #13878
2016-01-29 14:34:57 +02:00
Martin Staffa 3d158f629b docs(ngAnimateChildren) add docs 2016-01-28 21:14:53 +01:00
Martin Staffa 8aecf46ad2 fix(ngAnimateChildren): make it compatible with ngIf
Previously, ngAnimateChildren would set the data on the element
in an $observe listener, which means the data was available after one digest happend.
This is too late when the element is animated immediately after compilation, as happens with ngIf.
Now the data is also set right in the linking function.

Fixes #13865
Closes #13876
2016-01-28 21:14:40 +01:00
Martin Staffa 2072641537 docs(guide/component): add the component guide
- introduce components
- component types are based on Angular2 docs
- conceptually, we promote parent -> child data flow and clear inputs and outputs
- the info about multi-transclusion / requiring controllers, and components as route templates
has been moved from the component docs to the guide
2016-01-28 20:28:03 +01:00
Michael 63154c3d1a docs($compile): minor typo/style correction
Closes #13864
2016-01-28 19:18:20 +02:00
Lucas Mirelmann 37cb9ad436 fix($parse): Copy inputs for expressions with expensive checks
Closes: #13871
2016-01-28 15:33:39 +01:00
Peter Bacon Darwin 5a3504abdc docs(CHANGELOG): add changes for 1.5.0-rc.2 2016-01-28 09:51:01 +00:00
Martin Staffa 0dfc1dfebf fix(ngTouch): deprecate ngClick and disable it by default
This commit deprecates the ngClick directive from the ngTouch module.
Additionally, it disables it by default. It can be enabled in the new $touchProvider with
the $touchProvider.ngClickOverrideEnabled() method.

The directive was conceived to remove the 300ms delay
for click events on mobile browsers, by sending a synthetic click event on touchstart.
It also tried to make sure that the original click event that the browser sends after 300ms
was "busted", so that no redundant "ghost-clicks" appear.

There are various reasons why the directive is being deprecated.

- "This is an ugly, terrible hack!" (says so in the source)
- It is plagued by various bugs that are hard to fix / test for all platforms (see below)
- Simply including ngTouch activates the ngClick override, which means even if you simply want
to use ngSwipe, you may break parts of your app
- There exist alternatives for removing the 300ms delay, that can be used very well with Angular:
[FastClick](https://github.com/ftlabs/fastclick), [Tappy!](https://github.com/filamentgroup/tappy/)
(There's also hammer.js for touch events / gestures)
- The 300ms delay itself is on the way out - Chrome and Firefox for Android remove the 300ms delay
when the usual `<meta name="viewport" content="width=device-width">` is set. In IE, the
`touch-action` css property can be set to `none` or `manipulation` to remove the delay. Finally,
since iOs 8, Safari doesn't delay "slow" taps anymore. There are some caveats though, which can be
found in this excellent article on which this summary is based: http://developer.telerik.com/featured/300-ms-click-delay-ios-8/

Note that this change does not affect the `ngSwipe` directive.

Issues with interactive elements (input, a etc.) when parent element has ngClick:
Closes #4030
Closes #5307
Closes #6001
Closes #6432
Closes #7231
Closes #11358
Closes #12082
Closes #12153
Closes #12392
Closes #12545
Closes #12867
Closes #13213
Closes #13558

Other issues:
- incorrect event order
- incorrect event propagation
- ghost-clicks / failing clickbusting with corner cases
- browser specific bugs
- et al.

Closes #3296
Closes #3347
Closes #3447
Closes #3999
Closes #4428
Closes #6251
Closes #6330
Closes #7134
Closes #7935
Closes #9724
Closes #9744
Closes #9872
Closes #10211
Closes #10366
Closes #10918
Closes #11197
Closes #11261
Closes #11342
Closes #11577
Closes #12150
Closes #12317
Closes #12455
Closes #12734
Closes #13122
Closes #13272
Closes #13447

BREAKING CHANGE:

The `ngClick` override directive from the `ngTouch` module is **deprecated and disabled by default**.
This means that on touch-based devices, users might now experience a 300ms delay before a click event is fired.

If you rely on this directive, you can still enable it with the `$touchProvider.ngClickOverrideEnabled()`method:

```js
angular.module('myApp').config(function($touchProvider) {
  $touchProvider.ngClickOverrideEnabled(true);
});
```

For migration, we recommend using [FastClick](https://github.com/ftlabs/fastclick).
Also note that modern browsers remove the 300ms delay under some circumstances:
- Chrome and Firefox for Android remove the 300ms delay when the well-known `<meta name="viewport" content="width=device-width">` is set
- Internet Explorer removes the delay when  `touch-action` css property is set to `none` or `manipulation`
- Since iOs 8, Safari removes the delay on so-called "slow taps"

See this [article by Telerik](http://developer.telerik.com/featured/300-ms-click-delay-ios-8/) for more info on the topic.
Note that this change does not affect the `ngSwipe` directive.
2016-01-27 20:23:02 +01:00
Martin Staffa e9c406b246 fix($animateCss): cancel fallback timeout when animation ends normally
Previously, css animations would not cancel the timeout when the
animation ends normally (calling end explicitly / transitionEnd event).
This meant that the timeout callback fn was always called after 150% of
the animation time was over. Since the animation was already closed at this
point, it would not do any work twice, but simply remove the timer data
from the element.
This commit changes the behavior to cancel the timeout and remove the data
when it is found during animation closing.

Closes #13787
2016-01-27 19:27:34 +01:00
Matias Niemelä 79b6d55792 chore(travis): add an integration hook for the angular hubot daemon
Closes #13777
2016-01-27 17:47:33 +00:00
Georgios Kalpakas 8f94b5b277 docs(CHANGELOG): remove duplicates and fix typos
Removed some entries from `v1.5.0-beta.2` which are also included in `v1.5.0-beta.1`
and fixed some typos.

Closes #13858
2016-01-27 16:46:08 +00:00
Isaac b11120be0a docs($cookiesProvider): clarify parameters description
Fixed a grammatical mistake ("equals to"), made hyphenation consistent, fixed punctuation and
clarified the sentence structure.

Closes #13853
2016-01-27 16:30:46 +01:00
Martin Staffa bfba95ce46 docs($resource): fix an unmatched link 2016-01-27 16:30:46 +01:00
Thomas Moffett 310f80e78e docs(guide): change concepts.graffle/data.plist to fix 'World' spelling
The change is only to concepts.graffle/data.plist to fix 'World' spelling.
Another PR, #13724, already fixed the actual image.

Closes #13704
Closes #13734
2016-01-27 15:00:47 +00:00
Lucas Mirelmann acfda1022d fix($parse): Preserve expensive checks when runnning $eval inside an expression
When running an expression with expensive checks, there is a call to `$eval` or `$evalAsync`
then that expression is also evaluated using expensive checks

Closes: #13850
2016-01-27 15:30:50 +01:00
robw 04d4d93e5b docs(ngModel): add section explaining that ngModel watches by reference
The new section explains that changing only a property on an object doesn't
trigger re-rendering.

Closes #13224
Closes #13518
2016-01-27 14:24:34 +00:00
Georgios Kalpakas 8348365df9 fix($compile): properly denormalize templates when only one of the start/end symbols is different
Previously, if either of the start/end interpolation symbols remained unchanged (i.e. `{{` or `}}`),
then directive templates would not be denormalized properly. Changing only one of the start/end
symbols (but not both) is an uncommon but legitimate usecase.

Closes #13848
2016-01-26 20:16:49 +02:00
Georgios Kalpakas 16bcdcb61d docs(guide/migration): add notes for migrating from 1.4 to 1.5
Part of #13474 (includes changes up until `v1.5.0-rc.1`)
Closes #13808
2016-01-26 20:09:54 +02:00
Leo Gallucci adcfa74327 docs(guide/directives): improve Protractor test for bindings
This needs Protractor >= 1.3.0 to work.

Closes #9330
2016-01-26 15:09:02 +01:00
Michal Raczkowski d641901be6 feat($resource): add support for timeout in cancellable actions
Old behavior: actions can be either cancellable or have a numeric timeout.
When having both defined, cancellable was ignored.
With this commit: it's possible for actions to have both cancellable:true
and numeric timeout defined.

Example usage:

```js
var Post = $resource('/posts/:id', {id: '@id'}, {
  get: {
    method: 'GET',
    cancellable: true,
    timeout: 10000
  }
});

var currentPost = Post.get({id: 1});
...
// the next request can cancel the previous one
currentPost.$cancelRequest();
currentPost = Post.get({id: 2});

// any of those requests will also timeout, if the response
// doesn't come within 10 seconds
```

Closes #13824
2016-01-26 13:59:28 +02:00
Peter Bacon Darwin eae0a1121f chore(ngLocale): regenerate locales to include original localeId
Closes #13390
2016-01-26 11:27:22 +00:00
Peter Bacon Darwin 173c9063e7 style(i18n): improve indentation for readability 2016-01-26 11:27:14 +00:00
Peter Bacon Darwin b461551b81 chore(i18n): fix up i18n testing tools 2016-01-26 11:27:14 +00:00
Peter Bacon Darwin 63492a0261 feat($locale): Include original locale ID in $locale
Most systems use *IETF language tag* codes which are typically a combination
of the ISO 639 language code and ISO 3166-1 country code with an underscore
or hyphen delimiter. For example `en_US`, `en_AU`, etc.

Whilst the `$locale.id` comes close, the lowercase format makes it impossible
to transform to an IETF tag reliably. For example, it would be impossible
to deduce `en_Dsrt_US` from `en-dsrt-us`.

Closes #13390
2016-01-26 11:27:13 +00:00
Robert Reiz adb0e1746b docs(bower.json): add MIT license
Closes #13405
2016-01-26 11:03:28 +00:00
Zac Smith 3be79cd6a1 docs(tutorial): fix typo
Closes #13843
2016-01-26 11:07:58 +02:00
Martin Staffa e4c6e01791 docs($sceDelegateProvider): fix markdown errors
Closes #13360
2016-01-25 22:59:27 +01:00
Martin Staffa fb76d96009 docs(guide/interpolation): fix dangling link 2016-01-25 22:52:44 +01:00
Martin Staffa f322c4f3c3 docs(guide/directives): link to the scope property docs
Closes #12500
2016-01-25 22:52:44 +01:00
Robin Glauser 081f6ec7f2 docs(error/modulerr): add additional debugging help
This simple tip can help to diagnose the error.

Closes #12958
2016-01-25 17:07:20 +00:00
Moorzee 9bb6a30417 docs(tutorial/Tutorial): Java installation
Add step to ensure java is installed on development machine.

Closes #12938
2016-01-25 16:52:25 +00:00
marianoc84 97e97d1eb7 docs(guide/Modules): update style guide link
The linked blog post recommends John Papa's Guide.

Closes #12898
2016-01-25 16:34:16 +00:00
Lucas Galfaso 1ab4e44443 fix(dateFilter): follow the CLDR on pattern escape sequences
When there are two single quotes "''" (quotes for clarification) that are not
part of an escape sequence, then this sequence should be handled as one single
quote. See http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns
second and forth examples

Closes #12839
2016-01-25 14:54:15 +00:00
Livvie Lin 99eeec358c style(src): delete whitespace and use single quotes
This change edits syntax for code consistency.

It removes whitespace to match the style of the rest of the code,
and changes double quotes to single quotes to conform with
Google's JavaScript Style Guide.

Closes #12889
2016-01-25 14:52:29 +00:00
Tobias Leugger - Vibes ce8a7525cc docs(error/unpr): add hint about using ngStrictDi
The unknown provider error often happens when code is minified and one
did not use the correct syntax that supports minification. It's
frustrating to have to hunt for a bug in minified code, so adding the
simple hint that `ngStrictDi` will tell you what is wrong in the original
code will save you quite some trouble.

Closes #12717
2016-01-25 14:40:24 +00:00
Martin Raifer 5df2e5ce29 docs(tutorial/step-7): add troubleshooting instructions
Show troubleshooting instructions as in step 11.

Closes #12715
2016-01-25 14:37:00 +00:00
Alireza Mirian ef03dfc4a4 docs($injector): fix inaccuracy in $provide.service docs
Closes #12664
Closes #12665
2016-01-25 14:33:16 +00:00
Wesley Cho 4ff9c027b0 docs(compile): improve nonassign error message
- Improve error message to mention attribute the expression errored on

Fixes #13827

Closes #13828
2016-01-24 17:17:35 +01:00
Matias Niemelä 20b8ece444 fix(ngAnimate): properly cancel-out previously running class-based animations
Prior to this fix the addition and removal of a CSS class via
ngAnimate would cause flicker effects because $animate was unable
to keep track of the CSS classes once they were applied to the
element. This fix ensures that ngAnimate always keeps a reference
to the classes in the currently running animation so that cancelling
works accordingly.

The commit also adds a test for a previously untested animation merge path.

Closes #10156
Closes #13822
2016-01-23 16:28:51 +01:00
Qingyu Zhou 6406e3b01d docs(tutorial/step_12): change "click" to "hover"
Should be "hover" not "click", since we trigger the change at "mouseenter", not "click".

Closes #13831
2016-01-23 14:21:24 +02:00
Lucas Mirelmann 234053fc9a fix(ngSanitize): Blacklist the attribute usemap
Given that the attribute `name` is blacklisted, the attribute `usemap` should be
blacklisted too.

Closes: ##13826
2016-01-22 21:16:31 +01:00
Josh Duff a277bcf0f7 refactor(equals): Cleanup equals function for readability
- Removes unnecessary nested if condition
- Simplify check when one argument is a regex

Closes: #13650
2016-01-22 20:52:38 +01:00
Peter Bacon Darwin 7985416d39 docs(CHANGELOG): fix animation grouping 2016-01-21 14:30:35 +00:00
Peter Bacon Darwin dc3013e848 docs(CHANGELOG): add release notes for 1.4.9 2016-01-21 12:42:44 +00:00
Edgar Flores 0f2926db38 docs(guide/Interpolation): fix links
The links were not working, either `{` was missing or they were in the wrong location

Closes #13809
2016-01-20 21:04:50 +01:00
Lucas Galfaso bd59335eba test(input): test for #12106
Add a test that checks that an <input> value is not set when the value is equal
to the current value

Closes #12592
2016-01-20 15:11:07 +00:00
Adrian Roselli 6aa111b333 docs(tutorial/step-6): add alt attribute to images
See http://www.ssbbartgroup.com/blog/accessible-images-using-angular/

Closes #12569
2016-01-20 14:50:53 +00:00
Martin Staffa 42b5ce99fb docs(guide/filter): clarify how to use filters in controllers
Closes #11915
2016-01-20 10:41:15 +01:00
Matias Niemelä 2cb1989d12 chore($AnimateRunner): examine the document more carefully
Some internal tests were failing because the `$document[0]` value
was null. This fix ensures that the if statement surrounding that
is more careful.
2016-01-19 13:27:38 -08:00
Martin Staffa 1137d91abd docs(ngRepeat): point out animate example, remove ng-init
Closes #9047
2016-01-19 20:09:29 +01:00
Maxime Lasserre 288e4e33c3 docs($animate): make naming consistent
In the description of the example, you use `element` to refer to the container parameter and
`listenerFn` to refer to the callback parameter.

Closes #12716
2016-01-19 20:09:29 +01:00
Daniel Herman d98c5f03a4 chore($compile): remove an unused dependency
Fixes #13791

Closes #13801
2016-01-19 20:25:36 +02:00
Peter Bacon Darwin 8d20b04f1c docs($compile): fix typo 2016-01-19 18:07:25 +00:00
Peter Bacon Darwin 56c3666fe5 feat($compile): allow required controllers to be bound to the directive controller
If directives are required through an object hash, rather than a string or array,
the required directives' controllers are bound to the current directive's controller
in much the same way as the properties are bound to using `bindToController`.

This only happens if `bindToController` is truthy.

The binding is done after the controller has been constructed and all the bindings
are guaranteed to be complete by the time the controller's `$onInit` method
is called.

This change makes it much simpler to access require controllers without the
need for manually wiring them up in link functions. In particular this
enables support for `require` in directives defined using `mod.component()`

Closes #6040
Closes #5893
Closes #13763
2016-01-19 18:07:24 +00:00
Peter Bacon Darwin cd21216ff7 feat($compile): allow require to be an object
This provides an elegant alternative to the array form of the `require`
property but also helps to support binding of `require`d controllers
to directive controllers.

Closes #8401
Closes #13763
2016-01-19 18:06:50 +00:00
Peter Bacon Darwin 3ffdf380c5 feat($compile): call $ngOnInit on directive controllers after controller construction
This enables option three of https://github.com/angular/angular.js/issues/13510#issuecomment-164140194
by allowing the creator of directive controllers using ES6 classes to have a hook
that is called when the bindings are definitely available.

Moreover this will help solve the problem of accessing `require`d controllers
from controller instances without resorting to wiring up in a `link` function.
See https://github.com/angular/angular.js/issues/5893

Closes #13763
2016-01-19 18:06:30 +00:00
Peter Bacon Darwin db5e0ffe12 fix($compile): handle boolean attributes in @ bindings
Closes #13767
Closes #13769
2016-01-19 16:35:37 +00:00
Daniel Herman 92e4801d88 perf($compile): avoid needless overhead when wrapping text nodes
This commit positively affects performance in two main ways:

1,  When wrapping text nodes in the compile step, we do not need the overhead
of the `forEach` function versus a normal for loop since we do not make
use of the closure for anything.

2.  When actually wrapping the node, we can completely bypass jqLite which
avoids several function calls and the overhead of cloning the wrapper node
which we already know to be unique.

Tests in applications show about an 83% decrease in time spent in this
specific loop.
2016-01-19 16:24:53 +00:00
thorn0 6a92e9111f docs(uppercase, lowercase): undocument these artifacts
Closes #11387
Closes #13779
2016-01-19 16:12:11 +00:00
Georgios Kalpakas ba6d37756e docs(ngModel): rename $asyncValidators error to nopromise and add missing error page
Closes #13795
2016-01-19 16:05:45 +02:00
Martin Staffa 683bd92f56 perf(ngAnimate): speed up areAnimationsAllowed check
This commit speeds up the code that checks if an element can
be animated, for the following two cases:

The checks will be sped up in cases where the animation
is disabled via $animate.enabled(element, false) on any parent element.

A minor speed-up is also included for cases where the $rootElement of the
app (the bootstrap element) is on the body or lower in the DOM tree.
2016-01-19 13:14:04 +01:00
Martin Staffa 7700e2df09 fix($animate): correctly handle $animate.pin() host elements
This commit fixes two bugs:
1) Previously, animate would assume that a found host element
was part of the $rootElement (while it's possible that it is also outside the root).

2) Previously, if a parent of the animated element was pinned to a host element, the
host would not be checked regarding animations enabled status etc.

Closes #13783
2016-01-19 13:14:04 +01:00
Martin Staffa 3fb809e412 docs($compile): correct transcludeControllers definition
Closes #13793
2016-01-19 12:08:08 +01:00
Matias Niemelä 52ea4110d3 fix(ngAnimate): ensure that animate promises resolve when the document is hidden
Prior to this fix any promise/callback chained on a call to the $animate
methods would only flush if and when the browser page is visible. This
fix ensures that a timeout will be used instead when the document
is hidden.
2016-01-17 20:00:49 +01:00
Matias Niemelä a3a7afd3aa fix(ngAnimate): do not trigger animations if the document is hidden
Prior to this fix, ngAnimate would always trigger animations even if
the browser tab or browser window was not visible. This would cause
issues with class updates / DOM operations even if elements were not
using animations. The root cause is that browsers do not flush calls to
requestAnimationFrame when browser windows / tabs are not visible.

This fix disables animations if `document.hidden` is `true`.

Closes #12842
Closes #13776
2016-01-17 20:00:41 +01:00
Martin Staffa 20bc37fbc8 chore(benchmark): improve largetable layout 2016-01-17 19:55:39 +01:00
Martin Staffa 7761b6c3b0 docs(CHANGELOG): add missing breaking changes for 1.5.0-rc.1, fix layout
- add missing component() breaking changes
- put component related feats/fixes under "component"
- move features above fixes
2016-01-17 19:26:23 +01:00
Peter Bacon Darwin b77e14beea docs(CHANGELOG): add missing breaking change to 1.5.0-rc.1 2016-01-15 20:31:08 +00:00
Matias Niemelä a1f461e429 chore(CHANGELOG): update with changes for 1.5.0-rc.1 2016-01-15 08:35:19 -08:00
Georgios Kalpakas 13587193a5 docs(CHANGELOG.md): add BC notice for b71d7c3f
Closes #13759
2016-01-14 14:44:05 +00:00
Peter Bacon Darwin a1ff35850c test($log): fix up to work with Safari 9
On Safari 9.0.2, you are not allowed to write to `sourceUrl` or `line`
on a native Error object.

This commit uses a custom error instead.
2016-01-14 12:40:18 +00:00
Peter Bacon Darwin 95b3e1ce6c chore(doc-gen): filter out componentGroup doc types from search results
These doc types do not contain useful information from the point of view
of search results and are making the results less clear
2016-01-13 13:59:01 +00:00
Martin Staffa b78b12976a docs($animate): correct fn parameters for js animation 2016-01-12 23:25:59 +01:00
Martin Staffa a31c082de6 docs($animate): clarify info about from and to for animate()
Closes #11150
2016-01-12 23:03:58 +01:00
dmitriz 5afd54514d docs(CONTRIBUTING): add warning about forced push
Add warning about the possible consequences of a forced push

Closes #13747
2016-01-12 18:02:52 +00:00
David Rodenas Pico 72b96ef57a refact(ngMock.$componentController): use $injector instead of adding new code to angular.min.js
Closes #13742
2016-01-12 13:29:54 +00:00
Peter Bacon Darwin 90975db5f9 feat($compileProvider): allow component() helper to copy over custom annotations
Closes #13741
2016-01-12 12:48:08 +00:00
Peter Bacon Darwin 25bc531802 fix($compileProvider): remove the ability to set the restrict option on component() helper
Closes #13741
2016-01-12 12:48:00 +00:00
Georgios Kalpakas 4e1b36c216 fix($controller): allow identifiers containing $
As discussed in https://github.com/angular/angular.js/issues/13664#issuecomment-170536024.

Closes #13736
2016-01-11 21:23:37 +00:00
Matias Niemelä d4fa331308 fix(ngAnimate): only copy over the animation options once
A bug in material has exposed that ngAnimate makes a copy of
the provided animation options twice. By making two copies,
the same DOM operations are performed during and at the end
of the animation. If the CSS classes being added/
removed contain existing transition code, then this will lead
to rendering issues.

Closes #13722
Closes #13578
2016-01-11 21:54:49 +01:00
Martin Staffa a801df719e fix(ngMock): ignore empty javascript animations in $animate.closeAndFlush() 2016-01-11 21:54:49 +01:00
Georgios Kalpakas cb74999b17 test: fix failing tests on MS Edge
Includes the following fixes (per component):

* `$sniffer`: Properly determine the expected `vendorPrefix` for MS Edge
* `input`: MS Edge does not support dates with years with more than 4 digits.
      Trying to set the value of an `input[datetime-local]` to `9999-12-31T23.59.59.999` throws an
      error (probably related to converting the date to one with a year with more than 4 digits,
      due to timezone offset).
* `$sanitize`: Fix failing tests on MS Edge
* `$animateCss`: Although the detected `vendorPrefix` for MS Edge is "ms", it doesn't seem to
      recognize some vendor-prefixed CSS rules (e.g. `-ms-animation-*`). Other browsers (currently)
      recognize either vendor-prefixed rules only or both.
      Fixed by adding and retrieving styles using both prefixed and un-prefixed names.
* `$compile`: Skip failing `foreignObject` test on MS Edge.
      For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge has no
      size, causing the included `<circle>` element to also have no size and thus fails an
      assertion (relying on the element having a non-zero size).
      This seems to be an MS Edge issue; i.e. it is also reproducible without Angular.
      (Tested with MS Edge version 25.10586.0.0 on Windows 10.)

Closes #13686
2016-01-11 15:50:53 +02:00
Georgios Kalpakas 2764536e8f refct(privateMocks): remove unused argument from createMockStyleSheet() 2016-01-11 15:49:51 +02:00
Peter Bacon Darwin 8ccc0547a8 docs(examples): add copyright and license info to each plunker file
Closes #13729
2016-01-10 19:47:26 +00:00
Peter Bacon Darwin dd14e0c44d feat(ngMock.$componentController): add helper to instantiate controllers for components
Closes #13683
Closes #13711
2016-01-10 19:19:03 +00:00
mohamed amr 7e24590fa3 test(ngList): add missing '>' to textarea closing tag
Fixes #13728
Closes #13727
2016-01-10 17:55:40 +02:00
Matias Niemelä 8b6360338d fix($animate): allow enabled children to animate on disabled parents
Prior to this fix if a parent container disabled animations for
itself then no children could be enabled explicity via
`$animate.enabled`. This patch allows for that to work.

Closes #13179
Closes #13695
2016-01-09 14:59:34 +01:00
Shahar Talmi d91cf16796 feat(component): default controllerAs to be $ctrl
Closes #13664
Closes #13710
2016-01-08 14:37:25 +00:00
Shahar Talmi f31c5a3924 feat(component): disallow non-isolate scopes
Closes #13710
2016-01-08 14:36:55 +00:00
Peter Bacon Darwin 16ccac91d0 test($compile): fix component helper test
The test was expecting to match an object containing a `transclude`
property set to `false` but now the property is `undefined`.
2016-01-08 12:51:09 +00:00
Peter Bacon Darwin 91b080e6e6 docs(tutorial/step-00): fix dangling link 2016-01-08 12:30:48 +00:00
Martin Staffa feeb19787c refactor(loader): move component definition code to the $compileProvider
The `Module.component()` helper now delegates to `$compileProvider.component()`.

This has the following benefits:

- when using only the loader, we are not accessing out of scope variables / functions
- components can be registered via $compileProvider
- docs are a bit easier to find
- it is easier to keep the Batarang version of the loader up to date if there is minimal
  code in that file.

Closes #13692
2016-01-08 12:27:37 +00:00
Georgios Kalpakas 98c2db7f9c fix(linky): throw error if input is not a string
BREAKING CHANGE:

Before this change, the filter assumed that the input (if not undefined/null) was of type 'string'
and that certain methods (such as `.match()`) would be available on it. Passing a non-string value
would most likely result in a not-very-useful error being thrown (trying to call a method that does
not exist) or in unexpected behavior (if the input happened to have the assumed methods).

After this change, a proper (informative) error will be thrown. If you want to pass non-string
values through `linky`, you need to explicitly convert them to strings first.
Since input values could be initialized asynchronously, `undefined` or `null` will still be
returned unchanged (without throwing an error).

Closes #13547

Closes #13693
2016-01-08 12:53:08 +02:00
Peter Bacon Darwin 06aa52efff chore(package): update karma to 0.13
This version of karma can sniff Microsoft Edge correctly.

Closes #13691
2016-01-07 20:17:49 +00:00
Lucas Mirelmann fabc6ab5b0 fix($injector): workaround for MS Edge class detection
Fix for MS Edge class detection

Closes: #13697
2016-01-07 20:53:16 +01:00
Georgios Kalpakas 93c7251f5f fix(isArrayLike): recognize empty instances of an Array subclass
Fixes #13560
Closes #13708
2016-01-07 19:43:22 +00:00
Matias Niemelä e1def1b8fe feat(ngMock): add support for $animate.closeAndFlush()
Use `$animate.closeAndFlush()` to close all running animations.

Closes #13005
Closes #13576
Closes #13707
2016-01-07 14:53:10 +01:00
Martin Staffa e5cab951f4 fix(ngAnimate): allow event listeners on document in IE
Fixes #13548
Closes #13696
2016-01-07 13:03:50 +00:00
Martin Staffa f7eab8d8fe fix(select): re-define ngModelCtrl.$render in the select postLink fn
Previously, the `$render` function was re-defined in the `select` directive's
`preLink` function. When a `select` element is compiled, every `option`
element inside it is linked and registered with the `selectCtrl`, which
calls `$render` to update the selected `option`. `$render` calls `selectCtrl.writeValue`,
which adds an unknown `option` in case no option is selected. In cases where
`optgroup` elements are followed by a line-break, adding the unknown `option`
confuses the html compiler and makes it call the link function of the following
`option` with a wrong element, which means this option is not correctly
registered.
Since manipulation of the DOM in the `preLink` function is wrong API usage,
the problem cannot be fixed in the compiler.

With this commit, the `$render` function is not re-defined until the `select` directive's
`postLink` function, at which point all `option` elements have been linked
already.

The commit also changes the `toEqualSelectWithOptions` matcher to
take selected options in groups into account.

Closes #13583

Closes #13583
Closes #13663
2016-01-07 12:06:13 +00:00
Martin Staffa 495d40d802 docs($compile): add docs for bindToController with object hash
Closes #13228
Closes #13625
Closes #13658
Closes #13681
2016-01-06 16:17:05 +01:00
Georgios Kalpakas d28ae2126e docs(validators): fix typos and make minor layout improvements 2016-01-06 13:53:37 +02:00
Lucas Mirelmann 8955cfb646 feat($compile): Allow ES6 classes as controllers with bindToController: true
Modify `$injector.invoke` so ES6 classes would be invoked using `new`

Closes: #13510
Closes: #13540
Closes: #13682
2016-01-05 22:35:57 +01:00
Martin Staffa 776972ed9c fix(ngAnimate): allow removing classes that are added by a running animation
This allows follow-up animations to remove a class that is currently
being added.

Fixes #13339
Fixes #13380
Closes #13414
Closes #13472
Closes #13678
2016-01-05 21:31:26 +00:00
Peter Bacon Darwin 1358b3ca9b chore(saucelabs): update to latest sauce version 2016-01-05 14:46:14 +00:00
Matias Niemelä e020b8993e fix(ngAnimate): do not use event.timeStamp anymore for time tracking
Due to recent changes in Chrome, Firefox and Webkit use of the
event.timeStamp value will lead to unpredictable behaviour due to
precision changes. Therefore it's best to stick entirely to use
`Date.now()` when it comes to confirming the end of transition-
ending values. See #13494 for more info.

Applies to 1.2, 1.3, 1.4 and 1.5.

Closes #13494
Closes #13495
2016-01-05 12:43:48 +00:00
Andy Patterson b2b896f949 test(booleanAttrsSpec): add unit test for IE11 URL parsing failure
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence

See #13388
Closes #13458
2016-01-05 12:09:15 +00:00
Konstantin Ulitin 3c5827b6f5 docs(loader): fix type in @return tag for angular.module()
Closes #13655
2016-01-05 11:57:30 +00:00
Waitaya Krongapiradee 0e03644dad docs(error/$rootScope/inprog): add missing "$timeout"
Closes #13630
2016-01-04 22:20:47 +00:00
Kyle Pittman 112024271b docs(tutorial/2): add e2e test missing filename
Add `__`test/e2e/scenarios.js`:__` to denote which file we should change
to add the behavioral tests.

Closes #13673
2016-01-04 22:10:43 +00:00
Peter Bacon Darwin bca0a1f786 revert: feat($compile): Allow ES6 classes as controllers with bindToController: true
This change caused IE9 to run out of memory.

This is reverted from commit b0248b7894
2016-01-04 21:48:19 +00:00
Martin Staffa 959f2bbb2d fix($animateCss): only (de)register listeners when events have been added
Previously, when an animation was closed because no animation styles
where found, it would call .off() with an empty string as the argument.

For both jquery/jqlite this is the same as calling .off() without any
argument, which deregisters all event listeners on an element.

Closes #13514
2016-01-04 21:01:45 +01:00
Sébastien Arod 6a47c0d75d fix(loader): use false as default value for transclude in component helper
The default value of for transclude in component helper is now `false`.

The change is motivated by the fact that using `transclude: true` when not necessary
made component unusable in conjunction with structural directives that also require
transclusion such as `ng-switch-when` and `ng-repeat`.

Closes #13566
Closes #13581

BREAKING CHANGE:
Angular 1.5.0.beta.2 introduced the `module.component` helper where `transclude` was true by default.
This changes the default for `transclude` to `false`. If you created components that expected
transclusion then you must change your code to specify `transclude: true`.
2016-01-04 16:24:51 +00:00
Lucas Mirelmann b0248b7894 feat($compile): Allow ES6 classes as controllers with bindToController: true
Modify `$injector.invoke` so ES6 classes would be invoked using `new`

Closes: #13510
Closes: #13540
2016-01-03 14:16:52 +01:00
Ieuan Griffiths 6fd41e7f59 chore(*): Updated year in licence
Closes: #13661
2016-01-02 20:40:55 +01:00
Martin Staffa 3297bbd188 docs: reorganize information about interpolation
- Move interpolation info from Directive guide into new interpolation guide
- Add information about boolean attributes to interpolation guide
- remove wroong examples from prefixed boolean attribute docs, link
to interpolation guide instead
- mention additional examples for attributes that benefit from ngAttr
- add docs for ngRequired directive
2015-12-31 18:11:43 +01:00
Martin Staffa 8863836cd4 docs: add docs for ngPattern, ngMinlength, ngMaxlength
Closes #9991
2015-12-31 18:11:43 +01:00
Martin Staffa b8fb0c4573 docs($interpolateProvider): remove superfluous ng-app attribute
The example processor is adding the module attr in the example tag as
the ng-app attr on the body.

Closes #13608
2015-12-31 18:11:43 +01:00
Waitaya Krongapiradee 17b700a339 docs(tutorial): fix some minor punctuation errors
Closes #13633
2015-12-31 18:11:43 +01:00
ammills01 811b20e3b9 docs(tutorial/6 - Templating Links): fix grammar
Corrected the grammar on line 62 by adding the word 'an' which forced
me to move 'only' down to line 63.

Closes #13651
2015-12-31 18:11:43 +01:00
Wesley Cho 5ded3d3e73 docs($resource): fix wording for failure
- Fix mention of promise resolution on failure: resolved -> rejected

Closes #13638
Closes #13624
2015-12-31 18:11:43 +01:00
Jason Bedard 986647a968 fix(copy): add support for ArrayBuffer, handle multiple references to ArrayBuffer
Closes: #13640
2015-12-31 16:35:26 +01:00
Jason Bedard 7b51243be5 fix(copy): add support for String/Boolean/Number object types
Closes: #13641
2015-12-30 12:57:34 +01:00
Martin Staffa 798fb18542 docs(Module): clarify that component's template(Url) fn is injectable
Related #13485
2015-12-20 22:37:05 +01:00
Shahar Talmi 99d601a048 fix(Module): allow passing template/templateUrl in array notation
Close: #13485
2015-12-20 21:06:17 +01:00
thorn0 a6e9174a27 refactor($parse): remove unnecessary check
Closes: #13588
2015-12-19 11:09:25 +01:00
thorn0 dec8a0eb72 refactor($parse): remove unused variables
Closes: #13579
2015-12-18 13:56:37 +01:00
Alexander Zagumennikov 98776487a0 fix(ngInclude): do not compile template if original scope is destroyed
With slow internet connection scope may be destroyed before template is loaded.
Previously in this case ngInclude compiled template that leaded to memory leaks
and errors in some cases.

Closes: #13515
Closes: #13543
2015-12-18 12:30:28 +01:00
thorn0 b3ef5e0852 fix($q): make instanceof work for $q promises
Closes: #13574
Closes: #13545
2015-12-18 12:24:23 +01:00
mkalish 04efdd5bfa docs(ngMock): update $http example to use standard promise syntax
Examples were using deprecated .success and .error rather .then

Closes #13557
2015-12-17 22:15:36 +00:00
Peter Bacon Darwin 9f5d76e16b chore(Gruntfile): replace double quotes with single quotes 2015-12-17 22:05:07 +00:00
Peter Bacon Darwin 525be5b7d4 chore(GruntFile): fix whitespace in lists 2015-12-17 22:05:07 +00:00
Peter Bacon Darwin 042e0f1f0a chore(GruntFile): move validate-angular-files task into its own file
Closes #13569
2015-12-17 22:05:07 +00:00
Matias Niemelä 03872983a4 chore(build): add a validation step for angularFiles
Closes #13553
2015-12-17 22:04:46 +00:00
Peter Bacon Darwin 62f79e820f chore(angularFiles): add documentation only file to list of files
This prevents errors when checking `validate-angular-files`
2015-12-17 22:02:05 +00:00
Peter Bacon Darwin e5c26e92cc chore(npm-shrinkwrap): install glob package 2015-12-17 22:02:05 +00:00
Peter Bacon Darwin 4bcb307abc chore(jenkins): remove unused argument definition 2015-12-17 14:15:13 +00:00
Peter Bacon Darwin 0e729e1dd5 chore(jenkins): run Jenkins builds on Node 4 (via nvm)
Closes #13568
2015-12-17 14:07:03 +00:00
Peter Bacon Darwin 9bb184d181 chore(jenkins): move jenkins_build.sh to scripts/jenkins/build.sh 2015-12-16 14:22:26 +00:00
Georgios Kalpakas a7a053f5be docs($compile): fix scope hierarchy indentation in HTML output 2015-12-16 15:27:37 +02:00
Peter Bacon Darwin 9630159444 chore(travis): update to use node 4.x 2015-12-16 10:42:54 +00:00
Georgios Kalpakas e3be5d6efa fix(input): fix URL validation being too strict
Background:
Prior to ffb6b2f, there was a bug in `URL_REGEXP`, trying to match the hostname as `\S+` (meaning
any non-space character). This resulted in never actually validating the structure of the URL (e.g.
segments such as port, path, query, fragment).
Then ffb6b2f and subsequently e4bb838 fixed that bug, but revealed `URL_REGEXP`'s "strictness" wrt
certain parts of the URL.

Since browsers are too lenient when it comes to URL validation anyway, it doesn't make sense for
Angular to be much stricter, so this commit relaxes the "strictness" of `URL_REGEXP`, focusing more
on the general structure, than on the specific characters allowed in each segment.

Note 1: `URL_REGEXP` still seems to be stricter than browsers in some cases.
Note 2: Browsers don't always agree on what is a valid URL and what isn't.

Fixes #13528

Closes #13544
2015-12-16 12:36:28 +02:00
Georgios Kalpakas c2173c1298 test(privateMocks): allow replacing $prop with strings with special RegExp semantics
`baseThey` used to construct the testcase description by replacing `$prop` using a RegExp.
If the replacement string contained `$&` (which has a special meaning with RegExps), the resulting
string was not as expected.x
2015-12-16 12:36:28 +02:00
Martin Staffa 0b94e8a8bf chore(travis): add a new job that runs ci-checks
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
https://github.com/angular/angular.js/pull/9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
2015-12-16 10:17:12 +00:00
Justas Brazauskas 983374c574 docs: fix typos throughout the codebase
Closes #13519
2015-12-15 21:52:47 +02:00
Peter Bacon Darwin 05d3ed0d9b docs(error/isecwindow): add note about coffeescript issue
Closes #4853
2015-12-15 10:39:44 +00:00
Georgios Kalpakas 1b25f80cd2 docs(form): remove mention of interpolated control names not being supported
The docs state that interpolation cannot be used in control names.
This used to be true, but not anymore.

Closes #13520
2015-12-14 11:00:50 +02:00
Lucas Mirelmann 6cdbda7cf1 fix($compile): Add missing variable declaration
Closes: #13521
Closes: #13525
2015-12-13 12:27:08 +01:00
Philip Harrison c9e6cf9be0 fix($compile): Fix namespace detection for achor elements
Closes: #13480
2015-12-13 10:39:38 +01:00
Georgios Kalpakas c7ed8a33af docs(component): add examples on how to use components with ngRoute
Closes #13498
2015-12-11 23:54:25 +02:00
Georgios Kalpakas 6988667e5e docs($routeProvider): document resolveAs and assiging resolve map on scope
Related to #13400.
2015-12-11 23:54:25 +02:00
Justas Brazauskas e57cf13d5d docs: fix typos throughout the codebase
Closes #13507
2015-12-11 21:04:18 +02:00
ReneFerwerda e4e5677fbd docs(select): fix typo
Closes #13491
2015-12-10 22:29:46 +02:00
Martin Probst 8b6b428271 feat($injector): support instantiating classes.
ES6's `class Foo {}` constructors cannot be instantiated using
`fn.apply`. This change extracts injection argument collection and then
uses new (Function.bind.apply(ctor, args)) to instantiate the service
instance.

Closes: #12598
Closes: #12597
2015-12-10 21:17:42 +01:00
Martin Staffa 8f0b482596 fix($animate): allow animations when pinned element is parent element
Previously, the animate queue would only detect pinned elements when
they were the same element as the to-be-animated element.

Related #12617
Closes #13466
2015-12-10 14:24:28 +01:00
Martin Staffa 6428ed5bb5 test($animate): ensure that pin() arguments are elements 2015-12-10 14:24:28 +01:00
Martin Staffa bc41ad8aa8 fix($animate): correctly access minErr
ngMinErr is available during unit tests, but not in the build. There's
currently no way to catch these access errors in automated testing.
2015-12-10 14:24:28 +01:00
Martin Staffa 6858caf251 fix(ngOptions): don't skip optgroup elements with value === ''
Internet Explorer 11 returns '' for optgroup elements without a value
attribute. We only want to skip option elements with value ''

Fixes #13487
Closes #13489
2015-12-10 14:22:33 +01:00
Martin Staffa 20604e7fc4 fix($animateCss): remove animation end event listeners on close
Previously the transition/animation end events were not removed when the
animation was closed. This normally didn't matter, because
the close function knows the animations are closed and won't do work
twice.
However, the listeners themselves do computation that could fail when
the event was missing some data, for example when the event was
triggered instead of natural.

Closes #10387
2015-12-10 14:04:02 +01:00
Matias Niemelä b7b06d8477 revert: fix($animateCss): respect transition styles already on the element 2015-12-09 16:51:21 -08:00
Martin Staffa de9777d819 fix($animateCss): respect transition styles already on the element
Previously, $animateCss wouldn't use transition styles that were on the element
before the animation process started. Precisely, transition property, timing-function
and delay were overwritten in the process.

Closes #12656
Closes #13333
2015-12-09 13:47:29 -08:00
Peter Bacon Darwin 1b06f33f30 chore(package): ensure branch version is good to fix docs 2015-12-09 15:01:01 +00:00
Peter Bacon Darwin ca6e266869 docs(CHANGELOG): fix typo 2015-12-09 14:07:43 +00:00
Peter Bacon Darwin 23c4ae522a chore(package.json): update version branch information 2015-12-09 13:50:58 +00:00
Peter Bacon Darwin 3112f8e910 docs(CHANGELOG): add 1.5.0-rc.0 changes 2015-12-09 13:45:50 +00:00
Matias Niemelä 21ab82906e chore(angularFiles): the animateRunner.js file doesn't exist for ngAnimate anymore 2015-12-08 13:57:18 -08:00
Peter Bacon Darwin 1dd206ef85 fix($compile): revert allowing non-normalized element names in transclude map
Closes #13455
2015-12-08 16:29:19 +00:00
Georgios Kalpakas da5db4b1b3 docs($resource): re-phrase note in the docs (has to --> would)
As discussed in https://github.com/angular/angular.js/pull/13462#discussion_r46891840.
2015-12-08 17:53:57 +02:00
Georgios Kalpakas 3694390c90 docs($resource): re-phrase warning message (has to --> would)
As discussed in https://github.com/angular/angular.js/pull/13462#discussion_r46891840.
2015-12-08 17:06:19 +02:00
Martin Staffa 36a3c81177 docs(guide/migration): add info for 1.3 checkbox breaking change
Introduced in commit https://github.com/angular/angular.js/commit/c90cefe16142d973a123e945fc9058e8a874c357

Closes #13464
2015-12-08 13:20:27 +01:00
Georgios Kalpakas b0e7d548d0 docs(guide/migration): better describe what the BC in c054288c is about
Also, updated the corresponding entry in changelog.
This came up in
https://github.com/angular/angular.js/commit/c054288c9722875e3595e6e6162193e0fb67a251#commitcomment-14783993.
2015-12-08 09:29:06 +02:00
Andy Patterson e4bb838795 fix(input): add missing chars to URL validation regex
Update the list of permitted chars in URLs.

Closes #13379
Closes #13460
2015-12-07 22:31:03 +02:00
Lucas Mirelmann 0ea535035a feat($parse): provide a mechanism to access the locals object
Extends the built-in identifiers definitions by adding `$local`. This is a
non-assignable reference to the locals object.

Closes: #13247
Closes: #13454
2015-12-07 20:21:17 +01:00
Georgios Kalpakas e9aba90f7f docs(guide/$location): fix table header formatting
Closes #13456

Closes #13459
2015-12-07 19:20:05 +02:00
Martin Staffa f50b0cb393 docs(guide/Unit Testing): fix typo
Closes #13227
2015-12-07 14:26:17 +01:00
zainengineer 8b3bec7e07 docs(orderBy): make examples consistent
Updated example which manually injects the filter.
It matches sibling example in functionality.

Also put  html, js and css into separate files.

Also change anchors to buttons.

Closes #13402
2015-12-07 14:21:54 +01:00
Hovhannes Babayan 6752337629 docs(guide/Expressions): note that new operator is unavailable
You cannot create new objects inside Angular expressions. For example:
{{ new Date() }} expression fails.
2015-12-07 13:53:22 +01:00
Martin Staffa 48ad7486d9 docs(changelog, guide/migration): add BC notes for observing unset attributes
Closes #11163
2015-12-07 13:38:42 +01:00
Mil4n 341b834229 docs(tutorial/step_08): fix tense
The original statement is in the past tense (as if it were referring to a previous step of the
tutorial). The mentioned changes, however, are being done in this setp.

Closes #13452
2015-12-07 13:36:27 +02:00
Peter Bacon Darwin 7a668cdd7d fix($sanitize): blacklist SVG <use> elements
The use element can reference external svg's (same origin) and can include
xlink javascript urls or foreign object that can execute xss.

This change disallows `<use>` elements in sanitized SVG markup.

An example of a malicious SVG document would be:

SVG to sanitize:
```
<svg><use xlink:href="test.svg#xss" /></svg>
```

External SVG file (test.svg)
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg" width="100"
   height="100"
   id="xss">
<a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="javascript:alert(1)">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</a>
</svg>
```

Here the SVG to sanitize loads in the `test.svg` file via the `<use>` element.
The sanitizer is not able to parse this file, which contains malicious
executable mark-up.

This can only be taken advantage of if the external file is available via the
same origin restrictions in place.

Closes #13453

BREAKING CHANGE:

The `<use>` element is now removed from SVG passed to the `$sanitize` service.

This element is only used to import external SVG resources, which is a security
risk as the `$sanitize` service does not have access to the resource in order
to sanitize it.
2015-12-06 14:13:39 +00:00
Lucas Mirelmann 5a674f3bb9 fix($parse): prevent assignment on constructor properties
Prevent malicious attacks involving assignment on `constructor` properties.

Closes #13417
2015-12-06 14:06:26 +00:00
Peter Bacon Darwin e94b37e20e docs(ngTransclude): add better multi-slot translusion docs 2015-12-04 21:44:28 +00:00
Peter Bacon Darwin f5ebcbacf8 docs($compile): add better multi-slot transclusion information 2015-12-04 21:44:28 +00:00
Peter Bacon Darwin 0812af49bd feat(ngTransclude): don't overwrite the contents with an unfilled optional slot
Previously the contents of the `ngTransclude` element would always be emptied,
even if there was no transclusion to replace it.
Now, optional slots that have not been filled with content will not cause
the `ngTransclude` contents to be emptied.

Closes #13426
2015-12-04 21:42:07 +00:00
Dmitrij Maslov c3ae6ed78e fix(ngTransclude): don't replace existing content if no transcluded content exists
Closes #11839
2015-12-04 21:23:38 +00:00
Peter Bacon Darwin c3a2691115 fix($compile): swap keys and values for transclude definition object
Closes #13439
2015-12-04 21:23:38 +00:00
Marcus Nielsen 6976d6d8d8 docs($resource): fix mixed singular/plural
"any of the parameter value" contains plural (any of the) as well as singular (value).
Fixed to be singular to match the rest of the text block.

Closes #13448
2015-12-04 20:49:55 +00:00
Andy Gurden b75c0d8d05 feat(ngMock): destroy $rootScope after each test
Previously $rootScope would be new for each test, but old $rootScopes would never be destroyed.
Now that we are able to destroy the $rootScope, doing so provides an opportunity for code to clean
up things like long-lived event handlers between tests.

Closes #13433
2015-12-04 20:47:26 +00:00
Peter Bacon Darwin df6fade6e6 fix($compile): include non-elements in default transclusion slot
See https://github.com/angular/angular.js/commit/a4ada8ba9c4358273575e16778e76446ad080054#commitcomment-14738387
2015-12-04 13:06:28 +00:00
Shahar Talmi 983b059812 feat(ngView): reference resolved locals in scope
All the resolves for a route are now attached to the route's local scope,
as the property whose name is given by the `resolveAs` property on the
route definition.

If `resolveAs` is not specified it defaults to `$resolve`.

This will make it easier to use `ngRoute`, by being able to reference all
the resolve values for the route, directly on the scope, rather than having
to implement a controller just to copy the resolves across manually.

For example, rather than

```js
$routeProvider.when('/', {
  resolve: {
    item1: ($http) => $http.get(...),
    item2: ($http) => $http.get(...)
  },
  template: '<my-app item1="vm.item1" item2="vm.item2">'</my-app>`,
  controllerAs: 'vm',
  controller: ['item1', 'item2', function(item1, item2) {
    this.item1 = item1;
    this.item2 = item2;
  }]
});
```

one can now do

```js
$routeProvider.when('/', {
  resolve: {
    item1: ($http) => $http.get(...),
    item2: ($http) => $http.get(...)
  },
  template: '<my-app item1="$resolve.item1" item2="$resolve.item2">'</my-app>`
});
```

BREAKING CHANGE:

A new property is being attached to the scope of the route. The default name
for this property is `$resolve`. If your scope already contains a property
with this name then it will be hidden or overwritten.

In this case, you should choose a custom name for this property, that will
not collide with other properties on the scope, by specifying the `resolveAs`
property on the route.

Closes #13400
2015-12-04 12:22:23 +00:00
Martin Staffa 25e8c5927c docs(ngModelController): improve $rollbackViewValue description & example
The example has been expanded to make it easier to provoke the
behavior that the description is talking about (rollbackViewValue
and programmatic model updates)

Related #13340
2015-12-03 23:59:42 +01:00
Utsav Shah 6628b4f1e5 fix($http): throw if url passed is not a string
Throw to prevent hard to debug errors in functions that are
called later.

Fixes #12925
Closes #13444
2015-12-03 21:28:10 +01:00
Martin Staffa 6e18b50a5b feat(ngAnimate): provide ng-[event]-prepare class for structural animations
The new prepare class is added before the animation is pushed to the
queue and removed before the animation runs, i.e. it is immediately
available when a structural animation (enter, leave, move)
is initialized.

The class can be used to apply CSS to explicitly hide these elements
to prevent a flash of content before the animation runs.
This can happen if a structural animation (such as ng-if) sits at the
bottom of a tree which has ng-class animations on the parents.
Because child animations are spaced out with requestAnimationFrame,
the ng-enter class might not be applied in time, so the ng.if element is
briefly visible before its animation starts.
2015-12-03 15:14:22 +01:00
Martin Staffa 77419cf19f fix(ngAnimate): ignore children without animation data when closing them
During parent structural animations, ongoing animations on child elements
are closed. These child elements are identified by their data-ng-animate
attribute. If an element is the clone of an animating element,
it might have this attribute, but no animation runner associated with it,
so we need to ignore it.

Fixes #11992
Closes #13424
2015-12-02 20:16:45 +01:00
Matias Niemelä 193153c3d3 fix(ngAnimate): do not alter the provided options data
Prior to this fix the provided options object would be
altered as the animation kicks off due to the underlying
mechanics of ngAnimate. This patch ensures that a
copy of the provided options is used instead. This patch
also works for when `$animateCss` is used by itself.

Fixes #13040
Closes #13175
2015-12-02 12:23:11 +01:00
Peter Bacon Darwin 6a0686d434 fix(formatNumber): cope with large and small number corner cases
By manually parsing and rounding we can deal with the more tricky numbers

Closes #13394
Closes #8674
Closes #12709
Closes #8705
Closes #12707
Closes #10246
Closes #10252
2015-12-01 21:27:00 +00:00
xieranmaya 08c9a5e9e7 docs($controller): fix typo
Closes #13418
2015-12-01 19:11:31 +00:00
Peter Bacon Darwin a72c12bd70 fix(ngMock): clear out $providerInjector after each test
Closes #13397
Closes #13416
2015-12-01 19:03:56 +00:00
Adam Zerner 73e38658c4 docs(guide/Scopes): fix grammar
Closes #13413
2015-11-30 12:45:18 +01:00
Martin Staffa b641181b93 style($animateCssSpec): remove dump from test 2015-11-29 18:19:44 +01:00
Martin Staffa 7ffb2d3c17 fix($animateCss): consider options.delay value for closing timeout
Previously, options.delay was only considered when a class added an
extra transition style (which leads to style recalculation).

Fixes #13355
Closes #13363
2015-11-26 18:16:22 +01:00
Joan Claret 023b777a56 docs(tutorial/2 - Angular Templates): add closing parenthesis
Closes #13368
2015-11-26 16:22:59 +01:00
Thodoris Bais 0c9480de8c docs(ngTransclude): add a comma for better reading flow
Closes #13385
2015-11-26 16:22:58 +01:00
Martin Staffa 0bc275461c docs(input): note that pattern validates the $viewValue
Closes #13376
2015-11-26 16:22:57 +01:00
Peter Bacon Darwin 0b5ecc64f0 fix($resource): still use the cancellable value if invalid timeout value
We log a deprecation message if `timeout` contains an invalid value.
Now we also use the `callable` value if provided.
2015-11-26 13:15:25 +00:00
Peter Bacon Darwin b183eae7ae fix($resource): don't add noop $cancelRequest after request has resolved 2015-11-26 13:14:12 +00:00
Peter Bacon Darwin 7ddbc9aa35 fix(ngTransclude): fix case where ngTransclude attribute value equals its key
Some preprocessors such as Jade will automatically provide a value for an attribute
rather than leave it empty. E.g. `<div ng-transclude="ng-transclude">`.
In these situations we still want to use the default transclusion slot.

Closes #12934
Closes #13383
2015-11-26 11:11:23 +00:00
Peter Bacon Darwin b2a937d425 test($compile): add test for undefined non-optional reference binding
Demonstrates that #13373 fixes #13367
2015-11-25 10:48:59 +00:00
Lucas Mirelmann 4473b81cda fix($parse): handle interceptors with undefined expressions
When calling `$parse` with `undefined` as the expression and with
an interceptor, then when the function is evaluated, then call the
interceptor

Closes: #13367
Closes: #13373
2015-11-25 10:48:59 +00:00
Georgios Kalpakas 98528be311 feat($resource): add proper support for cancelling requests
Introduced changes:

- Deprecate passing a promise as `timeout` (for `$resource` actions).
  It never worked correctly anyway.
  Now a warning is logged (using `$log.debug()`) and the property is
  removed.
- Add support for a boolean `cancellable` property in actions'
  configuration, the `$resource` factory's `options` parameter and the
  `$resourceProvider`'s `defaults` property.
  If true, the `$cancelRequest` method (added to all returned values for
  non-instance calls) will abort the request (if it's not already
  completed or aborted).
  If there is a numeric `timeout` specified on the action's configuration,
  the value of `cancellable` will be ignored.

Example usage:

```js
var Post = $resource('/posts/:id', {id: '@id'}, {
  get: {
    method: 'GET',
    cancellable: true
  }
});

var currentPost = Post.get({id: 1});
...
// A moment later the user selects another post, so
// we don't need the previous request any more
currentPost.$cancelRequest();
currentPost = Post.get({id: 2});
...
```

BREAKING CHANGE:

Using a promise as `timeout` is no longer supported and will log a
warning. It never worked the way it was supposed to anyway.

Before:

```js
var deferred = $q.defer();
var User = $resource('/api/user/:id', {id: '@id'}, {
  get: {method: 'GET', timeout: deferred.promise}
});

var user = User.get({id: 1});   // sends a request
deferred.resolve();             // aborts the request

// Now, we need to re-define `User` passing a new promise as `timeout`
// or else all subsequent requests from `someAction` will be aborted
User = $resource(...);
user = User.get({id: 2});
```

After:

```js
var User = $resource('/api/user/:id', {id: '@id'}, {
  get: {method: 'GET', cancellable: true}
});

var user = User.get({id: 1});   // sends a request
instance.$cancelRequest();      // aborts the request

user = User.get({id: 2});
```

Fixes #9332
Closes #13050
Closes #13058
Closes #13210
2015-11-24 22:10:54 +00:00
Peter Bacon Darwin 9190d4c3ad chore(bower/publish): read dist-tag from correct package.json 2015-11-24 10:57:16 +00:00
J.P. Poveda d9ec9951e2 docs($timeout): reword sentence for clarity
Closes #13302
2015-11-23 13:10:32 +01:00
Matt Erickson fedafdc677 docs($swipe): remove reference to ngCarousel
ngCarousel no longer exists (or has ever existed).

Closes #13322
Closes #13353
2015-11-23 13:05:09 +01:00
Rahat Ahmed 26c36bb4d1 docs(numberFilter): change decimalPlaces to fractionSize
Replace `decimalPlaces` with `fractionSize`, as `decimalPlaces`
isn't defined anywhere and is most likely meant to be `fractionSize`.

Closes #13323
2015-11-23 13:01:18 +01:00
mohamed amr c7a2028ab3 fix(ngOptions): don't $dirty multiple select after compilation
Closes #13211
Closes #13326
2015-11-23 12:58:56 +01:00
Martin Staffa 596af70101 chore(i18n): update locale files with standalone months
Closes #12844
2015-11-23 10:31:14 +00:00
Martin Staffa 96c73a0672 feat(ngLocale): add support for standalone months
This is needed for languages for which the month on its own has a
different format (case) than when used as part of a date.

Closes #3744
Fixes #10247
Fixes #12642
Closes #12844
2015-11-23 10:31:03 +00:00
Anita Perala 1537651c8c docs(guide/Conceptual Overview): add missing object in sentence
docs: minor grammar fix
missing word in overview

Closes #13346
2015-11-20 18:13:18 +01:00
Martin Staffa d59aeb4e0b docs(angular.element): add more info, fix formatting
- add info about ngJq
- fix alert box
- add info about css function
2015-11-20 18:11:50 +01:00
Julián Salgado 551a33db56 docs(angular.element): note that it does not find elements by tag name / selector
Closes #13107
Closes #13113
2015-11-20 18:11:49 +01:00
Anas Qadrei cd91640146 docs(error/nobase): make base tag visible
Closes #13350
2015-11-20 18:11:26 +01:00
Martin Staffa ab5824ee12 chore: make jshint happy 2015-11-20 12:18:37 +01:00
Matias Niemelä 5c50723535 chore(CHANGELOG): update with changes for 1.4.8 2015-11-19 16:15:30 -08:00
Matias Niemelä 546a277d65 fix(core): ensure animate runner is the same with and without animations
The $$AnimateRunner class is now the same for the core $animate service
and the ngAnimate $animate service. Previously, the core used a different
implementation that didn't match the ngAnimate behavior with regard
to callbacks.

Closes #13205
Closes #13347
2015-11-20 00:22:47 +01:00
Peter Bacon Darwin a5ff651a59 fix($compile): support merging special attribute names in replace directives
When compiling a `replace` directive, the compiler merges the attributes from
the replaced element onto the template element.

Unfortunately, `setAttribute` and other related DOM methods do not allow certain
attribute names - in particular Angular 2 style names such as `(click)` and `[value]`.

This is relevant when using ngForward with Angular Material, since the `mgButton`
directive uses `replace` and in the former you often use `(click)`.

This fixes the problem but for those special attributes the speed is considerably
slow.

Closes #13317
Closes #13318
2015-11-19 08:52:56 +00:00
Peter Bacon Darwin ccd47ec904 test(filterFilter): modify Date test to prevent off by one year error in Firefox 2015-11-18 12:56:06 +00:00
Peter Bacon Darwin 2e23a3cdbc docs(CHANGELOG): tweak the latest changelog descriptions 2015-11-18 08:28:52 +00:00
Matias Niemelä ca7f4a387c chore(CHANGELOG): update with changes for 1.5.0-beta.2 2015-11-17 15:57:27 -08:00
Jason Bedard 898a3fd3b9 perf($q): only bind Deferred methods when returned publicly from $q.defer 2015-11-17 21:53:09 +01:00
Jason Bedard 9473371343 perf($q): reduce closures when resolving promises
- changes Deferred.$$resolve to only wrap the internal resolve/reject when wrapping another promise

Closes: #13293
2015-11-17 21:49:52 +01:00
Lucas Mirelmann e5275590db refactor($interval): do not use notify to trigger the callback
Do not use `$q.notify` to trigger the callback. This allows `$q` to be replaced
with another Promise/A+ compilant library

Closes: #13261
2015-11-17 21:46:55 +01:00
Matias Niemelä 78297d252d feat(ngAnimate): introduce ngAnimateSwap directive 2015-11-17 11:36:07 -08:00
Steve Mao e5e0884eaf docs($http): add a missing semicolon
Closes #13311
2015-11-16 16:55:33 +01:00
Leonardo Borges Avelino 551d1c20cf docs(guide/Conceptual Overview): change deprecated $http.success into .then
Using the standard then method instead success, because success is deprecated

Closes #13309
2015-11-16 16:54:13 +01:00
Peter Bacon Darwin f5aa207960 fix(jqLite): deregister special mouseenter / mouseleave events correctly
Closes #12795
Closes #12799
2015-11-12 18:44:19 +00:00
rrsivabalan 4412fe238f fix($location): ensure $locationChangeSuccess fires even if URL ends with #
Closes #12175
Closes #13251
2015-11-12 13:34:18 +00:00
Eric Lee Carraway 8088284f66 docs(readme): fix typo (setup => set up)
spell set up as two words
here, it is an adjective modifying the noun "environment"

Closes #13297
2015-11-12 10:22:50 +02:00
Eric Lee Carraway 25f1bbaad1 docs(contributing): fix typo (a unambiguous => an unambiguous)
use the article “an” before words that start with a vowel sound

Closes #13292
2015-11-11 14:21:41 +02:00
Peter Bacon Darwin bd7b217729 fix($compile): bind all directive controllers correctly when using bindToController
Previously only the first directive's controller would be bound correctly.

Closes #11343
Closes #11345
2015-11-10 20:30:53 +00:00
Georgios Kalpakas 50557a6cd3 fix($compile): evaluate against the correct scope with bindToController on new scope
Previously, the directive bindings were evaluated against the directive's
new (non-isolate) scope, instead of the correct (parent) scope.
This went unnoticed most of the time, since a property would be eventually
looked up in the parent scope due to prototypal inheritance. The incorrect
behaviour was exhibited when a property on the child scope was shadowing
that on the parent scope.

This commit fixes it.

Fixes #13021
Closes #13025
2015-11-10 20:30:53 +00:00
Jakub Torbicki 1c13a4f45d fix($compile): bind all directive controllers correctly when using bindToController
Previously only the first directive's controller would be bound correctly.

Closes #11343
Closes #11345
2015-11-10 20:30:53 +00:00
mzdunek93 1a98c0ee34 fix($compile): fix scoping of transclusion directives inside replace directive
Closes #12975
Closes #12936
Closes #13244
2015-11-10 20:30:53 +00:00
Jason Bedard b837fc3116 refactor($compile): simplify multi element directive check
Previously, we would check if an attribute indicates a multi-element
directive, now we only do this check if the attribute name actually
matches the multi-element name pattern.

Closes #12365
2015-11-07 15:31:34 +01:00
Martin Staffa aff74ec87b docs(changelog, migration): add BC notice for ngMessages evaluation
Introduced by

Closes #11616
Closes #12001
2015-11-06 17:17:20 +01:00
Martin Staffa 077ee37942 docs(changelog, migration): add BC notice for setting ngOptions as attribute
Caused by 7fda214c4f

Closes #13145
2015-11-06 16:41:14 +01:00
Martin Staffa 0efef2385f chore(docs): display search result areas in a fixed order 2015-11-06 16:30:33 +01:00
Martin Staffa 7da22e6685 chore(docs): improve layout of search results
The API section now uses a multi-column list. This preserves the actual
order of items. Note that only browser that support @supports and
columns get the new behavior.
The line-breaking behavior of search results is also improved. Previously,
long words would break onto new lines or run into the second column.
2015-11-06 16:30:32 +01:00
Doug Krugman 92bdd7627f docs(guide/Concepts): remove unused refresh property
Closes #13257
2015-11-06 10:15:19 +02:00
jody tate 39ebb06baf docs(guide/Directives): change "it" to possessive
Closes #13253
2015-11-05 14:24:57 +02:00
Georgii Dolzhykov 9cf6b197ab docs($rootScope.Scope): default value of objectEquality parameter
Closes: #13252
2015-11-04 21:53:32 +01:00
Martin Staffa 4971ef12d4 fix(ngMessage): make ngMessage compatible with ngBind
Fixes #8089
Closes #13074

BREAKING CHANGE:

ngMessage is now compiled with a priority of 1, which means directives
on the same element as ngMessage with a priority lower than 1 will
be applied when ngMessage calls the $transclude function.
Previously, they were applied during the initial compile phase and were
passed the comment element created by the transclusion of ngMessage.
To restore this behavior, custom directives need to have
their priority increased to at least "1".
2015-11-04 17:13:53 +01:00
Martin Staffa 7c792f4cc9 docs(ngRepeat): add more info about watching and tracking
- mention $watchCollection
- highlight that track by "id" can improve render performance

Related #9508
2015-11-03 21:38:06 +01:00
Georgios Kalpakas 4daafd3dbe perf(merge): remove unnecessary wrapping of jqLite element
Fixes https://github.com/angular/angular.js/commit/75292a6cb5e17d618902f7996e80eb3118eff7b0#commitcomment-14137538

Closes #13236
2015-11-03 17:45:44 +02:00
Peter Bacon Darwin fe11265fdc test(merge): fix check on jquery object 2015-11-02 20:12:12 +00:00
Peter Bacon Darwin 75292a6cb5 fix(merge): ensure that jqlite->jqlite and DOM->DOM
Previously we were wrapping DOM elements into jqlite objects when cloning
and vice versa.

Fixes https://github.com/angular/angular.js/pull/12286#discussion_r43656917
2015-11-02 19:54:20 +00:00
JonyD 4ff6c85792 docs(ngRepeat): fix link to MDN
Closes #13226
2015-11-02 20:48:12 +01:00
Martin Staffa e26bc2370b docs(ngInclude): fix incorrect link 2015-11-02 20:45:13 +01:00
Martin Staffa 33713deeb8 docs(tutorial/0 - Bootstrapping): mention that the setup must be completed
Closes #13106
2015-11-02 20:40:53 +01:00
luckylooke 17715fa366 fix(merge): clone elements instead of treating them like simple objects
Similar fix to #11720

Closes #12286
2015-11-02 17:20:59 +00:00
Jason Bedard 96288d02d3 refactor($compile): remove skipDestroyOnNextJQueryCleanData, remove jq data of all replaced nodes
Closes: #12094
2015-11-01 23:43:01 +01:00
Lucas Mirelmann 8be98e4fdf test($interpolate): fix test on $interpolate
Fix for a test in $interpolate after an incomplete merge
2015-11-01 23:35:05 +01:00
Jason Bedard cf83b4f445 perf($interpolate): provide a simplified result for constant expressions
Closes: #10414
2015-11-01 23:31:33 +01:00
Matthew Hill 15bfea8339 docs(angular-mocks): clarify angular.mock.module usage with objects
Closes #12354
2015-11-01 07:13:00 +00:00
Jason Bedard 9b90c32f31 perf($compile): use static jquery data method to avoid creating new instances 2015-11-01 06:51:22 +00:00
Chris J. Lee f4bf744516 chore(protractor-conf.js): remove dangling comma
Closes #13051
2015-11-01 06:45:42 +00:00
Peter Bacon Darwin 0d96995fcc chore(package.json): update dgeni-packages to 0.11.0 2015-10-31 20:16:24 +00:00
Nuri Hodges 2a85a634f8 fix(orderByFilter): throw error if input is not array-like
BREAKING CHANGE:
Previously, an non array-like input would pass through the orderBy filter
unchanged.
Now, an error is thrown. This can be worked around by converting an object
to an array, either manually or using a filter such as
https://github.com/petebacondarwin/angular-toArrayFilter.
(`null` and `undefined` still pass through without an error, in order to
support asynchronous loading of resources.)

Closes #11255
Closes #11719
2015-10-31 02:52:03 +02:00
Bert Verhelst 00d2b2c4cf docs($location): improve style
Closes #13072
2015-10-30 22:05:49 +01:00
Martin Staffa e688f07023 docs(error/ctreq): fix typo
Closes #13083
2015-10-30 22:02:26 +01:00
Michael George Attard 8e2f7d37e4 docs($rootScope): improve clarity and consistency
Closes #13110
2015-10-30 21:59:43 +01:00
Georgios Kalpakas f5bc3ed9b4 test($templateRequest): remove unused dependencies
Closes #13199
2015-10-30 21:58:16 +01:00
Georgios Kalpakas 11d60af3dc docs($templateRequestProvider): make the description more generic and fix link 2015-10-30 21:58:12 +01:00
Pablo Villoslada Puigcerber 865f6065e7 docs(select): document the multiple attribute
Add the `multiple` attribute to the documentation of the select directive.

Closes #13119
2015-10-30 20:33:39 +02:00
Lucas Galfaso 91c0b364af style(ngOptionsSpec): fix code style issue 2015-10-30 12:28:26 +01:00
Lucas Mirelmann fce07f55e5 style($http): do not use angular global object to invoke isObject
Closes: #13204
2015-10-30 12:26:32 +01:00
Jason Bedard c8768d12f2 perf(copy): avoid regex in isTypedArray
Closes: #12054
2015-10-30 12:12:14 +01:00
Stephen Sauceda af6342d6fb docs(CONTRIBUTING.md): add commitizen instructions 2015-10-30 08:20:09 +00:00
Stephen Sauceda a179757fad chore(package.json): add commitizen, adapter and npm script
Closes #13194
2015-10-30 08:20:09 +00:00
Lucas Mirelmann 35eada68c4 refactor($parse): simplify constantWatchDelegate
Closes: #13176
2015-10-29 21:30:37 +01:00
Sreenivasan K bfad2a4f4a fix($animate): ensure leave animation calls close callback
Closes #12278
Closes #12096
Closes #13054
2015-10-29 07:51:18 +00:00
Shahar Talmi 54e816552f feat(Module): add helper method, component(...) for creating component directives
Since we are promoting component directives as the building blocks of
Angular applications, this new helper provides a simpler method for
defining such directives. By using sensible, widely accepted, conventions
the number of parameters needed has been cut down dramatically.

Many component directives can now be defined by simply providing a `name`,
`template`/`templateUrl`, a `controller`, and `bindings`:

```js
myMod.component('myComp', {
  template: '<div>My name is {{myComp.name}}</div>',
  controller: function() {
  },
  bindings: { name: '=' }
});
```

Closes #10007
Closes #12933
2015-10-29 07:25:02 +00:00
Stanislav Komanec 4fc734665e fix($resource): allow XHR request to be cancelled via timeout promise
Closes #12657
Closes #12675
Closes #10890
Closes #9332
2015-10-28 22:21:37 +00:00
Peter Bacon Darwin b8736e65b0 test($rootScope): ensure that only child scopes are disconnected
Related to #11786 and 8fe781fbe7
2015-10-28 22:03:42 +00:00
Alicia Lauerman b9bed7d9da fix($cacheFactory): check key exists before decreasing cache size count
Previously, there was no check for the existence of an item in the
cache when calling `$cacheFactory.remove()` before modifying the cache size
count.

Closes #12321
Closes #12329
2015-10-28 21:50:00 +00:00
Peter Bacon Darwin b2fc39d2dd feat($templateRequest): support configuration of $http options
It is now possible to configure the options sent to $http for template requests.
If no value is configured then the request will use the default $http options.

Thanks to @luckycadow for help on this feature

Closes #13188
Closes #11868
Closes #6860
2015-10-28 21:43:34 +00:00
Georgios Kalpakas 7c0731edb2 fix($http): apply transformResponse even when data is empty
Note, that (as a by-product of the previous implementation) only non-empty
data was passed through the `transformResponse` pipeline. This is no
longer the case.

When using a custom `transformResponse` function, one should make sure it
can also handle an empty (i.e. falsy) `data` argument appropriately.

Fixes #12976
Closes #12979
2015-10-28 21:41:30 +00:00
Peter Bacon Darwin 8fe781fbe7 fix($rootScope): stop IE9 memory leak when destroying scopes
Ensure that all child scopes are completely disconnected when a parent is
destroyed.

Closes #10706
Closes #11786
2015-10-28 21:32:43 +00:00
Charlie-Hua 23932a26ff docs(ngModelOptions): add missing user.data result for updateOn: blur example
In the updateOn:blur example, there is an input for user.data but the
result is missing and nowhere to see how the value changes compared to user.name.

Closes #13129
2015-10-28 22:09:04 +01:00
Georgios Kalpakas 3ca4ca463c refactor(ngMessage): remove unused argument
Closes #13087
Closes #12508
2015-10-28 18:56:51 +01:00
Peter Bacon Darwin 395f3ec638 fix(ngOptions): skip comments and empty options when looking for options
Related #12952
Closes #12190
Closes #13029
Closes #13033
2015-10-28 18:36:21 +01:00
Stu Cox 964a901bd8 docs($q): add a note re. difference in exception handling vs ES6
Closes #11472
Closes #13101
2015-10-28 08:17:39 +00:00
Ryan Hart a995ee17ee docs(ngOptions): explain the caveats of using select as and track by together
Changes:

* Modify warning message to indicate that `track by` can be used with `select as`,
  but subject to certain limitations.
* Provide both a working and an non-working example.
* Explain why the latter does not work.

Closes #13007
2015-10-27 22:00:31 +02:00
Sam Rawlins 794d1c1ebe docs($anchorScroll): fix link to HTML5 spec
Closes #13180
2015-10-27 20:39:08 +02:00
Marcy Sutton 662fb282c1 fix(ngAria): don't add tabindex to radio and checkbox inputs
Closes #12492
Closes #13095
2015-10-27 17:46:14 +01:00
Andrew Austin ffb6b2fb56 fix(ngInput): change URL_REGEXP to better match RFC3987
The URL_REGEXP in use to perform validation in ngInput is too restrictive and fails to
follow RFC3987. In particular, it only accepts ftp, http, and https scheme components and
rejects perfectly valid schemes such as "file", "mailto", "chrome-extension",
etc. The regex also requires the scheme to be followed by two "/" but the RFC says
0 to n are acceptable. This change fixes both of these issues to better align to
the standard.

Closes #11341
Closes #11381
2015-10-26 21:45:10 +00:00
Kuzminov Aleksandr Sergeevich 941c1c35f1 fix(jqLite): ensure mouseenter works with svg elements on IE
Closes #10259
Closes #10276
2015-10-26 21:21:44 +00:00
Lucas Mirelmann 29a05984fe feat($injector): Allow specifying a decorator on $injector
Allows the definition of a decorator on `$injector`

Closes: #13103
2015-10-26 22:10:41 +01:00
sevdog 4038aabffa docs($animateCss): add missing documentation for the structural option
Add missing documentation for structural option in `$animateCss` service

Closes #13049
2015-10-26 13:02:13 -07:00
Lucas Galfaso 773efd0812 fix(isArrayLike): handle jQuery objects of length 0
Closes: #13169
Closes: #13171
2015-10-26 16:37:38 +00:00
Risan Bagja Pradana 80881949fc docs(tutorial): add a note about Chrome or Firefox not being available
Based on the current configuration, Karma will run the tests on both
Chrome and Firefox, which will result in an error if either browser is not
available on the user's machine. This commit adds a note and directions on
how to solve this.

Closes #13114
2015-10-26 15:01:14 +02:00
Jack Viers 2c8d87e064 fix(Angular.js): fix isArrayLike for unusual cases
Closes #10186
Closes #8000
Closes #4855
Closes #4751
Closes #10272
2015-10-25 14:54:11 +00:00
Jason Bedard 33c67ce785 perf(copy): only validate/clear user specified destination
Closes #12068
2015-10-24 11:08:14 +02:00
Lucas Mirelmann ad4296d966 refactor($rootScope): remove unused dependency
Removed unused dependency

Closes #13102
2015-10-16 18:28:37 +02:00
Georgios Kalpakas 469b14a525 refactor($compile): remove unused var
Closes #13086
2015-10-15 17:02:49 +03:00
Lucas Mirelmann 1caf0b6bee fix($parse): evaluate once simple expressions in interpolations
For simple expressions without filters that have a stateless interceptor
then handle the 2nd phase parse evaluation using `inputs`.

TL;DR
This fixes the issue that interpolated simple expressions were evaluated twice
within one digest loop.

Long version, things happen in the following order:

* There was an overhaul on $interpolate, this overhaul changed $parse and
  incorporated the concept of an interceptor.
* Optimization on $parse landed  so expressions that have filters without
  parameters (or the parameters are constants) would be evaluated in 2 phases,
  first to evaluate the expression sans the filter evaluation and then with
  the filter evaluation. This also used interceptors [the second evaluation
  issue was added here]
* More optimizations on $parse landed and now expressions could be evaluated
  in 2 phases. One to get all the possible values that could change (lets call
  this state), the state was checked by $watch to know if an expression changed.
  The second to continue the evaluation (as long as this state is provided).
  This, once again, used interceptors

The last change, was supposed to fix the issue, but there was an assumption in
the existing code that the code would always generate the 2 phases functions,
but that is not true. If the expression is simple enough (just like the one in
your case) then the 2-phase evaluations functions are not generated. In this
case, if a stateless interceptor was added (just like what $interpolate adds)
then the state was not used and you see the function being evaluated twice.
This explains why, if you change the expression from
`Hello {{log('A')}} {{log('B')}}!` to `Hello {{log('A') + ' ' + log('B')}}!`,
then the repetition is not there.

Closes #12983
Closes #13002
2015-10-14 23:45:07 +02:00
zurin 9f716dd590 docs(guide/Scopes): fix grammar
Added a comma to make reading more natural.

Closes #13084
2015-10-14 16:14:21 +03:00
Michael Salmon 914a934b6f docs(guide/Directives): improve description of linking function
The `controller` and `transclude` parameters of the linking function were not
mentioned in the description, but used in the examples.
This commit improves the description and links to the `$compile` API docs
for more details.

Closes #13028
2015-10-14 10:48:06 +03:00
Peter Bacon Darwin a4ada8ba9c feat($compile): multiple transclusion via named slots
Now you can efficiently split up and transclude content into specified
places in a component's template.

```html
<pane>
  <pane-title>Some content for slot A</pane-title>
  <pane-content>Some content for slot A</pane-content>
</component>
```

```js
mod.directive('pane', function() {
  return {
    restrict: 'E',
    transclude: { paneTitle: '?titleSlot', paneContent: 'contentSlot' },
    template:
    '<div class="pane">' +
      '<h1 ng-transclude="titleSlot"></h1>' +
      '<div ng-transclude="contentSlot"></div>' +
    '</div>' +
  };
});
```

Closes #4357
Closes #12742
Closes #11736
Closes #12934
2015-10-12 14:46:53 +01:00
Martin Staffa 40c974ab14 docs(linky): mention sanitization, improve formatting 2015-10-09 15:10:37 +02:00
Stian Jensen 06f002b161 feat(linky): add support for custom attributes
Optional extra attributes may be defined either as:
- a map of attributes and values
- a function that takes the url as a parameter and returns a map

Closes #12558
Closes #13061
2015-10-09 15:10:36 +02:00
Peter Bacon Darwin 8226ff8b8e style(ngMockSpec): fix excessive indentation
See https://github.com/angular/angular.js/pull/12406#discussion_r41503587. Thanks @gkalpak :-)
2015-10-08 15:13:18 +01:00
Peter Bacon Darwin d67e999dfb feat(ngMock): add expectRoute and whenRoute shortcuts with colon param matching
Add `params` argument to the `when()` and `expect()` functions to give map regex
groups to keys on a new `params` argument of the `respond()` callback.

Add `whenRoute` and `expectRoute` methods to `$httpBackend` to support matching
URLs by patterns similar to those defined for `ngRoute`.

Closes #12406
2015-10-08 15:07:18 +01:00
Martin Staffa a8e03b3a90 docs(ngOptions): add info about preselecting complex models
Closes #12966
2015-10-08 15:54:20 +02:00
Chris J. Lee 6f3e26c404 test(ngResource): fix typos in tests
Closes #13044
2015-10-08 11:29:16 +03:00
Flavio Corpa Ríos 1c75ea613d docs(ngInclude): add workaround for using onload function with SVG in IE11
Closes #12493
Closes #13042
2015-10-07 23:02:23 +02:00
Jason Hopper c8e1db2050 docs(tutorial): update angular module versions to reflect tutorial files
Closes #12991
Closes #12992
2015-10-07 17:51:50 +02:00
Sugan Krishnan 74ed28665d docs($sce): fix typo
Closes #13030
2015-10-07 13:22:40 +01:00
Peter Bacon Darwin 4ad0ca130d refactor($compile): check removeWatches before calling
Previously we assigned `noop` if there was no function but there is no
performance advantage in doing this since the check would have to happen
either at assignment time or at call time.

Removing this use of `noop` makes the code clearer, IMO :-)

Closes #12528
2015-10-07 12:30:30 +01:00
Peter Bacon Darwin b51dd3010d refactor($compile): initialize removeWatchCollection at the start
This check means that we don't have to keep checking whether the collection
has been created when adding a new watcher

Closes #12528
2015-10-07 12:30:21 +01:00
Peter Bacon Darwin 6e6f31943c refactor($compile): rename variables to clarify their purpose
Closes #12528
2015-10-07 12:30:15 +01:00
Jason Bedard 66fee7e22a refactor($compile): move $scope.$on('$destroy') handler out of initializeDirectiveBindings
Since only one of three invocations of `initializeDirectiveBindings` actually
adds a `$destroy` handler to the scope (the others just manually call unwatch
as needed), we can move that code out of this method.

This also has the benefit of simplifying what parameters need to be passed
through to the linking functions

Closes #12528
2015-10-07 12:30:06 +01:00
Martin Staffa beea571660 Revert "fix(ngOptions): skip comments when looking for option elements"
This reverts commit 7f3f3dd3eb.
The fix only fixed a specific case and exhibited a flawed logic
(namely skipping every option if the emptyOption is a comment).
See https://github.com/angular/angular.js/issues/12190#issuecomment-145877914

Conflicts:
	test/ng/directive/ngOptionsSpec.js
2015-10-07 11:28:13 +02:00
Richard Harrington 0c8a9a0e1a docs(constant): fix pluralization
Closes #13024
2015-10-06 23:21:15 +03:00
Peter Bacon Darwin fd83d3724a fix(ngMock): reset cache before every test
We don't need to have values in the cache from previous tests. This was
causing failures in all subsequent tests when a single test failed due
to a memory leak.

Now that we reset the cache each time we do not need to store the cache
size at the start of each test

Closes #13013
2015-10-06 13:55:16 +01:00
Martin Staffa 2fcfd75a14 fix(ngOptions): override select option registration
When ngOptions is present on a select, the option directive should not be able to
register options on the selectCtrl since this may cause errors during the
ngOptions lifecycle.

This can happen in the following cases:

- there is a blank option below the select element, an ngModel
directive, an ngOptions directive and some other directive on the select
element, which compiles the children of the select
(i.e. the option elements) before ngOptions is has finished linking.

- there is a blank option below the select element, an ngModel
directive, an ngOptions directive and another directive, which uses
templateUrl and replace:true.

What happens is:
- the option directive is compiled and adds an element `$destroy` listener
that will call `ngModel.$render` when the option element is removed.
- when `ngOptions` processes the option, it removes the element, and
triggers the `$destroy` listener on the option.
- the registered `$destroy` listener calls `$render` on `ngModel`.
- $render calls `selectCtrl.writeValue()`, which accesses the `options`
object in the `ngOptions` directive.
- Since `ngOptions` has not yet completed linking the `options` has not
yet been defined and we get an error.

This fix moves the registration code for the `option` directive into the
`SelectController.registerOption()` method, which is then overridden by
the `ngOptions` directive as a `noop`.

Fixes #11685
Closes #12972
Closes #12968
Closes #13012
2015-10-06 13:43:28 +01:00
Raghav 2d40507547 docs($animate): fixed typo ("an animations" -> "any animations")
Closes #13020
2015-10-06 13:15:13 +03:00
Georgios Kalpakas ecf9304811 fix(limitTo): start at 0 if begin is negative and exceeds input length
Previously, specifying a negative `begin` whose abs value exceeds the
input's length, would behave unexpectedly (depending on the value of
`limit` relative to `begin`). E.g.:

```
limitToFilter('12345', 3, -7) === '1'
// but
limitToFilter('12345', 10, -7) === '123'
```

This commit fixes the unexpected behaviour, by setting `begin` to 0 in the
aforementioned cases. Thus, the previous examples become:

```
limitToFilter('12345', 3, -7) === limitToFilter('12345', 3, 0) === '123'
// and
limitToFilter('12345', 10, -7) === limitToFilter('12345', 10, 0) === '12345'
```

Fixes #12775
Closes #12781
2015-10-06 09:38:54 +01:00
Matias Niemelä b9ab88776b docs(ngAnimate): simplify $animateCss example code 2015-10-05 10:55:56 -07:00
spoonraker 00bf218304 docs(tutorial): updates for the text for animations in step 12
The grammar for the animation description has now been improved.

Closes #12740
2015-10-05 10:20:58 -07:00
Jason Hopper 95fbf168d1 docs(tutorial): update tutorial copy to reflect updates to tutorial source @bower.json excerpt for animations
Code breaks if tutorial is followed without reset.
bower.js exceprt copy does not match source.
Changed to reflect in text body.

Closes #12993
2015-10-05 10:17:30 -07:00
Shahar Talmi 51a27c0f1a feat(ngMock): invoke nested calls to module() immediately
Before 1.3, it was possible to call `angular.mock.module()` from inside
another module. After this version additional calls were just ignored.

It is helpful to be able to do this since a test may have helper functions
that need to access "config"-time things such as constants or providers,
and without this change it is difficult to get hold of the `$provide`
object from within those helpers.

Closes #12887
2015-10-05 12:50:31 +01:00
Magnus Pedersen f02811f0bb docs(ngOptions): rephrased a sentence for clarity
Closes #13010
2015-10-05 11:48:30 +03:00
Alexandr Gureev bcf78ebb18 docs(ngAnimate): fix typos in examples
Closes #12995
2015-10-02 11:23:48 +03:00
John Zhang 3050dd1b47 docs($httpProvider): fix description of useLegacyPromiseExtensions
useLegacyPromiseExtensions's default value is true, and the  legacy
methods exist when it is set to true.

Closes #12974
2015-10-01 18:30:01 +02:00
Donghwan Kim 1efdb4745a docs(guide/Running in Production): fix an incorrect indefinite article
Closes #12986
2015-10-01 18:25:11 +02:00
koyner d73f7dff45 docs(guide/Forms): fix indentation.
Closes #12988
2015-10-01 18:24:29 +02:00
Martin Staffa f047ad2628 docs(guide/Using $location): note that the fakeBrowser is not for actual projects
Closes #12982
Closes #12987
2015-10-01 18:20:31 +02:00
Peter Bacon Darwin 049d3def80 docs(CHANGELOG): the $time service feature was reverted as it is not ready 2015-10-01 13:22:40 +01:00
Peter Bacon Darwin 00778aa239 test($compile): move lazy compile specs into a describe block 2015-10-01 12:27:52 +01:00
Matias Niemelä 6b123a0419 chore(CHANGELOG): update with changes for 1.5.0-beta.1 2015-09-29 13:59:34 -07:00
Matias Niemelä 4079eea6b3 chore(CHANGELOG): update with changes for 1.4.7 2015-09-29 13:59:21 -07:00
Matias Niemelä d277ac2eb8 chore(CHANGELOG): update with changes for 1.3.20 2015-09-29 13:59:10 -07:00
Matias Niemelä 9deb123d04 chore(CHANGELOG): update with changes for 1.2.29 2015-09-29 13:58:54 -07:00
Martin Probst 1c2d2e8ba0 docs($sceProvider): XSS when turning of SCE
Document that turning off SCE is very, very dangerous and should normally not be
used by applications.
2015-09-28 14:19:38 +02:00
Martin Probst 144bcc84ab docs($interpolateProvider): document XSS in $interpolate
`$interpolateProvider.startSymbol` & friends are often used dangerously, to embed Angular templating in other templating languages. This change documents that that is a very dangerous practice.
2015-09-28 14:07:31 +02:00
Shrulik 693021c449 docs($animateCss): remove superfluous asterisk
Closes #12959
2015-09-27 22:14:46 +03:00
Rishabh Jain dc818e1165 docs(input[time]): fixes a typo 2015-09-27 20:11:24 +02:00
Martin Staffa e51174bf13 docs($http): link to usage where config is mentioned; make drier
Linking to usage section makes it easier for beginners to find out what the config object looks like.
The General Usage section now features an example that actually uses $http(config), and the Shortcut Methods section has been moved so that it appears directly after.

Closes #12949
Closes #12950
2015-09-27 15:42:25 +02:00
Martin Staffa 7f3f3dd3eb fix(ngOptions): skip comments when looking for option elements
When the empty/blank option has a directive that transcludes, ngIf for example,
a comment will be added into the select. Previously, ngOptions used this
comment as the empty option, which would mess up the displayed options.

Closes #12190
2015-09-27 15:08:35 +02:00
Martin Staffa d077966ff1 test(ngOptions): clarify a test description 2015-09-26 17:59:35 +02:00
Stefan Krüger 0df4ff800a docs(guide/Directives): let myTabs directive ctrl use inline array notation
modified `docsTabsExample` myTabs directive ctrl at
[Creating Directives that Communicate Example](https://docs.angularjs.org/guide/directive#creating-directives-that-communicate) so that it uses
[Inline Array Annotation](https://docs.angularjs.org/guide/di#inline-array-annotation)
and is compatible with
[Using Strict Dependency Injection](https://docs.angularjs.org/guide/di#using-strict-dependency-injection)

Closes #12767
2015-09-25 11:26:35 +02:00
Martin Staffa 6208b76afa chore(docs): update to lunr-0.5.12
This improves the search results for certain terms.
For example, previously guide/scope was unfindable with the search
term 'scope', now it's the first hit.

Closes #12937
2015-09-25 11:09:33 +02:00
daviskoh 70dac5ae82 fix($parse): fix typo in error message ("assing" -> "assign")
Closes #12940
2015-09-25 10:56:29 +03:00
Martin Staffa aafbd94439 docs(ngModel): align $viewValue description with $setViewValue 2015-09-24 21:14:50 +02:00
Matias Niemelä e732f8e579 docs($animateCss): options.transition should be options.transitionStyle 2015-09-24 10:07:14 -07:00
Matias Niemelä 9f67da6252 feat($animateCss): add support for temporary styles via cleanupStyles
Some animations make use of the `from` and `to` styling only for the
lifetime of the animation. This patch allows for those styles to be
removed once the animation is closed automatically within `$animateCss`.

Closes #12930
2015-09-24 09:55:43 -07:00
Igor Minar b3a3c6a72e build(travis): make sauce connect process query a bit more specific 2015-09-23 14:00:24 -07:00
Igor Minar e8cdabe129 build(travis): fix typo in a comment 2015-09-23 14:00:23 -07:00
Martin Staffa 3af71bee75 Revert "refactor(ngModel): move model -> view update from watchFn to watchAction"
This reverts commit 862c9d8bb2. The
commit was accidentially pushed. Sorry for the noise.
2015-09-23 19:14:43 +02:00
Igor Minar f2724b2bbc build(travis): gracefully shut down the sauce connect tunnel after the tests are done running
This is to prevent sauce connect tunnel leaks.

Closes #12921
2015-09-23 09:40:03 -07:00
Martin Staffa 38500669f6 docs(ngList): whitespace -> newline 2015-09-23 17:35:06 +02:00
Martin Staffa 862c9d8bb2 refactor(ngModel): move model -> view update from watchFn to watchAction 2015-09-23 13:39:42 +02:00
Matias Niemelä 240d5896ec fix(ngAnimate): ensure anchoring uses body as a container when needed
Prior to this fix anchoring would allow for a container to be a document
node or something higher beyond the body tag. This patch makes it fall
back to body incase the rootElement node exists as a parent ancestor.

Closes #12872
2015-09-22 12:49:28 -07:00
Matias Niemelä 64ef084b91 revert: chore(core): introduce $$body service
Relying on the body node to be present right at injection has
caused issues with unit testing as well as some animations on
the body element. Reverting this patch fixes these issues.

Closes #12874
2015-09-22 12:47:21 -07:00
Matias Niemelä 8b27c3f064 fix(ngAnimate): callback detection should only use RAF when necessary
Callbacks are detected within the internals of ngAnimate whenever an
animation starts and ends. In order to allow the user to set callbacks
the callback detection needs to happen during the next tick. Prior to
this fix we used $$rAF to do the tick detection, however, with this
patch we intelligently use $$postDigest to do that for us and then
only issue a call to `$$rAF` if necessary.
2015-09-22 11:01:33 -07:00
Peter Bacon Darwin 8366622bed fix(ngMessages): prevent race condition with ngAnimate
If `ngMessage` tried to add a message back in that was about to be removed
after an animation, the NgMessageController got confused and tried to detach
the newly added message, when the pending node was destroyed.

This change applies a unique `attachId` to the message object and its DOM
node when it is attached. This is then checked when a DOM node is being
destroyed to prevent unwanted calls to `detach`.

Closes #12856
Closes #12903
2015-09-22 17:54:04 +01:00
Georgios Kalpakas d3de0066b0 chore(check-node-modules): make check/reinstall node_modules work across platforms
The previous implementations (based on shell scripts) threw errors on
Windows, because it was not able to `rm -rf` 'node_modules' (due to the
255 character limit in file-paths).

This implementation works consistently across platforms and is heavily based on
'https://github.com/angular/angular/blob/3b9c08676a4c921bbfa847802e08566fb601ba7a/tools/npm/check-node-modules.js'.

Fixes #11143
Closes #11353

Closes #12792
2015-09-22 15:46:13 +03:00
Martin Staffa b7e5133b2e docs(guide/Directives): fix link formatting
Closes #12909;
2015-09-22 13:11:39 +02:00
Martin Staffa 42c97c5db5 fix(ngOptions): prevent frozen select ui in IE
In certain scenarios, IE10/11/Edge create unresponsive select elements.
The following contribute to the bug:
- There need to be at least 2 selects next to each other
- The option elements are added via javascript
- the option.value is accessed before it is set
- the option.label is added after the option.value has been set
- The first select is wrappend in an element with display: inline or
display: inline-block,

This cannot be tested in a unit-test or e2e test.

Closes #11314
Closes #11795
2015-09-22 12:58:41 +02:00
Lucas Galfaso e1f4f23f78 fix($parse): block assigning to fields of a constructor
Throw when assigning to a field of a constructor.

Closes #12860
2015-09-22 10:43:43 +01:00
Peter Bacon Darwin 630280c7fb feat(ngModel): provide ng-empty and ng-not-empty CSS classes
If the `$viewValue` is empty then the `ng-empty` CSS class is applied
to the input. Conversely, if it is not empty the `ng-not-empty` CSS class
is applied. Emptiness is ascertained by calling `NgModelController.$isEmpty()`

Closes #10050
Closes #12848
2015-09-22 10:16:49 +01:00
Peter Bacon Darwin 496a67c10e test(ngModel): remove jankiness test
It is no longer appropriate to test this here as $animate takes care of
queueing up CSS class changes into a single update.
2015-09-22 10:16:13 +01:00
Lucas Mirelmann 7dcfe5e03e revert: feat($time): create time service
This reverts commit fa4c7b7f1d.
2015-09-21 21:08:37 +02:00
Ivan Verevkin 9e83b8355e docs($cacheFactory): fix call to isUndefined() in example
Closes #12899
2015-09-21 15:20:50 +03:00
Shahar Talmi 03726f7fbd fix(injector): support arrow functions with no parenthesis
with arrow functions parenthesis are optional in case you have exactly
one argument to the function. the previous regexp assumed function
arguments are always inside parenthesis and so it didn't annotate
functions like `$http => $http.get(...)` correctly

Closes #12890
2015-09-21 08:49:19 +03:00
Shahar Talmi 75893ae9e7 chore(karma): upgrade chrome in saucelabs to latest 2015-09-21 08:49:06 +03:00
Shahar Talmi d9ca245917 refactor(injector): extract common code to function 2015-09-21 08:49:06 +03:00
Shahar Talmi 3259aabdf3 chore(npm): upgrade grunt-jscs 2015-09-21 08:49:06 +03:00
Lucas Mirelmann befeeb3689 style(*): small style fixes 2015-09-20 16:46:03 +02:00
Kent C. Dodds 79577c5d31 feat($injector): add strictDi property to $injector instance
Add a strictDi property which is true or false when creating an instance of an injector.

Closes #11728
Closes #11734
2015-09-20 16:41:27 +02:00
Peter Bacon Darwin b71d7c3f3c fix(ngOptions): allow falsy values as option group identifiers
Now one can use `''`, `0`, `false` and `null` as option groups. Previously
all of these falsy values were treated as the option not being a member of
a group.

Closes #7015
Closes #7024
Closes #12888

BREAKING CHANGES
If your data contains falsy values for option groups, then these options
will now be placed into option groups. Only option groups that are `undefined`
will result in the option being put in no group. If you have data that
contains falsy values that should not be used as groups then you must
filter the values before passing them to `ngOptions` converting falsy
values to `undefined`.
2015-09-20 16:40:36 +02:00
Marcin Wosinek fa4c7b7f1d feat($time): create time service
Add simple $time service to allow easier mocking dates in applications.

Closes #10402
Closes #10525
2015-09-20 16:37:50 +02:00
Daniel Herman 652b83eb22 perf($compile): Lazily compile the transclude function
For transcluded directives, the transclude function can be lazily compiled
most of the time since the contents will not be needed until the
`transclude` function was actually invoked.  For example, the `transclude`
function that is passed to `ng-if` or `ng-switch-when` does not need to be
invoked until the condition that it's bound to has been matched.  For
complex trees or switch statements, this can represent significant
performance gains since compilation of branches is deferred, and that
compilation may never actually happen if it isn't needed.

There are two instances where compilation will not be lazy; when we scan
ahead in the array of directives to be processed and find at least two of
the following:

* A directive that is transcluded and does not allow multiple transclusion
* A directive that has templateUrl and replace: true
* A directive that has a template and replace: true

In both of those cases, we will need to continue eager compilation in
order to generate the multiple transclusion exception at the correct time.
2015-09-19 22:32:59 +02:00
Lucas Mirelmann 20cf7d5e3a fix($parse): do not convert to string computed properties multiple times
Do not convert to string properties multiple times.
2015-09-19 22:19:14 +02:00
Martin Staffa ded2518756 fix(ngOptions): throw if ngModel is not present
Closes #7047
Closes #12840

BREAKING CHANGE:
`ngOptions` will now throw if `ngModel` is not present on the `select`
element. Previously, having no `ngModel` let `ngOptions` silently
fail, which could lead to hard to debug errors. The change should
therefore not affect any applications, as it simply makes the
requirement more strict and alerts the developer explicitly.
2015-09-19 15:26:42 +02:00
Martin Staffa b366f0352a fix(input): remove workaround for Firefox bug
The bug in question has been fixed in FF 38, which is also the
current ESR, so it's safe to remove the workaround: https://bugzilla.mozilla.org/show_bug.cgi?id=1064430
2015-09-19 12:24:17 +02:00
Jason Bedard 76c2491a31 fix($compile): use createMap() for $$observe listeners when initialized from attr interpolation
Closes #10446
2015-09-19 08:46:55 +01:00
Mark Knell ef3df93afe docs(guide/Unit Testing): tighter English
Leaner, more forceful style.

Fixes a grammatical problems with subject number doesn't agrees with the verb. (originally "We have built many features into
Angular which makes...", which reduces to "features...which makes").

More authoritative use of commas, such as the Oxford comma in lists of three or more.

Sentences that are sentences, not fragments. (Yes, that was a fragment just now. I'm not writing docs now that reflect the polish of the project.)

The English grammatical/stylistic notion of parallelism.

Etc. This is just polish. The ideas are fine.

Closes #10478
2015-09-18 17:11:15 -04:00
Sjur Bakka 106f90aafa feat($http): add $xhrFactory service to enable creation of custom xhr objects
Closes #2318
Closes #9319
Closes #12159
2015-09-18 19:43:26 +01:00
Igor Minar 86e8088b38 test($sanitize): add a test to prove that html comments are being stripped
Closes #12524
2015-09-18 19:38:43 +01:00
Igor Minar a654bdfed9 refactor(): rename local variables to improve code clarity
Closes #12524
2015-09-18 19:38:38 +01:00
Igor Minar 2c22c57e58 refactor($sanitize): remove <script> from valid block elements
the script and style tag are explicitly blacklisted, so this doesn't change any functionality.
the change is done to improve code clarity.

Closes #12524
2015-09-18 19:38:32 +01:00
Igor Minar a4dfa4d061 fix($sanitize): strip urls starting with 'unsafe:' as opposed to 'unsafe'
Closes #12524
2015-09-18 19:38:25 +01:00
Igor Minar bc0d8c4eea fix($sanitize): add mXSS protection
Closes #12524
2015-09-18 19:38:18 +01:00
Igor Minar 9b84fcad76 chore(travis): disable browserstack builds for now
we don't really pay attention to them anyway.

Closes #12524
2015-09-18 19:38:12 +01:00
Igor Minar f33ce173c9 fix($compile): properly sanitize xlink:href attribute interoplation
Closes #12524
2015-09-18 19:38:05 +01:00
Igor Minar 181fc567d8 feat($sanitize): make svg support an opt-in
Closes #12524

BREAKING CHANGE: The svg support in  is now an opt-in option

Applications that depend on this option can use  to turn the option back on,
but while doing so, please read the warning provided in the  documentation for
information on preventing click-hijacking attacks when this option is turned on.
2015-09-18 19:37:59 +01:00
Igor Minar 94207f8fb6 fix($sanitize): support void elements, fixups, remove dead code, typos
Closes #12524
2015-09-18 19:37:45 +01:00
Misko Hevery 35a21532b7 refactor($sanitize): new implementation of the html sanitized parser
This implementation is based on using inert document parsed by the browser

Closes #11442
Closes #11443
Closes #12524
2015-09-18 19:37:29 +01:00
Alessandro Diaferia 1c97a6057b fix(ngResource): encode & in URL query param values
Closes #12201
2015-09-18 16:32:04 +03:00
Peter Bacon Darwin 658a865c5b fix(filters): ensure formatNumber observes i18n decimal separators
Closes #10342
Closes #12850
2015-09-18 13:45:01 +01:00
Peter Bacon Darwin f8cf28a788 chore(package.json): kick-off 1.5 branch 2015-09-17 13:42:10 +01:00
Peter Bacon Darwin 4dd10fd964 docs(CHANGELOG): add 1.4.6 changes 2015-09-17 13:39:46 +01:00
Peter Bacon Darwin 26119c09d1 chore(bower/publish): move DIST_TAG so that it gets the correct value
In the position that DIST_TAG was being assigned it was trying to get the
`distTag` value from the wrong (i.e. a bower-...) repository.
2015-09-16 23:09:47 +01:00
Georgios Kalpakas 927ebd9986 docs(select): add missing id attributes in examples 2015-09-16 10:36:02 +03:00
Jay Springate f5536ab43c docs(select): correct sample file text
Closes #12868
2015-09-16 09:56:24 +03:00
Magee Mooney 9e6a9b9922 docs(gdocs.js): fix typo (Eror -> Error)
Closes #12858
2015-09-15 07:51:41 +03:00
Magee Mooney bfa66a90c2 docs(compare-master-to-stable.js): fix typo (comands -> commands)
Closes #12857
2015-09-15 07:42:15 +03:00
Georgios Kalpakas cdd1227a30 fix(jqLite): properly handle dash-delimited node names in jqLiteBuildFragment
Fixes #10617

Closes #12759
2015-09-15 07:32:09 +03:00
Georgios Kalpakas 19ecdb54bf fix(ngJq): properly detect when ng-jq is empty
Previously, even when `ng-jq` was empty (which should force the use of
jqLite), Angular tried to find jQuery on `window['']`. If it didn't find
anything there, it would fall back to jqLite (as expected).

Nonetheless, trying to access `window['']` calls `getElementById('')`,
which issues a warning in Firefox (maybe others).

This fix properly detects when `ng-jq` is empty and avoids trying to
access `window['']`.

Fixes #12741
2015-09-14 22:43:55 +02:00
Peter Bacon Darwin 30aa3eff4c chore(scripts/publish): get dist-tag from package.json
Closes #12722
2015-09-14 21:29:16 +01:00
Peter Bacon Darwin 8d39bd8abf fix($browser): handle async updates to location
Both browser reloads and iOS 9 bugs cause the window.location to report
a different href that which we have just set. The change does not become
available until the next tick.

This change generalises previous work to deal with reloads to deal with
the iOS 9 bug in the UIWebView component.

Closes #12241
Closes #12819
2015-09-14 21:27:46 +01:00
Matias Niemelä 472d076cca fix(ngAnimateMock): $animate.flush should work for looping animations 2015-09-14 13:02:46 -07:00
Arliang 1ae0be13c2 docs(CHANGELOG): fix typo
Closes #12837
2015-09-14 11:11:25 +03:00
toastman 159efdd429 docs($httpBackend): fix typo/mismatch
There is an mismatch for status in controller and test.
In controller $scope.status = 'ERROR!' and in test we
expect($rootScope.status).toBe('Failed...') so the test will fail;

Closes #12834
2015-09-13 22:18:07 +02:00
Martin Staffa 4755a35b7d test(input): clarify a test's description and expectations
The test ensures that when the trueValue is a string, the required error
is removed, not that the model is set to the trueValue.
2015-09-13 19:23:31 +02:00
Lucas Galfaso b2f8b0b875 fix($parse): throw error when accessing a restricted property indirectly
When accessing an instance thru a computed member and the property is an array,
then also check the string value of the array.

Closes #12833
2015-09-13 16:30:58 +01:00
lucastetreault 24cd70058d refactor(*): use isDefined and isUndefined consistently
Fix any place that compares with `undefined` to use `isUndefined` and `isDefined` instead.

Closes #4365
Closes #12831
2015-09-12 17:17:11 +01:00
indrimuska e46ab43422 docs($interpolate): add missing bracket in first example
Closes #12824
2015-09-11 15:00:15 +03:00
Georgios Kalpakas 8a62a8c7f0 docs(ngInit): fix typo ("unnecesary" --> "unnecessary")
Closes #12810
2015-09-11 14:54:16 +03:00
Georgios Kalpakas b6c2f8b854 docs(CONTRIBUTING.md): mention gitter community
Closes #12782
2015-09-11 14:46:33 +03:00
Martin Staffa 00ee090f4f docs(ngMessageFormat): convert plnkr to internal example
Fixes #12801
2015-09-10 00:12:32 +02:00
Georgios Kalpakas 544001f5a3 fix(input): ignore min/max if they are empty on all input types
When the min/max attributes are empty (i.e. `attrs.min/max === ''`), there
should be no min/max validation applied (i.e. all values should be valid
wrt min/max). This works correctly for `input[number]`, but not for date
input family (`input[date/datetime-local/time/week/month]`).

In the case on `input[number]`, an empty string for `attrs.min/max` is
translated to `undefined` for `minVal/maxVal` and a check for
`isUndefined(minVal/maxVal)` ensures that no min/max validation takes
place.
For the data input family, an empty string for `attrs.min/max` is
translated to `NaN` (by `parseDate()`), so an additional check (for
`isNaN(minVal/maxVal)`) is required.

Fixes #12363

Closes #12785
2015-09-09 15:31:33 +03:00
Peter Bacon Darwin 7175d0d0e3 docs(ngRepeat): make ngInit note a bit clearer
Closes #5623
2015-09-09 13:27:05 +01:00
Peter Bacon Darwin 010d9b6853 docs(ngInit): relaxed the warning notice 2015-09-09 13:15:02 +01:00
Peter Bacon Darwin 122ab074ca fix(angular.copy): support copying XML nodes
Closes #5429
Closes #12786
2015-09-09 13:10:03 +01:00
Peter Bacon Darwin e22bf9ac78 docs(indexPage): update Case Studies link to new site 2015-09-09 11:52:01 +01:00
Akshay Agarwal 324cb6b358 docs(angular.version): fix summary description
Fix summary description of `angular.version`.
The property description is best kept for the detailed page.

Closes #12790
2015-09-08 23:26:53 +03:00
Martin Staffa 80a2176e20 docs($compile): clarify scope types and controllerAs
Closes #12537
Closes #12758
2015-09-08 11:52:01 +01:00
Peter Bacon Darwin 681affef59 style($rootScope): remove trailing whitespace 2015-09-07 22:23:44 +01:00
kwypchlo 0ca8b1df20 fix(toDebugString): change replacement string
As discussed in #10085, the original replacement string can be treated
as html when displayed by the browser so it replaces it with '...' string.

Closes #10103
2015-09-07 22:23:43 +01:00
HeberLZ 20fb626b78 fix(rootScope): add support for watchCollection to watch an object which does not inherit from Object
Closes #9964
2015-09-07 22:08:02 +01:00
HeberLZ 7ea2c7f36e fix(ngRepeat): add support to iterate an object's properties even if it does not inherit from Object
Closes #9964
2015-09-07 22:06:41 +01:00
Bernie Telles 912cbdd468 docs($rootScope): explain why watchExpression should be idempotent
This attempts to clarify the rationale. The previous sentence was a bit ambiguous.

Closes #9963
2015-09-07 21:37:50 +01:00
Jason Bedard 0202663e93 perf(Angular): only create new collection in getBlockNodes if the block has changed
Closes #9899
2015-09-07 21:34:22 +01:00
=Florian Bernstein 159bbf11ac docs($compile): improve documentation on directive $scope usage
Add information about the behavior of several directives, especially of
their scopes when applied on a single element.

Closes #5761
Closes #9727
2015-09-07 21:05:34 +01:00
Peter Bacon Darwin 9d2cc8341c test($http): remove use of deprecated success and error calls in tests 2015-09-07 14:43:33 +01:00
Pawel Kozlowski 38520a1a73 fix($http): propagate status -1 for timed out requests
Fixes #4491
Closes #8756
2015-09-07 14:30:26 +01:00
Izhaki 470eb37d29 docs(guide/directive): clarification on the 'matches' terminology
Closes #8120
2015-09-07 12:19:09 +01:00
Peter Bacon Darwin 4baf25b3ce test(ng-options): add tests for option element with no value attribute
See #6519
2015-09-07 12:01:34 +01:00
Peter Bacon Darwin eb193686a5 test(select): add tests for option element with no value attribute
See #6519
2015-09-07 12:01:33 +01:00
Peter Bacon Darwin 4bebe7830b test(ngOptions): fix typo 2015-09-07 12:01:33 +01:00
Georgios Kalpakas 146cbf7eaa style(ngAria): make JSCS happy again 2015-09-07 12:54:38 +03:00
Marcy Sutton b8e356191f doc(ngAria): update the accessibility guide
Closes #12262
2015-09-07 12:16:36 +03:00
marcysutton f48244ce5e fix(ngAria): clean up tabindex usage
* Do not put tabindex on native controls using ng-model or ng-click
* Uses a single nodeBlacklist to limit which elements receive support

Closes #11500
2015-09-07 12:13:46 +03:00
thorn0 ebba426c0c docs($compile): clarify 'sharing' controllers
The current wording may make the reader erroneously think that one controller
can belong to multiple directives.

Closes #12768
2015-09-06 11:36:52 +03:00
Martin Staffa aa11dfc162 style(formSpec): fix indentation 2015-09-04 11:42:52 +02:00
Martin Staffa c6110e8b08 fix(form, ngModel): correctly notify parent form when children are added
Test that re-added controls propagate validity changes to the parent form.

Ensure that when a form / control that was removed and then attached
to a different parent, is renamed / deleted, the new parent will
be notified of the change.

Document that dynamic adding / removing of controls may require manually
propagating the current state of the control to the parent form.
2015-09-04 11:42:51 +02:00
Martin Staffa 290b5049c2 fix(ngModel): remove reference to parentForm from removed control
This fixes cases where the control gets removed, but the control's
element stays in the DOM.
Previously, if the removed control's validity changed, a reference to
it would again be stored on its former parent form.

Fixes #12263
2015-09-04 11:42:51 +02:00
Martin Staffa f8a07dd9fe refactor(form, ngModel): streamline how controls are added to parent forms
This delegates setting the control's parentForm to the parentForm's
$addControl method. This way, the model controller saves one instance
of looking up the parentForm controller. The form controller keeps two
lookups (one for its own ctrl, one for the optional parent).

This also fixes adding the parentForm in the following case:
- a control is removed from a parent, but its corresponding DOM
element is not destroyed
- the control is then re-added to the form

Before the fix, the control's parentForm was only set once during
controller initialization, so the the parentForm would not be set on
the control in that specific case.
2015-09-04 11:42:51 +02:00
Georgios Kalpakas 6f39f10827 fix($httpBackend): send null when post-data is undefined
IE11 (and maybe others) converts an `undefined` argument to `xhr.send()` to
string (`'undefined'`) for certain request methods (e.g. DELETE). This
causes the request to appear having a body, when it shouldn't.

Fixes #12141
Fixes #12739

Closes
2015-09-03 14:08:16 +03:00
Peter Bacon Darwin c3a654b7c8 fix($animate): invalid CSS class names should not break subsequent elements
The postDigest handler was not being added if the first element in
to modify the CSS classes contained invalid CSS class names. This meant
that subsequent valid CSS class changes were not being handled since we
were not then adding the handler for those correct cases.

Closes #12674
Closes #12725
2015-09-02 12:45:11 +01:00
Peter Bacon Darwin e7293daf2a refactor($animate): move CSS class update functions out of closure 2015-09-02 12:34:08 +01:00
Mike c71d414a95 docs(doc_widgets.css): remove dead link
This removes a dead link (https://bitbucket.org/alexg/syntaxhighlighter/issues/177/superfluous-vertical-scrollbars-in-chrome)
which linked to an issue on Bitbucket that no longer exists due to
the project moving to GitHub.

Closes #12710
2015-09-01 23:45:46 +02:00
Martin Staffa 06d4e18cda docs(faq): clarify browser support
Closes #12728
2015-09-01 23:37:00 +02:00
Tim Whitbeck 966e01cf26 docs(input): mention ngMin and ngMax for all date input types
Closes #11636
Closes #12244
2015-09-01 23:29:40 +02:00
Lucas Galfaso 67afd9dc63 docs(CHANGELOG): Add breaking change notice for issue 12506
Closes #12705
2015-09-01 22:14:38 +02:00
Martin Staffa 4175860af1 docs(ngModel): improve the $setViewValue documentation
- reorder the paragraphs to highlight more important info
- clarify what can / should be passed to the method,
and what to (not) expect from it
- clarify when the method will trigger a digest

Closes #12713
Closes #11121
Closes #12498
2015-09-01 19:38:11 +02:00
Martin Staffa 6fb90bda9a docs(guide/Directives): clarify what compile means
Closes #11908
2015-09-01 18:06:23 +02:00
Nabil Kadimi 770dd2dcfd docs(misc/Downloading): use the latest stable
Closes #12534
2015-09-01 17:59:21 +02:00
Martin Staffa 0ff7bba2e3 test(select): clean up and improve the option directive tests
- add tests to ensure options with interpolated text are added / updated
- refactor tests for interpolated option values to use the
standard compile helper defined in the spec file.
- rephrase some test descriptions for clarity

Closes #12580
2015-08-31 23:54:13 +02:00
Martin Staffa 82b0929e4e fix(select): update option if interpolated value attribute changes
This is for options added without ngOptions.
Previously, an option with an interpolated value attribute would
not be updated if the binding changed, i.e. the select controller would
not recognize the changed option. Now the value attribute will
be observed if it contains an interpolation.

Closes #12005
Closes #12582
2015-08-31 23:18:19 +02:00
Lucas Galfaso 7d2c6eeef8 fix($parse): assign returns the new value
The `.assign` function returns the new value.
The version with csp enabled already has this behavior.

Closes #12675
Closes #12708
2015-08-31 22:40:23 +02:00
Ron Fenolio 6d8c1950a0 style(guide/Conceptual Overview): clean up conceptual table overview.
Clean up the conceptual overview table to make it cleaner and easier
to look at.

Closes #12620
2015-08-31 21:55:56 +02:00
Rex Salisbury 1a5ea22079 docs(guide/Forms): replace form with user
Referring to the `user` as `form` in the previews is confusing,
since it makes it seem as though the data being displayed is attached
to the `form` object, when the `form` object is separate.

Closes #12687
2015-08-31 21:15:01 +02:00
Joakim Blomskøld 4f9eb2c6e4 docs(form): add info about pending prop and class
Closes #12704
2015-08-31 21:11:03 +02:00
Martin Staffa 43769fb676 fix(ngModel): let aliased validator directives work on any element
`ng(Pattern|Minlength|Maxlength)` directives will now validate the
`ngModel` when on an element that is not an `input` or
a `textarea`. Previously, only their HTML5 counterparts worked on
every element.

This is because the three validators were extracted
into  separate directives (see 26d91b653a
and 1be9bb9d35), whereas the aliased
attribute handling assumes the validators will only exist on
`input|textarea` (see d9b90d7c10 and
25541c1f87).

Since `ngMin` and `ngMax` are also aliased attributes, this means
observers of `min` and `max` will be fired if `ngMin` and `ngMax`
change. This will happen on any element, even if it does not have
an `ngModel`. However, since min/max validators are only ever added
as part of the `input[number|textarea]` types, even if the element
has an `ngModel`, no validators will be added.

Finally the commit also tests that `ng-required` works on any element,
although that validator worked on all elements before this fix.

Fixes #12158
Closes #12658
2015-08-31 20:52:06 +02:00
Ziyu Wang 170cd96646 fix(docs): fix typo "Hasbang"
Closes #12712
2015-08-31 10:27:13 +02:00
Matias Niemelä 1d18e60ef7 docs(CHANGELOG): add changes for 1.4.5 2015-08-28 12:06:35 -07:00
Matias Niemelä ea8016c4c8 fix(ngAnimate): use requestAnimationFrame to space out child animations
This reverts the previous behaviour of using foreced reflows to deal
with preparation classes in favour of a system that uses
requestAnimationFrame (RAF).

Closes #12669
Closes #12594
Closes #12655
Closes #12631
Closes #12612
Closes #12187
2015-08-27 16:56:18 -07:00
Matias Niemelä c3d5e33e18 fix($animate): $animate.enabled(false) should disable animations on $animateCss as well
Closes #12696
Closes #12685
2015-08-27 16:29:33 -07:00
Matias Niemelä 2f6b6fb7a1 fix($animateCss): do not throw errors when a closing timeout is fired on a removed element
Closes #12650
2015-08-27 14:07:59 -07:00
Lucas Galfaso ea2518fcea test($parse): fix csp setup
Run the parse interpreter for csp enabled tests
2015-08-26 23:24:02 +02:00
grsmvg 7e67e525a5 docs(jqLite): document unsupported event object as parameter in off()/unbind()
Closes #12291
2015-08-25 15:34:19 +03:00
Martin Staffa 0e001084ff fix(ngModel): validate pattern against the viewValue
Since the HTML5 pattern validation constraint validates the input value,
we should also validate against the viewValue. While this worked in
core up to Angular 1.2, in 1.3, we changed not only validation,
but the way `input[date]` and `input[number]` are handled - they parse
their input values into `Date` and `Number` respectively, which cannot
be validated by a regex.

Fixes #12344

BREAKING CHANGE:

The `ngPattern` and `pattern` directives will validate the regex
against the `viewValue` of `ngModel`, i.e. the value of the model
before the $parsers are applied. Previously, the modelValue
(the result of the $parsers) was validated.

This fixes issues where `input[date]` and `input[number]` cannot
be validated because the viewValue string is parsed into
`Date` and `Number` respectively (starting with Angular 1.3).
It also brings the directives in line with HTML5 constraint
validation, which validates against the input value.

This change is unlikely to cause applications to fail, because even
in Angular 1.2, the value that was validated by pattern could have
been manipulated by the $parsers, as all validation was done
inside this pipeline.

If you rely on the pattern being validated against the modelValue,
you must create your own validator directive that overwrites
the built-in pattern validator:

```
.directive('patternModelOverwrite', function patternModelOverwriteDirective() {
  return {
    restrict: 'A',
    require: '?ngModel',
    priority: 1,
    compile: function() {
      var regexp, patternExp;

      return {
        pre: function(scope, elm, attr, ctrl) {
          if (!ctrl) return;

          attr.$observe('pattern', function(regex) {
            /**
             * The built-in directive will call our overwritten validator
             * (see below). We just need to update the regex.
             * The preLink fn guaranetees our observer is called first.
             */
            if (isString(regex) && regex.length > 0) {
              regex = new RegExp('^' + regex + '$');
            }

            if (regex && !regex.test) {
              //The built-in validator will throw at this point
              return;
            }

            regexp = regex || undefined;
          });

        },
        post: function(scope, elm, attr, ctrl) {
          if (!ctrl) return;

          regexp, patternExp = attr.ngPattern || attr.pattern;

          //The postLink fn guarantees we overwrite the built-in pattern validator
          ctrl.$validators.pattern = function(value) {
            return ctrl.$isEmpty(value) ||
              isUndefined(regexp) ||
              regexp.test(value);
          };
        }
      };
    }
  };
});
```
2015-08-24 17:01:20 +02:00
Peter Bacon Darwin 85e3203918 chore(npm-shrinkwrap): update to dgeni-packages 0.10.19
See https://github.com/angular/dgeni-packages/commit/313a7c3832
2015-08-23 21:40:11 -04:00
Martin Staffa f95bc42cee docs(ngAnimate): fix typo
Closes #12521
2015-08-21 12:30:02 +02:00
Martin Staffa 9080d2c53c doc(ngMock.$controller): correct controller name in bindToController example
Closes #12550
2015-08-21 11:35:10 +02:00
Matias Niemelä 728f7e2a85 docs(ngAnimate): staggering example should contain duration:0s property
As of 1.4.4 this property needs to always be in the CSS code

Related #12594
Closes #12637
2015-08-20 20:54:31 +02:00
Matias Niemelä 5f704065a7 docs(ngShow): simplify the CSS transition code
The animation example contains unnecessarily complex CSS animation
code in it and the conventions are off.

Related #12631
2015-08-20 20:47:56 +02:00
Matias Niemelä 64631bf2e6 docs(ngAnimate): remove -webkit-transition properties
This property is no longer mandatory by browsers.
2015-08-20 20:47:55 +02:00
Karl Svartholm aa35b243f8 docs(ngAnimate): remove extraneous "then"
To improve readability

Closes #12634
2015-08-20 20:44:42 +02:00
Gabriel Monteagudo 1cc9c9ca9d fix($animateCss): fix parse errors on older Android WebViews
Errors are caused by reserved keywords 'finally' and 'catch'

Closes #12610
2015-08-20 20:39:41 +02:00
Matias Niemelä dc48aadd26 fix(ngAnimate): only buffer rAF requests within the animation runners
Closes #12280
2015-08-19 10:40:37 -07:00
Matias Niemelä ebce2f7253 revert: fix(core): ensure that multiple requests to requestAnimationFrame are buffered 2015-08-19 10:39:47 -07:00
Matias Niemelä d0e50fdcd0 docs(CHANGELOG): add changes for 1.3.18 2015-08-19 01:10:06 -07:00
Matias Niemelä d88167318d fix($animateCss): properly handle cancellation timeouts for follow-up animations
Prior to this fix if `$animateCss` was called multiple on the same
element with new animation data then the preceeding fallback timout
would cause the animation to cancel midway. This fix ensures that
`$animateCss` can be triggered multiple times and only when the final
timeout has passed then all animations will be closed.

Closes #12490
Closes #12359
2015-08-17 21:02:39 -07:00
Sreenivasan K 0a75a3db6e fix($animateCss): ensure failed animations clear the internal cache
Closes #12214
Closes #12518
Closes #12381
2015-08-17 16:06:25 -07:00
Lucas Galfaso b643f0d322 fix(ngResources): support IPv6 URLs
Do not confuse IPv6 URLs domains and resource parameters.

Closes #12512
Closes #12532
2015-08-16 12:36:56 +02:00
Martin Staffa 01dd588a28 docs(select): tweak description and add examples
- Change some wordings to make them more understandable
- Reorder the paragraphs so they can be read more easily as a coherent text
- Add examples for static single / multiple selects, and non-selected option
- Add example for select with repeated options
- Remove form-related info from ngOptions select (doesn't apply)
2015-08-15 18:32:50 +02:00
Meli 3d6dc3fe31 docs(select): explain how to set default value
Setting the default value in a select is a real trap for beginners, questions about how to do this on StackExchange have been view more than 40000 times in the last year.  This changes updates the documentation to make it clearer.

Closes #12546
2015-08-15 18:32:49 +02:00
Matias Niemelä 0c81e9fd25 fix($animateCss): the transitions options delay value should be applied before class application
When `options.delay` is passed into `$animateCss`the delay style would be
applied after the add/remove CSS classes are evaluated (for transitions).
At this point it is too late for the delay to be picked up (this
functionality however does work with keyfarme animations).

This patch ensures that the provided `options.delay` value is
applied before the CSS classes are applied to the element.

Closes #12584
2015-08-14 13:58:38 -07:00
Elvio Cavalcante 5df80e1854 docs(tutorial): fix test issue
Unnecessary split. The url returns a string without the hash,
resulting in an undefined value and making the test fails.

Matches the phonecat app more closely, too.

Closes #12590
2015-08-14 15:12:39 -04:00
David Czech ba9fb82f18 docs($animate): remove redundant 'animate' in link
Closes #12568
2015-08-14 12:08:32 +02:00
Martin Staffa b497f3e47f docs(CHANGELOG): add changes for 1.4.4 2015-08-13 11:15:10 -07:00
Matias Niemelä 39b634e50a feat(ngAnimate): expose a core version of $animateCss
A core version of `$animateCss` can now be injected when
ngAnimate is not present. This core version doesn't trigger any
animations in any way. All that it does is apply the provided from
and/or to styles as well as the addClass and removeClass values.

The motivation for this feature is to allow for directives to activate
animations automatically when ngAnimate is included without the need to
use `$animate`.

Closes #12509
Closes #12570
2015-08-13 10:49:59 -07:00
Matias Niemelä cf28c1a276 chore: rename angular.bind to angular.bind.js
Some internal tests were failing since `.bind` is a JS file which
is expected to have a `.js` file name suffix.
2015-08-12 13:11:48 -07:00
sreeramu 92e41ac904 fix($animate): leave animation callback should not overridden by follow-up animation
Closes #12271
Closes #12249
Closes #12161
2015-08-12 11:59:54 -07:00
Matias Niemelä d33cedda16 fix(ngAnimate): always apply a preparation reflow for CSS-based animations
It's unpredictable sometimes to ensure that a browser triggers a reflow
for an animation. Prior to this patch, reflows would be applied
carefully in between parent/child DOM structure, but that doesn't seem
to be enough for animations that contain complex CSS styling rules.

Closes #12553
Closes #12554
Closes #12267
Closes #12554
2015-08-12 10:20:18 +02:00
Lucas Galfaso 6838c97945 perf($q): small $q performance optimization
Only generate a new promise when `then` receives some non-undefined parameter

Closes #12535
2015-08-11 23:37:46 +02:00
Ilya Mochalov f827a8e050 docs($interval): cancel() ignores falsy parameter
Closes #12552
2015-08-11 16:57:01 -04:00
Luke Waite a844138060 docs($sce): correct typo
Fix markdown quotation of a `;` so that it is properly rendered in the docs.
Makes it more consistent with the other codeblocked characters in the
list.

Closes #12549
2015-08-11 10:50:21 -04:00
Caitlin Potter 8ae9e94ecb style(loader): make jscs happy 2015-08-11 10:43:49 -04:00
Frank 1bd451d082 docs(angular.module): simplify wording+improve grammar
A suggestion on the wording of retrieving a moudle

Closes #12543
2015-08-11 10:42:44 -04:00
arm1n c11a7d676f fix(ngOptions): allow empty option selection with multiple attribute
Fixes #12511
Closes #12541
2015-08-10 22:13:48 +02:00
Lucas Galfaso 0827e88e21 style(jscs): fix whitespace 2015-08-09 13:03:48 +02:00
Lucas Galfaso 1363cbd6b4 style(jshint): fix jshint warning 2015-08-09 12:40:28 +02:00
Lucas Galfaso 44a96a4c14 fix($injector): Allows ES6 function syntax
Closes #12424
Closes #12425
2015-08-09 12:20:31 +02:00
Lucas Galfaso 1cf10ab810 chore(saucelabs): Upgrade Chrome and Firefox to the latest versions
Closes #12430
2015-08-09 12:19:38 +02:00
Lucas Galfaso ed3a33a063 feat(orderBy): Stable sort the input
Stable sort the input array

Closes #12408
Fixes #12405
2015-08-08 22:33:53 +02:00
Martin Staffa a268c29fb0 fix(ngModel): correct minErr usage for correct doc creation
Remove the `new` from the minErr assignment, so the closure compiler
can detect the errors correctly. Also removes the leading $ from the
variable name to be consistent with the Angular.js file.

Closes #12386
Closes #12416
2015-08-08 17:57:23 +02:00
Martin Staffa adb286389c docs(form): explain why the empty-string setter is created 2015-08-07 19:28:11 +02:00
Lucas Galfaso 94533e5706 refactor(form): remove the use of the private setter function
Remove the private `setter` function from $parse
Replace the `setter` from the `form` directive with $parse

Closes #12483
2015-08-07 14:47:09 +02:00
Rouven Weßling 99d2c46a16 refactor(): remove more bits and pieces related to Internet Explorer 8
Closes #12407
2015-08-07 14:29:55 +02:00
Yun Liu 929ec6ba5a style($http): fix typo in useLegacyPromise var
Closes #12515
2015-08-07 14:13:25 +02:00
luanshixia 39ff3332a3 fix(ngSanitize): escape the wide char quote marks in a regex in linky.js
Escape the wide char quote marks in a regex in linky.js

Closes #11609
2015-08-06 23:09:22 +02:00
Ryan Hendry 4c92a3ccc7 style(ngAnimate): add missing semi-colon
Adding missing semi-colon which is breaking minification

Closes #12513
2015-08-06 22:30:18 +02:00
Steve Mao dc0b856e9c docs(CONTRIBUTING): correct spelling and grammar
Summary:
  - Use properly capitalized GitHub brand name
  - Correctly negate two clauses using "nor" (caitp feels this may confuse
non-english speakers and need to be revised, but hopefully not)
  - Correctly end sentence with period

Closes #12497
2015-08-04 09:24:03 -04:00
Martin Staffa bb281f85e7 docs(.Scope): correct link to scope guide 2015-08-03 22:09:45 +02:00
Martin Staffa 496e08a605 docs($rootScope.Scope): remove obsolete line, and link to guide
The removed line pointed to a removed example. Re-adding the example
would have been of questionable value, as it introduced several
concepts without context. It's therefore better to link to the guide,
which provides a better introduction.

Closes #12167
2015-08-03 21:55:40 +02:00
Eric Adams 548a1348d9 docs(guide/Dependency Injection): fix angular.injector arguments list
The original file included a code sample using `angular.injector(['myModule', 'ng'])`,
which appears to be incorrect when trying to retrieve anything attached to `myModule`.
Reversing the args fixes this.

Closes #12292
2015-08-03 21:07:48 +02:00
Derk Vedelaar 9845570be8 docs(tutorial/7 - Routing): update angular version
The versions are updated in the angular-phonecat repo, but not in
the documentation. This change syncs the version numbers.

Closes #12396
2015-08-03 21:02:53 +02:00
Satish Maurya 35d35e6a7e docs(guide/Forms): display scope form / master data in examples
It will be good to have the binding results in the CSS classes /
binding to form / control state example, similar to the Simple Form
example.

Closes #12326
2015-08-03 20:56:25 +02:00
Martin Probst 5abf593e6b fix(injector): check that modulesToLoad isArray.
When users accidentally just pass a single string, e.g.
`angular.injector('myModule')`, this change give them a better error message.

Currently Angular just reports that the module with the name 'm' is missing,
as it's iterating through all characters in the string, instead of all strings
in the module.

Closes #12285
2015-08-03 10:18:19 +02:00
ArchmageInc 9efe60f294 docs($q): add $q.when and $q.resolve callback arguments
Closes #12372
2015-08-03 10:13:37 +02:00
Jacob Carter 8553b56e97 docs(ngOptions): close select element
Close select element in html example to stop errors occurring for copy/paste users

Closes #12384
2015-08-03 10:12:12 +02:00
Rouven Weßling a8f7e9cfde feat($httpProvider): add 'useLegacyPromiseExtensions' configuration
The legacy methods, `success` and `error`, have been deprecated.

Set this to `false` to cause `$http` to throw an error if these methods are
used in the application.

For now it defaults to `true`. In a future release we will remove these
methods altogether.

DEPRECATION NOTICE:

The legacy methods 'success' and 'error' on promises returned by $http
are now deprecated.

Closes #12112
Closes #10508
2015-08-01 20:34:30 +01:00
Lucas Galfaso 7b8a16b238 refactor($locale): use en-us as generic built-in locale
Previously there was a custom built en-us locale that was included with
angular.js. This made likely that it would get out of sync with the real
en-us locale that is generated from the closure library.

This change removes that custom one and uses the generated one instead.
This also has the benefit of preventing the unwanted caught error on trying
to load `ngLocale` during angular bootstrap.

Closes #12462
Closes #12444
Closes #12134
Closes #8174
2015-07-31 22:07:27 +02:00
Steven d2695b04a7 docs(guide): Facebook was mispelled as Faceb0ok
Fixes typo :>

Closes #12470
2015-07-30 19:45:39 -04:00
Peter Bacon Darwin 6f3b8622ad fix($compile): don't trigger $observer if initial value is undefined
Closes #12383
Closes #12464
2015-07-30 23:23:08 +01:00
Strikeskids 97ac7634df docs($rootScope.Scope): improve clarity describing $watch with no listener
The previous explanation in parentheses created a bit of confusion because the documentation stated to leave off the `listener`, but then said "be prepared for multiple calls to your listener". The new explanation clarifies that it is indeed the `watchExpression` that will be executed multiple times.

Closes #12429
2015-07-30 15:22:40 -04:00
Laisky.Cai ef3846a7a6 docs(guide/expression): replace tt by code
Replaces <tt> elements with <code> in expressions guide. Looks identical
in Chromium

Closes #12437
2015-07-30 12:50:34 -04:00
patyatka 93985804a9 docs($compile): fix typo
Closes #12443
2015-07-30 12:32:42 -04:00
Caitlin Potter 533d9b7670 fix($compile): ignore optional =-bound properties with empty value
Previously, optional empty '='-bound expressions were ignored ---
erroneously they stopped being ignored, and no tests were caused to
fail for this reason. This change restores the original ignoring
behaviour while still preventing other errors fixed by 8a1eb16

Closes #12144
Closes #12259
Closes #12290
2015-07-29 16:58:18 +01:00
Matias Niemelä 0d6fc2dce5 fix(ngAnimate): ensure that only string-based addClass/removeClass values are applied
Related #11268
Closes #12458
Closes #12459
2015-07-29 14:07:10 +01:00
Peter Bacon Darwin addb1ae37d test(guide/expression): we must tell protractor to wait for the alert appear
This is a better solution than f91eb0e9ec
2015-07-28 14:41:01 +01:00
Jochen Niebuhr f13852c179 fix(Angular): allow unescaped = signs in values in parseKeyValue
In some cases people will not follow all URL standards and may have
unescaped = characters in their GET parameter values. Currently $location
will not parse them correctly dropping everything after the unescaped =.

This change includes all characters after the first `=` up to the next `&`.

Closes #12351
2015-07-27 22:30:28 +01:00
Peter Bacon Darwin 5298672411 fix(ng/$locale): by default put negative sign before currency symbol
It seems that the case where the negative sign goes between the currency
symbol and the numeric value is actually the special case and that locales
that require this have it built in. So we should default to having the
negative sign before the symbol.

See http://cldr.unicode.org/translation/number-patterns and
http://unicode.org/cldr/trac/ticket/5674

Closes #10158
2015-07-27 22:21:28 +01:00
Peter Bacon Darwin 058d462fa7 revert: refactor($locale): use en-us as generic built-in locale
This reverts commit 70ce425e6a.

There are internal projects in Google that generate their own version
of angular.js and so this commit caused those projects to break.

We are going to look into a more satisfactory way of getting this change
in.
2015-07-27 22:00:14 +01:00
Peter Bacon Darwin f91eb0e9ec test(expression): add sleep(100) to protractor spec that uses alert
In Chrome, if two alert boxes pop up, without enough time between them,
Protractor (or possibly ChromeDriver) sometimes fails to recognize the
second alert.
2015-07-27 21:53:14 +01:00
Matias Niemelä 861636c625 fix($animate): make sure to run a post-digest reflow for parentless animations
Closes #12400
Closes #12401
2015-07-27 16:21:50 -04:00
Lucas Galfaso e7423168fb fix(input): Firefox validation trigger
Do not trigger Firefox validation on form initialization.
- Do not set a value to an <input> field if the field already has the same value

Closes #12102
2015-07-26 19:40:05 +02:00
Martin Staffa 4bcf6c17c8 docs(ngOptions): remove obsolete trkslct error page
Closes #12417
2015-07-26 19:35:56 +02:00
Blake Johnston d506b8a9df docs($compile): pluralize DOM element
Previous description includes singular `collection of DOM element`. Current change revises `element` to be plural.

Closes #12431
2015-07-26 19:34:14 +02:00
Lucas Galfaso e0cf496f3c fix($rootScope): don't clear phase if $apply is re-entered
We cannot re-enter a `$apply` block while already in a `$apply` or `$digest`
phase.

Before this change such an invalid call to `$apply` was incorrectly clearing
the phase, which meant that a second invalid `$apply` call was being allowed.

Closes #12174
2015-07-25 20:44:08 +01:00
Sreenivasan K a5221f320a fix(merge): regExp should not be treated as a objects when merging.
angular.merge({ key: /regexp/ }) now works the way you'd expect it to.

Horray!

Closes #12419
Closes #12409
2015-07-24 09:00:31 -04:00
Lucas Galfaso 18a2e4fbfc fix(httpParamSerializerJQLike): Follow jQuery for index of arrays of objects
Follow jQuery when serializing arrays that contain objects

Close #12393
Close #12398
2015-07-23 23:05:20 +02:00
Matias Niemelä 32d3cbb3aa fix(ngAnimate): ensure that parent class-based animations are never closed by their children
This fix ensures that a structural child animation will never close a
parent class based early so that the CSS classes for the child are ready
for it to perform its CSS animation. The reasoning for the past for this
was because their is a one frame delay before the classes were applied.
If a parent and a child animation happen at the same time then the
animations may not be picked up for the element since the CSS classes
may not have been applied yet.

This fix ensures that parent CSS classes are applied in a synchronous
manner without the need to run a one RAF wait. The solution to this was
to apply the preparation classes during the pre-digest phase and then
apply the CSS classes right after with a forced reflow paint.

BREAKING CHANGE: CSS classes added/removed by ngAnimate are now applied
synchronously once the first digest has passed.

The previous behavior involved ngAnimate having to wait for one
requestAnimationFrame before CSS classes were added/removed. The CSS classes
are now applied directly after the first digest that is triggered after
`$animate.addClass`, `$animate.removeClass` or `$animate.setClass` is
called. If any of your code relies on waiting for one frame before
checking for CSS classes on the element then please change this
behavior. If a parent class-based animation, however, is run through a
JavaScript animation which triggers an animation for `beforeAddClass`
and/or `beforeRemoveClass` then the CSS classes will not be applied
in time for the children (and the parent class-based animation will not
be cancelled by any child animations).

Closes #11975
Closes #12276
2015-07-20 14:21:59 -07:00
Matias Niemelä acc53ce6ad revert: fix(ngAnimate): ensure nested class-based animations are spaced out with a RAF 2015-07-20 14:21:53 -07:00
Matias Niemelä 0f6d37ead5 chore(ngAnimate): skip adding the preparation classes when options.$$skipPreparationClasses is present 2015-07-20 14:21:43 -07:00
Matias Niemelä 11695ca6e2 fix($animateCss): make sure that skipBlocking avoids the pre-emptive transition-delay styling 2015-07-20 14:21:35 -07:00
ColinFletch cce084ee89 docs(guide/Controllers): Syntax adjustments.
Closes #12379
2015-07-19 17:39:53 +02:00
Jesse Mandel d935c245c0 docs(guide/module): fixed link to blog post
Closes #12165
Closes #12250
2015-07-19 16:41:55 +02:00
Matthew Hill b871b98a57 docs(filter.js): documents second parameter to .register
Closes #12378
2015-07-19 14:49:30 +02:00
Lucas Galfaso 1cb6bd4944 chore(angularFiles.js): Remove deleted file 2015-07-18 12:04:03 +02:00
bluepnume 3abb3fefe6 fix($q): Use extend to avoid overwriting prototype
Use `extend` on `Promise.prototype` and `Deferred.prototype`, to avoid having to
manually set `constructor` on the overwritten prototypes.

Closes #10697
2015-07-18 11:42:42 +02:00
Lucas Galfaso 8ed682941a chore(asyncCallback): Remove dead code
Closes #12371
2015-07-18 11:13:23 +02:00
Olen Davis 44ce9c8288 fix(ngAnimate): allow animations on body and root elements
Closes #11956
Closes #12245
2015-07-17 11:30:06 -07:00
Matias Niemelä 2ff1b09ab7 chore: replace jqLite($document[0].body) with $$body 2015-07-17 11:29:54 -07:00
Matias Niemelä 976cd036da chore(core): introduce $$body service
This patch makes it easier to gain access to document.body
via the injector.
2015-07-17 11:29:48 -07:00
sreeramu 21d6db382d fix($animate): ensure that class-based animations are properly applied when cancelled
Instead of merging existing animation option to new animation options we can
merge in reverse and utilize old animation runner.

Closes #12266
Closes #12007
2015-07-17 11:24:31 -07:00
Matias Niemelä fc7d2d2737 chore($$forceReflow): create service for issuing reflows in animations 2015-07-17 09:42:47 -07:00
Matias Niemelä c77b607e61 chore(mocks): remove $$animateReflow from triggerReflow()
This service was removed when 1.4.0 was released, but the mock
code still stubs it.
2015-07-17 09:42:47 -07:00
jbnizet ec22d2276e docs(CHANGELOG): fix release date of 1.4.3 version
Closes #12356
2015-07-17 10:44:03 +03:00
Matias Niemelä 344dffbc54 docs($animateCss): add missing options flag to animation example
Closes #12202
2015-07-16 14:33:57 -07:00
startswithaj 7db5f361b0 fix(ngAnimate): $timeout without invokeApply
This change calls $timeout with the invokeApply
parameter set to false which stops ngAnimate
from invoking its changes inside an $apply block

Closes #12281
Closes #12282
2015-07-16 14:29:40 -07:00
shoja d494a69ef6 docs($sce): correct typos
Line 548: Remove duplicate 'not' and clarify wording
Line 556: Remove period within parenthetical statement
Line 560: Clarify wording
Line 570: Capitalize 'E.g.' at the start of a sentence

Closes #12252
2015-07-16 22:28:32 +02:00
Ashish Dasnurkar 91212d9440 docs($cookiesProvider): fixed a typo
"This is *import* so that cookies will be visible" should be "This is *important* so that cookies will be visible"

Closes #12264
2015-07-16 22:27:02 +02:00
Nabil Kadimi b661887072 docs(guide/Dependency Injection): minor punctuation fixes
Closes #12268
2015-07-16 22:25:18 +02:00
Mohamed Samy 60b7b003fd docs(tutorial/7 - Routing): fix matching in test
It is corrected in github, but not in the angular.org site.
Copied it from https://github.com/angular/angular-phonecat/compare/step-6...step-7

Closes #12314
2015-07-16 22:20:01 +02:00
Andrew Passanisi 6ba5404406 docs(error/ctrlfmt): fixed a small typo in ctrl error message
Closes #12320
2015-07-16 22:18:08 +02:00
Peter Bacon Darwin 2b68136a20 chore(ngLocale): regenerate locales
This regeneration takes into account the changes due to:

* update to closure library 27.0.1
* fix to default position of negative sign in currency formats

Closes #12307
Closes #12362
2015-07-16 19:20:11 +01:00
Peter Bacon Darwin dc49b4d952 chore(i18n): update closure library 2015-07-16 19:20:11 +01:00
Peter Bacon Darwin 96f2e3bef5 fix(i18n): by default put negative sign before currency symbol
It seems that the case where the negative sign goes between the currency
symbol and the numeric value is actually the special case and that locales
that require this have it built in. So we should default to having the
negative sign before the symbol.

See http://cldr.unicode.org/translation/number-patterns and
http://unicode.org/cldr/trac/ticket/5674

Closes #10158
2015-07-16 19:20:11 +01:00
Peter Bacon Darwin 70ce425e6a refactor($locale): use en-us as generic built-in locale
Previously there was a custom built en-us locale that was included with
angular.js. This made likely that it would get out of sync with the real
en-us locale that is generated from the closure library.

This change removes that custom one and uses the generated one instead.
This also has the benefit of preventing the unwanted caught error on trying
to load `ngLocale` during angular bootstrap.

Closes #12134
Closes #8174
2015-07-16 19:19:39 +01:00
Peter Bacon Darwin 9e492c358c fix($location): don't crash if navigating outside the app base
Previously, if you navigate outside of the Angular application, say be clicking
the back button, the $location service would try to handle the url change
and error due to the URL not being valid for the application.

This fixes that issue by ensuring that a reload happens when you navigate
to a URL that is not within the application.

Closes #11667
2015-07-16 18:46:13 +01:00
Peter Bacon Darwin 92c7ce5bec refactor($location): compute appBaseNoFile only once 2015-07-16 18:46:13 +01:00
Peter Bacon Darwin 618356e481 fix(ngCsp): allow CSP to be configurable
There are two different features in Angular that can break CSP rules:
use of `eval` to execute a string as JavaScript and dynamic injection of
CSS style rules into the DOM.

This change allows us to configure which of these features should be turned
off to allow a more fine grained set of CSP rules to be supported.

Closes #11933
Closes #8459
Closes #12346
2015-07-16 12:26:24 +01:00
Peter Bacon Darwin 1f4aa47193 docs(migration): clarify non-numeric matching
Closes #12350
2015-07-15 13:52:56 +01:00
Peter Bacon Darwin 528cedaa0c docs(CHANGELOG): Remove redundant items from 1.4.3 changes
The update to the change log for the 1.4.3 release accidentally included
a number of changes from previous releases.
2015-07-15 12:34:46 +01:00
Matias Niemelä 1622182737 docs(CHANGELOG): add changes for 1.4.3 2015-07-14 18:26:10 -07:00
Matias Niemelä 36efe6c1a2 test($animateCss): avoid unnecessary checking for transition-timing-function
There is no need to check for this in the test and it adds complexity
for linux-based browsers.
2015-07-14 14:07:50 -07:00
Matias Niemelä 5081982e30 test($animateCss): ensure that transitionStyle by itself doesn't trigger anything
Using `transitionStyle` without any other properties does not trigger an
animation so we could have a test to assert that it doesn't do that.
2015-07-14 13:45:11 -07:00
Matias Niemelä 97d79eec80 fix($animateCss): ensure animations execute if only a keyframeStyle is provided
`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes #12124
Closes #12340
2015-07-14 13:45:03 -07:00
Matias Niemelä e4aeae0c73 fix(ngAnimate): ensure that orphaned elements do not throw errors when animated
This fix ensures that both `$animateCss` and `$animate` swallow the error
when an animation takes place in the sitation that the element is removed
from the parent element sometime before or during the preparation stages of the
animation.

Closes #11975
Closes #12338
2015-07-14 21:06:55 +01:00
Dominic Watson 7202bfafcd docs(ngAnimate) - Correct keyframe to keyframeStyle 2015-07-14 10:42:05 -07:00
Steve Mao 4cef752985 docs(CONTRIBUTING): state what is mandatory or optional
Closes #12032
2015-07-13 13:24:52 +01:00
Steve Mao d38f6ff401 docs(CONTRIBUTING): how to write a breaking change
Closes #12032
2015-07-13 13:24:44 +01:00
Steve Mao 8f6dac9536 docs(CONTRIBUTING): revert is a modifier
EG: https://github.com/angular/angular.js/commit/462f444b06ae5cad3ccb761b1dba7131df01a655

Closes #12032
2015-07-13 13:24:34 +01:00
Peter Bacon Darwin de5b8dc781 docs(guide/controller): add a line about controller as 2015-07-13 13:22:01 +01:00
Peter Bacon Darwin 41834e6f4a docs(guide/controller): add a line about controller as 2015-07-13 13:18:29 +01:00
niteshthakur dbb42b5c85 docs(guide/controller): clarify that controllers are defined **by** a constructor function
A controller is a instantiated object created **from** a constructor function.
It was not accurate to describe a Controller **as** a constructor function.

Closes #11888
2015-07-13 13:18:29 +01:00
Peter Bacon Darwin f012374f12 docs($routeChangeSuccess): note that resolve values are available on current route
Closes #11413
2015-07-13 13:10:47 +01:00
Rouven Weßling 14e0b9c352 refactor(ngCsp): use document.head
The `head` property is available from IE9 onwards.

Closes #11905
2015-07-13 09:37:03 +01:00
Jerry Orta 9ea52d818b fix(loader): define isFunction
Closes: #12299
Closes: #12287
2015-07-10 22:54:58 +02:00
Martin Staffa d518a64d93 docs(CHANGELOG): add changes for 1.4.2 2015-07-06 22:19:53 +02:00
Wesley Cho fe0af2c073 chore(animate): remove dead code
- Remove unused `$$asyncCallback`

Fixes #12251
Closes #12254
2015-07-02 22:57:00 +02:00
marcysutton 1f5e42e882 feat(ngAria): add option to disable role=button
Closes #11580
Closes #12234
2015-07-02 14:36:49 +03:00
Jeff Cross d193c3a25c revert: "fix($compile): do not write @-bound properties if attribute is not present"
This reverts commit 8a1eb1625c.

This commit broke the tabs component on the material project,
which caused internal breakages. Will open a separate issue to
look into the issue.
2015-07-01 22:12:03 -07:00
Raphael Jamet 4da1cc3b81 refactor($templateRequest): Remove useless dependencies in tests 2015-07-01 12:15:00 -07:00
Raphael Jamet 6de08216e7 docs($templateRequest): update the description with caching changes
The previous changes to $templateRequest were not documented, they now are.
2015-07-01 12:15:00 -07:00
Raphael Jamet 3c6e8ce044 refactor($templateRequest): move $sce checks and trust the cache
Move all the calls to $sce.getTrustedUrl inside $templateRequest, and
also trust the contents of the cache. This allows prefetching templates
and to bypass the checks on things where they make no sense, like
templates specified in script tags.

Closes #12219
Closes #12220
Closes #12240
2015-07-01 12:14:42 -07:00
Peter Bacon Darwin e51024ed54 docs(ngAnimate): fix typos 2015-06-30 13:19:52 +01:00
Chris Bosco 04f1ebd470 docs(guide/Migrating): $animate.on/off example updated to match docs
Closes #12212
2015-06-30 03:05:05 +01:00
Bart Verkoeijen 2e63ab734a docs(guide/Migrating): add breaking change for 1.4 regarding controller constructors.
If you previously returned a object from a controller constructor function,
it would not be bound to the scope. As of 1.4 it does, and can cause
unexpected objects as the scope.

Closes #12227
2015-06-30 02:59:46 +01:00
Georgios Kalpakas 6333d65b76 fix($compile): throw error when requestng new and isolate scopes (async)
While directives are not allowed to request both a new (normal) and an
isolate scope on the same element, the relevant check was not performed
correctly when the directive requesting the isolate scope had a lower
priority and specified a `templateUrl`.
In that case, the check was deferred until the template was fetched, but
the info about other directives requesting a new (normal) scope was not
properly preserved (in `previousCompileContext`).

This commit fixes this, so now an error is thrown (as expected).

Fixes #12215
Closes #12217
2015-06-28 11:33:06 +03:00
Yichao Wang 1ce5d216c7 docs(ngAnimate): fix typos in JS and CSS selector
Closes #12203
2015-06-25 12:42:17 +03:00
Georgios Kalpakas 28c166939e test($compile): test default value for optional attribute with new scope
Related to #12151
Closes #12194
2015-06-24 10:25:55 +02:00
Peter Bacon Darwin 14638f4a60 fix(ngOptions): only watch numeric properties of an array
It turns out that the options that are displayed are more constrained than
just whether the property starts with a $ character.
If the values collection is array-like then we only display the options that
are identified by numerical properties - it's an array right?

So this commit aligns `getWatchables` with `getOptions`.

See #12010
2015-06-23 17:47:34 -07:00
Peter Bacon Darwin 0c1fbdd242 chore(doc-gen): update to dgeni-packages 0.10.17
Make proper use of the new `git` package in dgeni-packages
2015-06-23 04:41:45 -07:00
Martin Staffa 33f7f26558 docs(ngChecked): note that it shouldn't be used with ngModel
Closes #11106
2015-06-22 23:39:08 +02:00
Martin Staffa e27eed3ca4 docs(ngCookies): improve deprecation notice 2015-06-22 23:37:50 +02:00
Gabriel Monteagudo 6cbbd96647 fix(merge): treat dates as atomic values instead of objects.
Makes angular.merge copy dates correctly.

Closes #11720

Closes #11720
2015-06-22 21:21:09 +02:00
Phil Brown d0cb69348e docs($http): set correct link to XMLHttpRequest.responseType
The link to MDN XMLHttpRequest.responseType was incorrect.

Closes #12183
2015-06-22 18:51:46 +02:00
Jandalf f15f8df2b4 docs($httpProvider): typo fix
fix a typo:
default.cache -> defaults.cache
2015-06-21 14:07:13 +02:00
Peter Bacon Darwin e7662ebc31 docs(directives): add multiElement tag to appropriate directives
Closes #11104
2015-06-21 01:52:01 +01:00
Peter Bacon Darwin 8ceed4faf3 chore(dependencies): update to dgeni-packages 0.10.15
Closes #11104
Closes #11418
2015-06-21 01:51:31 +01:00
Tsuyoshi Yoshizawa 6903b5ec4c fix($location): allow navigating outside the original base URL
Previously, if you navigated outside of the current base URL angular
crashed with a `Cannot call method 'charAt' of undefined` error.

Closes #11302
Closes #4776
2015-06-19 18:40:28 +01:00
Peter Bacon Darwin 48e1f5605e fix(orderBy): ensure correct ordering with arrays of objects and no predicate
By refactoring to use a Schwartzian transform, we can ensure that objects
with no custom `toString` or `toValue` methods are just ordered using
their position in the original collection.

Closes #11866
Closes #11312
Closes #4282
2015-06-18 08:36:16 +01:00
Peter Bacon Darwin c5a3d8fc5f refact(filter): move hasCustomToString into shared namespace to be reused 2015-06-18 08:33:28 +01:00
Martin Staffa c61149213b docs(CHANGELOG): fix position for some entries in 1.4.1 2015-06-17 23:57:54 +02:00
Stéphane Campinas ad7200e2c2 docs(tutorial/Tutorial): add missing word
Closes #12147
2015-06-17 21:19:02 +02:00
Alfonso Presa bea74c0f56 docs(ngTouch): Document event parameter for $swipe handlers
Document that the event handlers provided by $swipe do receive the raw
event as their last parameter.

Closes #11983

Closes #12149
2015-06-17 21:17:33 +02:00
Martin Staffa bacc3b7e0e docs(tutorial): make docTutorialReset use a button
It's confusing to have it look like a link that goes to the homepage

Closes #1473
2015-06-17 21:14:39 +02:00
Caitlin Potter 8a1eb1625c fix($compile): do not write @-bound properties if attribute is not present
Shadows only when attributes are non-optional and not own properties,
only stores the observed '@' values when they are indeed strings.

Partial revert of 6339d30d1379689da5eec9647a953f64821f8b0

Closes #12151
Closes #12144
2015-06-17 17:40:12 +01:00
Peter Bacon Darwin ed27e0ea6a docs(CHANGELOG): fix typo 2015-06-17 14:35:25 +01:00
Peter Bacon Darwin f81ff3beb0 fix($browser): prevent infinite digest if changing hash when there is no hashPrefix
The `window.location.hash' setter will strip of a single leading hash character
if it exists from the fragment  before joining the fragment value to the href
with a new hash character.

This meant that if we want the fragment to lead with a hash character, we
must do `window.location.hash = '##test'` to ensure that the first hash
character in the fragment is not lost.

The `$location.hash` setter works differently and assumes that the value
passed is the the full fragment, i.e. it does not attempt to strip off a
single leading hash character.

Previously, if you called, `$location.hash('#test')`, the leading hash was
being stripped and the resulting url fragment did not contain this hash:
`$location.hash()`, then became 'test' rather than `#test`, which led to
an infinite digest.

Closes #10423
Closes #12145
2015-06-17 14:01:20 +01:00
Martin Staffa 720012eab6 docs(resource): clarify success callback arguments
Closes #7730
2015-06-16 19:50:42 +02:00
Kent C. Dodds 3adfe5bda9 docs(guide/Unit Testing): add variable declaration to $filter test
The $filter example never declares `$filter` and therefore would add
`$filter` to the global namespace. Add variable declaration.

Closes #12129
2015-06-16 19:12:10 +02:00
Martin Staffa dc0467879d docs(input[radio]): clarify difference between value and ngValue
Closes #7971
2015-06-16 19:11:11 +02:00
Peter Bacon Darwin 528d7f9568 docs(CHANGELOG): add 1.4.1 changes 2015-06-16 14:52:17 +01:00
Georgios Kalpakas 636ce70e47 style(forms): fix indentation in example 2015-06-16 15:34:02 +03:00
Nir Noy 5f5ee0f880 docs(forms): remove redundant call to $scope.$apply()
As of Angular 1.3 `$setViewValue` already calls `$apply` and triggers a
digest cycle, so now there is no need wrapping the `$setViewValue`
function call with `$apply`, which will just trigger an additional digest
cycle.
2015-06-16 13:20:57 +03:00
Thomas Landauer 46b7cf7464 docs(filter): document third argument of predicate function 2015-06-15 20:50:59 +02:00
Martin Staffa 860edee65b docs(changelog): fix typo
Closes #12085
2015-06-15 20:45:28 +02:00
Caitlin Potter ebd0fbba8f fix(forms): parse exponential notation in numberInputType parser
Support parsing numbers in exponential notation, which Number.prototype.toString() returns
for sufficiently high numbers.

Closes #12121
Closes #12122
2015-06-15 08:46:47 -04:00
Rouven Weßling 093416f60f chore(npm): add the license to package.json
This removes a warning when executing npm install.

Closes #12111
2015-06-15 14:17:56 +03:00
Martin Staffa 0400dc9c2a docs($http): expand the param serializer docs
Closes #11745
Closes #12064
2015-06-14 13:36:37 +02:00
Lucas Galfaso 71fc3f4fa0 fix($parse): set null reference properties to undefined
When there is an expression of the form
* true && a.b.c
* true && a()
* true && a()()
* false || a.b.c
* false || a()
* false || a()()

where `a == null`

Closes #12099
2015-06-13 12:38:57 +02:00
Martin Staffa 8caf1802e0 fix(compile): assign ctrl return values correctly for multiple directives
Fixes #12029
Closes #12036
2015-06-12 21:41:55 +02:00
Peter Bacon Darwin 91b602263b fix($location): do not get caught in infinite digest in IE9
Thanks to @hamfastgamgee for getting this fix in place.

Closes #11439
Closes #11675
Closes #11935
Closes #12083
2015-06-12 14:35:46 +01:00
Lucas Galfaso 0934b76b72 fix(ngModel): form validation when there is an Object.prototype enumerable value
When adding an Object.prototype enumerable property, this should not be confused
as a form error

Closes #12066
2015-06-11 23:25:08 +02:00
Caitlin Potter 571bee7b2f test($location): ensure mock window can be wrapped by jqLite
Fixin da build

Closes #12086
2015-06-11 12:04:56 -04:00
Peter Bacon Darwin 11055132bf test($locationSpec): refactor and clean up tests 2015-06-11 14:29:13 +01:00
Peter Bacon Darwin 0898b1240b test($logSpec): don't pollute the global namespace with helpers 2015-06-11 13:29:15 +01:00
Conny Sjöblom 8dc09e6dab fix(linky): allow case insensitive scheme detection
Closes #12073
Closes #12073
2015-06-10 14:38:55 +01:00
Lucas Galfaso 799353c75d fix($sanitize): dont not remove tab index property
Closes #8371
Closes #5853
2015-06-10 11:48:00 +02:00
David Link ffac747e84 docs(tutorial/Tutorial): clarify what npm install does
If the reader does not cd into angular-phonecat subdirectory,
npm install will not work.
This comment helps newbies understand npm install is dependent
on a custom project.json file.

Closes #12040
2015-06-09 21:41:12 +02:00
Martin Staffa 998340de7f docs(select): correct workaround for numeric option bc 2015-06-09 21:35:59 +02:00
Georgios Kalpakas 559313652e test($compile): fix test
The fixed test is supposed to test a fix for an IE11 bug/peculiarity that
arises when using a specifically configured MutationObserver on the page
(see #11781 for more info).
The configuration contained a typo (`sublist` instead of `subtree`), which
effectively failed to set up the MutationObserver in a way that would make
the IE11 bug appear.

Closes #12061
2015-06-09 18:29:26 +03:00
Martin Staffa a69251ab55 docs(select): add note about breaking change with numeric values
Closes #12052
2015-06-08 21:15:14 +02:00
David Anderton 7e5248a33f docs(orderBy): correctly is not the right word
The use of correctly implies that Angular is doing something incorrect, however it is that we expect a number passed as a string to be sorted as a number. Angular does not do what we are expecting, although it responds correctly to what we have actually asked - sorting based on the string representation of a number.

Closes #12046
2015-06-08 21:15:10 +02:00
Martin Staffa c210ff5eae docs($compile): correct what gets passed to ctrl argument
Closes #11903
2015-06-08 21:15:07 +02:00
Jason Bedard 9efb0d5ee9 perf($compile): avoid jquery data calls when there is no data 2015-06-08 12:16:09 +02:00
Jason Bedard 0e622f7b5b fix(copy): do not copy the same object twice 2015-06-08 12:12:56 +02:00
Martin Staffa 071be60927 docs($animateCss): fix a dangling link 2015-06-06 14:45:01 +02:00
Martin Staffa a25aa5b577 docs(input[number]): mention incompatibility with allowInvalid
Closes #11390
2015-06-06 14:44:56 +02:00
Josh Sherick df9c720d08 docs(tutorial/step0): display list correctly
Two bullet points were indented causing the entire lines
to be formatted as code by markdown.
Decreased indentation level by one, as it seems this was not the intention.

Closes #12035
2015-06-06 14:44:52 +02:00
Will Fong 4fe141f794 docs(tutorial/index): add a "next step" sentence
All the other pages have a "continue to next page" link
at the bottom of the page. Keeps a nice reading flow.

Closes #12038
2015-06-06 14:44:28 +02:00
Lucas Galfaso f3b1d0b723 fix($compile): workaround for IE11 MutationObserver
IE11 MutationObserver breaks consecutive text nodes into several text nodes.
This patch merges consecutive text nodes into a single node before
looking for interpolations.

Closes #11781
2015-06-06 11:26:40 +02:00
qbzzt 288225b080 docs(ngClass): add class 'has-error' to demonstrate hyphen use
Modify the example, to show that, when using `ngClass`'s map syntax,
hyphenated classes (e.h. such as those used by Bootstrap) must be enclosed
in quotes.

Closes #12027
2015-06-06 01:34:31 +03:00
Matias Niemelä e967abcd30 docs(CHANGELOG): add changes for 1.3.16 2015-06-05 13:40:38 -07:00
Igor Minar 2c3cd8126c docs(http): add info about unique cookies and XSRF protection on shared domains
Closes #12028
2015-06-04 22:15:55 -07:00
Martin Staffa 41385f0afc docs(*): improve accessibility of links
Closes #7932
2015-06-04 23:00:43 +02:00
Martin Staffa 500b0f6cdb docs(guide/expressions): include filters in one-time binding examples
Closes #8776
2015-06-04 23:00:40 +02:00
Allan Bogh 40b27280ab docs(ngAria): clarify which module to include for ngAria
Closes #11802
2015-06-04 23:00:37 +02:00
Kevin Huang b73c64e2fb docs(guide/Conceptual Overview): remove text from in-page anchor tags
The in-page anchor tags that serve as bookmarks for information about views and models have
visible text content that unintentionally makes them seem like clickable links navigating to
other parts of the page or to entirely different pages.

Closes #11450
2015-06-04 23:00:34 +02:00
fahdsheikh 2f5d42ec72 docs(changelog): fixed grammatical error
Changed "a animation" to "an animation" for grammatical consistency

Closes #11672
2015-06-04 23:00:31 +02:00
Georgios Kalpakas 25d731e9b0 docs(orderBy): fix JSCS trailing whitespace error 2015-06-04 10:55:07 +03:00
Robert Jenks 15da7cc3dc docs(orderBy): improve sorting behaviour and move logic into the controller
Improve the sorting behaviour in the 2nd example: Clicking on an unsorted
column sorts in ascending order, while clicking on a sorted column sorts
in descending order. Also, add a simple sort indicator.

Closes #11981
2015-06-04 10:11:16 +03:00
Peter Bacon Darwin 34a6da24c1 fix(ngOptions): do not watch properties starting with $
Expressions that compute labels and track by values for ngOptions were
being called for properties, that start with $ even though those properties
were being ignored as options.

Closes #11930
Closes #12010
2015-06-04 06:28:00 +01:00
Georgios Kalpakas ebaa0f5985 fix(ngAria): update aria-valuemin/max when min/max change
As a result of thi fix, `ngMin/Max` also set `aria-valuemin/max` on
"range"-shaped elements.

Fixes #11770

Closes #11774
2015-06-03 21:23:38 +02:00
Dominick bb15d414c6 docs(guide/Modules): simple grammar fix
the module consist of… --> the module consists of…

Closes #11843
2015-06-03 21:07:46 +02:00
Dominick f056036a4a docs(guide/security): remove errant word
Closes #11870
2015-06-03 21:06:44 +02:00
Dominick a055762027 docs(guide/i18n): grammar fix
contraction "it's" --> possessive "its"
2015-06-03 21:06:19 +02:00
Dominick 82d38e4453 docs(guide/Using $location): format parameter name
Format parameter name as code. (It's used elsewhere in this doc page in code examples, as code itself.)
2015-06-03 21:04:13 +02:00
Steve Mao 6a743f0b5b docs(ngModelOptions): make object notation style consistent
There is a space before and after `{` and `}` for most of the objects throughout the docs.

Closes #11871
2015-06-03 21:03:16 +02:00
shoja 31f6f76291 docs($httpBackend): correct typo
docs($httpBackend): correct typo

Correct "send" to "sent".

Closes #11876
2015-06-03 21:02:50 +02:00
David Eriksson a2b5a5ed5f docs($cookiesProvider): escape HTML
Escape the "base" HTML element so it will be displayed in the online documentation.

Closes #11897
2015-06-03 21:01:47 +02:00
Boris Cherny 1d41e8a975 docs(ngRepeat): document that track by must be the last expression
this is a point of confusion that's not well documented. see #5520

Closes #11934
2015-06-03 20:57:56 +02:00
Pascal Precht 01182dfbb8 docs(ngMessages): fixes logical bug
The paragraph below this changes says:

"Then the `required` message will be displayed first."

`required` needs to be `true` to match that sentence.

Closes #12009
2015-06-03 19:59:26 +02:00
Yuriy Bash e17f85cc5b docs(ngMessages): fix spelling error
Closes #12019
2015-06-03 19:56:51 +02:00
Steven Easter d7dc14dc0c fix(ngOptions): use reference check only when not using trackBy
Change the check on changed value for ngOptions to ensure that a reference check is only done
when trackBy is not used.  Previously, if trackBy was being used but the values of the objects were
equal a reference check was then used which would cause the check to be true if the objects had
different memory references but the values were equal.  This can cause issues with forms being
marked dirty when the value of the model as not actually changed.

Closes #11936
Closes #11996
2015-06-02 12:37:33 +01:00
Henry Zhu 578fa019b3 chore(jscs): remove .jscs.json.todo, rename config to .jscsrc
Closes #11993
2015-06-02 10:29:54 +01:00
Michal Miszczyszyn 3c9096efb4 test(ngAria): test that aria-hidden/disabled are always "true" or "false"
Previously, when using ngAria with the ng-hide directive,
and the value passed to ng-hide was not boolean,
the aria-hidden attribute was set to this non-boolean value.

Closes #11865
Closes #11998
2015-06-01 23:13:22 +02:00
Fred Sauer 59273354b5 fix(ngAria): ensure boolean values for aria-hidden and aria-disabled
aria-hidden should mirror the boolean representation of their ng-*
counterpart (ng-show, ng-hide) instead of their actual value. Same
applies to aria-disabled and ng-disabled

Closes #11365
2015-06-01 23:13:21 +02:00
Xavier Haniquaut f67204794e docs(migration): fix minor typo
Closes #11994
2015-06-01 21:51:47 +01:00
Wenhua Zhao b6389eedda chore(injector): avoid invoking noop 2015-06-01 11:48:36 +02:00
Ran Ding a6339d30d1 fix($compile): exception when using "watch" as isolated scope binding variable in Firefox
Fix on all binding modes: '=', '@' and '&' as well as optional cases
Throw exception when user define 'hasOwnProperty' in binding.

Closes #11627
2015-06-01 11:36:18 +02:00
Vladimir Lugovsky 351fe4b79c feat($compile): show module name during multidir error
Show module name if possible when multidir error happens.

Closes #11775
2015-06-01 11:08:27 +02:00
Lucas Galfaso d19504a179 fix($parse): set null reference properties to undefined
When there is an expression of the form `true && a.b` and where `a == null`, then set
the value of `true && a.b` to `undefined`.

Closes #11959
2015-06-01 11:03:12 +02:00
Jeff Lee e5e871fe1a docs(ngAnimate): fix typo
Closes #11957
2015-06-01 08:03:20 +01:00
Ron Tsui 90fa884f94 docs(README): improve unusual phrasing
Closes #11958
2015-06-01 08:01:26 +01:00
Yi EungJun 80b9018f29 docs(guide/Directives): use more standard data-ng-model in example
Use data-ng-model instead of data-ng:model which is accepted for legacy reason.
The next "Normalization" section is saying:

> Best Practice: Prefer using the dash-delimited format (e.g. ng-bind for
> ngBind). If you want to use an HTML validating tool, you can instead use the
> data-prefixed version (e.g. data-ng-bind for ngBind). The other forms
> shown above are accepted for legacy reasons but we advise you to avoid
> them.

Closes #11960
2015-06-01 07:59:05 +01:00
Daniel f6ac226c8b docs(numberFilter): update to match handling of null and undefined
This changed in 2ae10f67fc, where null and
undefined are passed through.

Closes #11963
2015-06-01 07:55:37 +01:00
Michael Watts 2d22380873 docs(guide/Scopes): capitalisation of word scope
Closes #11970
2015-06-01 07:50:12 +01:00
Peter Bacon Darwin 7c49d9986f docs(README.closure.md): clarify sentence
Closes #11979
2015-06-01 07:48:21 +01:00
pholly 209f4f3e0f docs(guide/Expressions): added special case for one-time binding of object literals under Value stabilization algorithm
One time binding of object literals are treated differently than simple expressions. Added a link to Ben Nadel's article describing how object literals's keys are checked for undefined.

Closes #11982
2015-06-01 07:42:22 +01:00
Tero Parviainen 5d68c763e2 refactor($compile): remove unused elementTransclusion argument
Remove the unused elementTransclusion argument from createBoundTranscludeFn.
Also remove the nodeLinkFn.elementTranscludeOnThisElement attribute, which
becomes unnecessary.

Closes #9962
Closes #11985
2015-06-01 07:36:36 +01:00
Ryan Dale 3ef529806f feat($q): $q.resolve as an alias for $q.when
New "when" alias "resolve" to maintain naming consistency with ES6.

Closes #11944
Closes #11987
2015-06-01 07:31:51 +01:00
Matias Niemelä 291d7c467f docs(CHANGELOG): add changes for 1.4.0 2015-05-26 17:34:50 -07:00
Matias Niemelä db246eb701 fix(ngAnimate): close follow-up class-based animations when the same class is added/removed when removed/added
This patch ensures that if the same CSS class is added/removed within a
follow-up digest then the previous class-based animation is cancelled
beforehand.

Closes #11717
2015-05-26 14:22:20 -07:00
Matias Niemelä 72edd4dff9 fix($animate): ignore invalid option parameter values
Prior to this fix there was another patch that threw an exception if the
provided options value was not of an object type. While this is correct
in terms of logic, it caused issues with plugins and tools that are
designed to work with multiple version of Angular. This fix ensures that
these plugins work since an invalid options value is ignored by
`$animate`.

Closes #11826
2015-05-26 14:19:38 -07:00
Peter Bacon Darwin 0fc58516f4 test(matchers): fix "not" string for toHaveClass matcher 2015-05-23 19:51:21 +01:00
Matias Niemelä e0e1b52087 fix($animateCss): ensure that custom durations do not confuse the gcs cache
Closes #11723
Closes #11852
2015-05-23 19:51:21 +01:00
Matias Niemelä 462f444b06 revert: fix(ngAnimate): throw an error if a callback is passed to animate methods
This reverts commit 9bb4d6ccbe.
2015-05-22 13:48:48 -07:00
Georgios Kalpakas 19ec9936fe docs(ngPattern): add note about using the g flag
Add a note to point out that using the `g` flag on the validation RegExp,
will cause each search to start at the index of the last search's match,
thus not taking the whole input value into account.

Closes #11917
Closes #11928
2015-05-22 22:20:07 +03:00
Matias Niemelä 213c2a7032 fix(ngAnimate): ensure nested class-based animations are spaced out with a RAF
Prior to this fix any nested class-based animations (animations that are
triggered with addClass/removeClass or ngClass) would cancel each other
out when nested in DOM structure. This fix ensures that the nested
animations are spaced out with sequenced RAFs so that parent CSS classes
are applied prior to any ancestor animations that are scheduled to run.

Closes #11812
2015-05-21 14:44:53 -07:00
Julie Ralph 3545abfc31 chore(test): update protractor to 2.1 2015-05-21 12:21:21 -07:00
Matias Niemelä 3a3db690a1 fix(ngAnimate): class-based animations must not set addClass/removeClass CSS classes on the element
With the abstraction system that ngAnimate uses, $animateCss internally
sets the provided `event` as a CSS class on the element. In this
situation the `addClass` and `removeClass` events on the element as a
CSS class. This should not happen with class-based animations and this
feature is unnecessary and has now been removed.

Closes #11810
2015-05-20 20:41:39 -07:00
Matias Niemelä 2327f5a0a7 fix(ngAnimate): ensure that repeated structural calls during pre-digest function
Prior to this fix if `$animate.enter()` or `$animate.leave()` was called
before a digest was issued then the element may not be cancelled early
enough. This fix ensures that the previous structural animation is
cancelled immediately when a follow-up animation is kicked off.

Closes #11867
2015-05-20 20:34:25 -07:00
Matias Niemelä 718ff84405 fix(ngAnimate): ensure that cancelled class-based animations are properly cleaned up
Prior to this fix if the same CSS class was added and removed quickly
then the element being animated would be left with a stale cache of the
cancelled out animation. This would then result in follow-up animations
being added to the previous animation which would then never run. A
stale cache was to blame for that. This patch takes care of this issue.

Closes #11652
2015-05-19 20:54:10 -07:00
Gonzalo Ruiz de Villa 1b0d0fd8d0 feat(filterFilter): allow array like objects to be filtered
Throw error if filter is not used with an array like object.

Closes #11782
Closes #11787
2015-05-20 02:00:42 +03:00
Craig Warren 4090491c73 fix(select): prevent unknown option being added to select when bound to null property
If a select directive was bound, using ng-model, to a property with a value of null this would
result in an unknown option being added to the select element with the value "? object:null ?".
This change prevents a null value from adding an unknown option meaning that the extra option is
not added as a child of the select element.

Since select (without ngOptions) can only have string value options then `null` was never a
viable option value, so this is not a breaking change.

Closes #11872
Closes #11875
2015-05-18 22:30:00 +01:00
Peter Bacon Darwin 5b18250594 docs(select): provide more info and example about non-string options
See #11890
2015-05-18 22:16:12 +01:00
Matias Niemelä f26fc26f6e fix($animate): accept unwrapped DOM elements as inputs for enter + move
Prior to this fix the $animate.enter() and $animate.move() events caused
an error when a parent or after element was provided that was not
already wrapped as a jqLite element. This patch ensures that both
wrapped and unwrapped DOM nodes are allowed.

Closes #11848
2015-05-18 11:59:12 -07:00
Martin Staffa d9bf6e3ea5 docs(migration): general style improvements
Closes #11849
2015-05-18 20:54:48 +02:00
Max Thyen f7a4b48121 fix($http): do not modify the config object passed into $http short methods
Update $http's createShortMethods and createShortMethodsWithData
to extend an empty object instead of the passed-in config.
Previously, since $http was extending the passed-in config,
the changes to the config object persisted even after the call to $http's
get/post/etc. returned. This causes unexpected behavior if that
config object is reused in subsequent calls to $http.
The existing test in httpSpec was not properly testing this situation.

Closes: #11764
2015-05-18 13:57:54 +02:00
Peter Bacon Darwin 98048678dc docs(error//nocb): add error doc for invalid parameter 2015-05-14 13:33:04 -07:00
Peter Bacon Darwin 9bb4d6ccbe fix(ngAnimate): throw an error if a callback is passed to animate methods
As of bf0f5502b1 (released in 1.3.0) it is no longer
valid to pass a callback to the following functions: `enter`, `move`, `leave`, `addClass`,
`removeClass`, `setClass` and `animate`.

To prevent confusing error messages, this change asserts that this parameter is
not a function.

Closes #11826
Closes #11713
2015-05-14 13:32:58 -07:00
Matias Niemelä 64c66d0eea fix(ngAnimate): ensure anchored animations remove the leave element at correct time
Due to a mismatch of where the `options.domOperation` value was stored,
the element involved in the `leave` animation for an anchored animation
session was not removed as soon as the leave animation ended. This
resulted in a pending element persisting within the DOM until all
animations involved in the associated anchor animation were complete.
This patch fixes this issue.

Closes #11850
2015-05-14 13:24:28 -07:00
Peter Bacon Darwin 13e38db7a3 docs(CHANGELOG): update to 1.4.0-rc.2 2015-05-12 19:52:36 +01:00
Matias Niemelä 0681a5400e feat(ngAnimate): ensure JS animations recognize $animateCss directly
JS Animations now recognize the response object returned from a call to
`$animateCss`. We can now setup our JS animation code to fully rely on
$animateCss to take charge without having to call the doneFn callback on
our own.

```js
// before
.animation('.my-css-animation', function($animateCss) {
  return {
    enter: function(element, doneFn) {
      var animator = $animateCss(element, {
        event: 'enter',
        structural: true,
        from: { background: 'red' },
        to: { background: 'blue' }
      });
      animator.start().done(doneFn);
    }
  };
});

// now
.animation('.my-css-animation', function($animateCss) {
  return {
    enter: function(element) {
      return $animateCss(element, {
        event: 'enter',
        structural: true,
        from: { background: 'red' },
        to: { background: 'blue' }
      });
    }
  };
});
```
2015-05-07 14:33:28 -07:00
Matias Niemelä d5683d2116 fix($animateCss): ensure that an object is always returned even when no animation is set to run
Before in RC0 and RC1 $animateCss would not return anything if a
CSS-based animation was not detected. This was a messy API decision
which resulted in the user having to have an if statement to handle the
failure case. This patch ensures that an animator object with the start()
and end() functions is always returned. If an animation is not detected
then the preperatory CSS styles and classes are removed immediately and
the element is cleaned up, however a "dump" animator object is still
returned which allows for callbacks and promises to be applied.

The returned object now also contains a `valid` property which can be
examined to determine whether an animation is set to run on the element.

BREAKING CHANGE: The $animateCss service will now always return an
object even if the animation is not set to run. If your code is using
$animateCss then please consider the following code change:

```
// before
var animator = $animateCss(element, { ... });
if (!animator) {
  continueApp();
  return;
}
var runner = animator.start();
runner.done(continueApp);
runner.then(continueApp);

// now
var animator = $animateCss(element, { ... });
var runner = animator.start();
runner.done(continueApp);
runner.then(continueApp);
```
2015-05-07 14:33:20 -07:00
Matias Niemelä df24410c17 fix(ngAnimate): force use of ng-anchor instead of a suffixed -anchor CSS class when triggering anchor animations
This fix changes anchored animations in ngAnimate to not append a series
of CSS classes with a `-suffix` prefix to the anchor element. Use
the `ng-anchor` instead CSS class instead.

BREAKING CHANGE: Prior to this fix there were to ways to apply CSS
animation code to an anchor animation. With this fix, the suffixed
CSS -anchor classes are now not used anymore for CSS anchor animations.

Instead just use the `ng-anchor` CSS class like so:

```html
<div class="container-animation" ng-if="on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>

<div class="container-animation" ng-if="!on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>
```

**before**:
```css
/* before (notice the container-animation CSS class) */
.container-animation-anchor {
  transition:0.5s linear all;
}
```

**now**:
```css
/* now (just use `ng-anchor` on a class that both the
   elements that contain `ng-animate-ref` share) */
.my-anchor-element.ng-anchor {
  transition:0.5s linear all;
}
```
2015-05-07 14:03:54 -07:00
Matias Niemelä e6d053de09 fix(ngAnimate): rename ng-animate-anchor to ng-anchor
BREAKING CHANGE: if your CSS code made use of the `ng-animate-anchor`
CSS class for referencing the anchored animation element then your
code must now use `ng-anchor` instead.
2015-05-07 14:03:47 -07:00
Matias Niemelä e001400237 fix(ngAnimate): ensure that shared CSS classes between anchor nodes are retained
This patch ensures that all of the CSS classes that exist on both
anchor nodes (the nodes that contain a `ng-animate-ref` attribute)
are not removed from the cloned element during the anchor animation.
(Previously the `in` animation would accidentally remove the CSS
classes of the first element.)

Closes #11681
2015-05-07 14:03:31 -07:00
Matias Niemelä 1002b80a6f fix(ngAnimate): prohibit usage of the ng-animate class with classNameFilter
Since ngAnimate uses the `ng-animate` CSS class internally to track
state it is better to keep this as a reserved CSS class to avoid
accidentally adding / removing the CSS class when an animation is
started and closed.

BREAKING CHANGE: partially or fully using a regex value containing
`ng-animate` as a token is not allowed anymore. Doing so will trigger a
minErr exception to be thrown.

So don't do this:

```js
// only animate elements that contain the `ng-animate` CSS class
$animateProvider.classNameFilter(/ng-animate/);

// or partially contain it
$animateProvider.classNameFilter(/some-class ng-animate another-class/);
```

but this is OK:

```js
$animateProvider.classNameFilter(/ng-animate-special/);
```

Closes #11431
Closes #11807
2015-05-07 13:02:45 +01:00
Matias Niemelä 7bb01bae72 docs(ngAnimate): add docs for the usage of the ng-animate CSS class 2015-05-07 13:01:55 +01:00
Matias Niemelä f7e9ff1aba fix(ngAnimate): ensure that the temporary CSS classes are applied before detection
Prior to 1.4 the `ng-animate` CSS class was applied before the CSS
getComputedStyle detection was issued. This was lost in the 1.4
refactor, however, this patch restores the functionality.

Closes #11769
Closes #11804
2015-05-07 12:49:47 +01:00
Caitlin Potter f7b999703f fix(ngClass): add/remove classes which are properties of Object.prototype
Previously, ngClass and ngAnimate would track the status of classes using an ordinary object.
This causes problems when class names match names of properties in Object.prototype, including
non-standard Object.prototype properties such as 'watch' and 'unwatch' in Firefox. Because of
this shadowing, ngClass and ngAnimate were unable to correctly determine the changed status
of these classes.

In orderto accomodate this patch, some changes have been necessary elsewhere in the codebase,
in order to facilitate iterating, comparingand copying objects with a null prototype, or which
shadow the `hasOwnProperty` method

Summary:

- fast paths for various internal functions when createMap() is used
- Make createMap() safe for internal functions like copy/equals/forEach
- Use createMap() in more places to avoid needing hasOwnProperty()

R=@matsko

Closes #11813
Closes #11814
2015-05-06 19:45:04 -04:00
Kent C. Dodds b2ae35cd2c docs(error/nonassign): add optional binding example
Closes #11701
2015-05-06 17:50:10 +01:00
Matias Niemelä 64d05180a6 fix(ngAnimate): ensure that all jqLite elements are deconstructed properly
Prior to this fix if a form DOM element was fed into parts of the
ngAnimate queuing code it would attempt to detect if it is a jqLite
object in an unstable way which would allow a form element to return an
inner input element by index. This patch ensures that jqLite instances
are properly detected using a helper method.

Closes #11658
2015-05-05 16:39:28 -07:00
Peter Bacon Darwin b5a9053ba3 fix(ngOptions): ensure that tracked properties are always watched
Commit 47f9fc3e70 failed to account for changes to
the tracked value of model items in a collection where the select was `multiple`.

See https://github.com/angular/angular.js/pull/11743#discussion_r29424578

Closes #11784
2015-05-05 22:45:06 +01:00
Matias Niemelä db20b830fc fix(core): ensure that multiple requests to requestAnimationFrame are buffered
IE11 (and maybe some other browsers) do not optimize multiple calls to
rAF. This code makes that happen internally within the $$rAF service
before the next frame kicks in.

Closes #11791
2015-05-05 14:20:05 -07:00
Matias Niemelä 2aacc2d622 fix(ngAnimate): ensure animations are not attempted on text nodes
With the large refactor in 1.4.0-rc.0, the detection code failed to
filter out text nodes from animating. This fix ensures that now properly
happens.

Closes #11703
2015-05-05 14:18:18 -07:00
Vladimir Lugovsky bab474aa8b fix($compile): ensure directive names have no leading or trailing whitespace
Closes #11397
Closes #11772
2015-05-05 21:07:19 +01:00
Peter Bacon Darwin f2c94c61d1 style($http): add missing semi-colon 2015-05-05 20:44:59 +01:00
Lucas Galfaso 2420a0a77e fix($httpParamSerializerJQLike): follow jQuery logic for nested params
Closes #11551
Closes #11635
2015-05-05 20:32:59 +01:00
Peter Bacon Darwin 9711e3e10e docs(guide/i18n): fix internal link to MessageFormat Extensions section 2015-05-05 20:17:27 +01:00
Peter Bacon Darwin ae826b007c docs(angular.element): clarify when jquery must be loaded for Angular to use it
Closes #3716
2015-05-05 20:01:26 +01:00
Nick Anderson 2ea23e0685 test(ngRepeat): fix test setup for ngRepeat stability test
The repeated template contained `{{key}}:{{val}}` but the repeat expression
was `"item in items"`, so `key` and `val` were not actually available.

The tests were passing anyway, since they did not rely upon the actual
text content of the template.

Closes #11761
2015-05-05 19:58:16 +01:00
Peter Bacon Darwin f1663088c3 docs($location): fix trailing whitespace
Closes #11741
Closes #11744
2015-05-05 19:54:15 +01:00
Damien Nozay 84daf9752a docs($location): explain difference between $location.host() and location.host.
Closes #11741
Closes #11744
2015-05-05 19:43:01 +01:00
Rich Snapp 426a5ac054 fix(jqLite): check for "length" in obj in isArrayLike to prevent iOS8 JIT bug from surfacing
Closes #11508
2015-05-05 17:54:46 +01:00
Peter Bacon Darwin 6874cca158 docs($injector): add array annotation to all injectable parameters
Closes #11507
2015-05-05 14:57:51 +01:00
Kevin Brogan 34c1a68fa8 docs($provide): add array annotation type to $provide.decorator parameter
The $provide.decorator function, as per the documentation, "is called using
the auto.injector.invoke method and is therefore fully injectable."

The current @param contradicts this by stating that only a functions may
be used as an argument.

Closes #11507
2015-05-05 14:51:15 +01:00
Peter Bacon Darwin 1268b17bc1 test(ngOptions): remove unnnecessary var 2015-05-01 21:36:05 +01:00
Peter Bacon Darwin ae98dadf6d fix(ngOptions): ensure label is watched in all cases
Closes #11765
2015-05-01 21:22:31 +01:00
Martin Staffa a2a684fe24 docs(changelog): wrap jqLite example containing html with code block
This prevents the markdown parser from garbling the input and putting
out broken html.

Closes #11778
Fixes #11777
Fixes #11539
2015-05-01 21:00:02 +01:00
Kent C. Dodds 40e00cdf34 docs(ngJq): update to indicate common pitfall
change docs for ngJq so it mentions that the placement of the directive is important with regards to the angular script.

Closes #11779
Closes #11780
2015-05-01 09:43:40 -04:00
Peter Bacon Darwin dfa722a8a6 fix(ngOptions): iterate over the options collection in the same way as ngRepeat
In `ngRepeat` if the object to be iterated over is "array-like" then it only iterates
over the numerical indexes rather than every key on the object. This prevents "helper"
methods from being included in the rendered collection.

This commit changes `ngOptions` to iterate in the same way.

BREAKING CHANGE:

Although it is unlikely that anyone is using it in this way, this change does change the
behaviour of `ngOptions` in the following case:

* you are iterating over an array-like object, using the array form of the `ngOptions` syntax
(`item.label for item in items`) and that object contains non-numeric property keys.

In this case these properties with non-numeric keys will be ignored.

** Here array-like is defined by the result of a call to this internal function:
https://github.com/angular/angular.js/blob/v1.4.0-rc.1/src/Angular.js#L198-L211 **

To get the desired behaviour you need to iterate using the object form of the `ngOptions` syntax
(`value.label` for (key, value) in items)`).

Closes #11733
2015-05-01 12:22:24 +01:00
Leonardo Braga cc961888cd docs(ngModel): improve formatting of $modelValue
Closes #11483
2015-04-30 22:54:14 +02:00
Rodrigo Parra 69f4d0ff70 docs(ngSwitch): Replace tt tag with code tag
Use of tt is discouraged, see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tt
http://www.w3.org/wiki/HTML/Elements/tt

Closes #11509
2015-04-30 22:50:54 +02:00
Jeff Wesson 7a04968673 docs(form): replace obsolete tt element
Removes the [**obsolete** HTML Teletype Text Element `<tt>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tt)
and replaces it with [`<code>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code).
This adds more semanticity and is part of the [HTML5 specification](http://www.w3.org/TR/html5/text-level-semantics.html#the-code-element).

Closes #11570
2015-04-30 22:49:17 +02:00
Steve Mao f2f9843ea8 docs(ngCloak): remove information for ie7
IE7 is not supported. Also change `#template2` text to `'world'`.

Closes #11661
2015-04-30 22:47:23 +02:00
Ron Tsui 7d57961b63 style(docs): improve formatting in code comment
Closes #11674
2015-04-30 22:44:51 +02:00
thatType 477e4047f7 docs(contribute): transpose "however" and "it's"
Transpose "however" and "it's" on line 156 for slightly better readability

Closes #11686
2015-04-30 22:43:31 +02:00
Ryan Atkinson b35e744791 docs(ngAnimate): fix typo in 'greetingBox' directive
Closes #11766
Closes #11747
2015-04-30 22:42:02 +02:00
Peter Bacon Darwin d83bddcb79 chore(docs): include attribute type in directive usage
Closes #11415
2015-04-29 17:47:48 +01:00
Peter Bacon Darwin 5db6709f8d chore(utils.js): only set maximum stack size on non-win32 machines
Closes #4831
2015-04-29 16:32:10 +01:00
Brent Dearth f3b393258e docs(select): remove obsolete ngOptions equality check comments 2015-04-29 10:40:17 -04:00
Peter Bacon Darwin 47f9fc3e70 fix(ngOptions): use watchCollection not deep watch of ngModel
Using a deep watch caused Angular to enter an infinite recursion in the
case that the model contains a circular reference.  Using `$watchCollection`
instead prevents this from happening.

This change means that we will not re-render the directive when there is
a change below the first level of properties on the model object. Making
such a change is a strange corner case that is unlikely to occur in practice
and the directive is not designed to support such a situation. The
documentation has been updated to clarify this behaviour.

This is not a breaking change since in 1.3.x this scenario did not work
at all. Compare 1.3.15: http://plnkr.co/edit/zsgnhflQ3M1ClUSrsne0?p=preview
to snapshot: http://plnkr.co/edit/hI48vBc0GscyYTYucJ0U?p=preview

Closes #11372
Closes #11653
Closes #11743
2015-04-29 14:30:36 +01:00
Mike Calvanese 74eb17d7c8 fix(ngTouch): check undefined tagName for SVG event target
When target click element is an SVG, event.target.tagName and event.target.blur are undefined in Chrome v40 on iOS 8.1.3
2015-04-27 21:46:18 +01:00
gonengar c075126c2e docs(guide/Unit Testing): fixing the example for testing filter.
Hi there,
It seems that in the example which starts at line 256 there needs to
be an injection for $filter as in the previous example.

Closes #11410
2015-04-27 22:35:08 +02:00
Logesh Paul 6c632d9cb0 docs(*): definition list readability improvement
Closes #11398
Closes #11187
2015-04-27 22:35:06 +02:00
Viktor Zozulyak feeea8a1c8 docs(angular.injector): missing optional parameter mark
Closes #11528
2015-04-27 22:35:02 +02:00
yankee42 d20de4abe7 docs(ngModel): use arguments.length instead of angular.isDefined(newName) to distinguish getter/setter usage
Closes #11604
2015-04-27 22:34:59 +02:00
Adam 071b1bc790 docs(angular.element): css() api incompatibility.
"When a number is passed as the value, jQuery will convert it to a string and add px to the end of that string."
http://api.jquery.com/css/#css2

jqLite does not appear to do this.

I can submit if fix desired.

Closes #11614
2015-04-27 22:34:57 +02:00
Bruno Coelho 4089f538c3 docs(guide/Scopes): remove unnecessary parenthesis
Closes #11645
2015-04-27 22:34:54 +02:00
cexbrayat 03d4bbc16f docs(ngJq): fix directive usage 2015-04-27 22:34:51 +02:00
Michał Gołębiowski 6d07005b18 chore(docs): don't use Chrome Frame
Chrome Frame has stopped development with Chrome 32 release; we shouldn't rely
on it in the docs.

Closes #11742
2015-04-27 21:29:30 +01:00
Jaco Pretorius 266bc6520b feat($resource): include request context in error message
include the request context (method & url) in badcfg error message

Closes #11363
2015-04-27 19:08:35 +02:00
micellius f0dd7c0374 docs(CHANGELOG): change name for 1.4.0-rc.1
Align version name for 1.4.0-rc.1 to be compliant with version naming convention:
Sartorial Chronography => sartorial-chronography

Closes #11732
2015-04-27 19:01:46 +02:00
Adrian-Catalin Neatu f0b88e047e docs(guide/Migrating from Previous Versions): spelling mistake
Closes #11739
2015-04-27 18:56:48 +02:00
Emmanuel DEMEY ef2435d176 docs(guide/Accessibility): remove an extra "a" in the A11Y doc
Closes #11740
2015-04-27 18:54:41 +02:00
Mike Calvanese 95521876eb fix(ngTouch): don't prevent click event after a touchmove
Remove the touchmove handler so that resetState is not called on touchmove.
The touchend event handler already prevents the click from being triggered
if the distance moved exceeds the MOVE_TOLERANCE, so detection of touchmove
is not needed. Previously, because of resetState on touchmove, the click would
not be triggered even if the event coordinates changed by only 1px or 2px,
which seems to be very common for taps on mobile browsers.

Closes #10985
2015-04-27 14:28:09 +01:00
Kent C. Dodds 4eb16ae4b7 docs($q): improve documentation of promises that resolve with another promise
Adds short explanation of promise chaining and a link for further explanation.

Closes #11708
Closes #11712
2015-04-27 14:20:31 +01:00
Matias Niemelä c10b249e3d docs(CHANGELOG): add changes for 1.4.0-rc.1 2015-04-24 11:26:10 -07:00
Matias Niemelä d97b658797 docs(ngAnimate): add docs for animation anchoring 2015-04-24 11:11:30 -07:00
Matias Niemelä 90e424b206 fix($animateCss): ensure that rAF waiting loop doesn't ignore pending items during a flush
Some animations may involve multiple stages of RAF requests before they
are run. This issue may cause an animation never to fire since the rAF
waiting queue may be modified during the flush stage and the code would
only pay attention to its starting length. This fix makes the rAF
flushing loop pay attention to the length with each iteration.
2015-04-24 11:11:21 -07:00
Matias Niemelä 8f819d2cb5 fix($animate): ensure that from styles are applied for class-based animations 2015-04-24 11:11:12 -07:00
Slaven Tomac abf59c285c fix(select): allow empty option to be added dynamically by ng-repeat
The select directive supports provision of an "empty" element that is used
if the value of the select is undefined.

This fix ensures that this empty option can be provided dynamically after
the initial compilation has completed.

Closes #11470
Closes #11512
2015-04-22 18:00:34 +01:00
Igor Minar 8914f8e3b1 chore(travis): set 'sudo: false' and reenable travis cache
For some reason our jobs are being routed to the 'build.linux' travis queue, which has the travis cache
disabled. In order for us to get the cache reenabled we need to get our jobs into the 'builds.docker' queue.
This can be achieved via setting 'sudo: false' in .travis.yaml
2015-04-20 14:24:05 -07:00
Andrew Austin 249f9b81cb fix(ngAria): change accessibility keypress event to use event.which if it is provided
In Firefox, keyboard events for printable characters (e.g. space) do not use event.keyCode.
Use event.which if it is provided before falling back to event.keyCode.

Closes #11340
2015-04-20 22:59:05 +02:00
Peter Bacon Darwin 992114f7a7 fix(ngMessageFormat): ensure bindings are valid for Protractor
Closes #11644
Closes #11649
2015-04-19 02:20:43 -07:00
Matias Niemelä 103a39ca8d fix($animate): make sure the JS animation lookup is an object lookup
The lookup type was an array before, but it should be an empty object.

Closes #11619
2015-04-17 15:41:52 -07:00
Matias Niemelä 042558a380 docs(MIGRATION): add notes for the migration from 1.3 to 1.4 2015-04-17 14:50:44 -07:00
Matias Niemelä 4d437ba9f7 docs($animate): include docs for on, off, enabled and cancel 2015-04-17 14:42:05 -07:00
John Hoffman e04a887c9b fix($http): stop coercing falsy HTTP request bodies to null / empty body
Closes #11552
Closes #11593
2015-04-17 16:10:55 -04:00
Melvin 08411cf914 docs(ngMessages): fix remote include naming mismatch
ng-messages-include was loading the wrong template.
2015-04-16 15:33:04 -07:00
ElRaph 68323034d6 docs(ngMessages): missing quotation mark...
... let the example fail. It seem to be a copy paste fail.
2015-04-16 15:30:40 -07:00
Matias Niemelä 1459be170d fix(ngAnimate): close parent animations only when there are classes to resolve
Previously if a parent animation was cancelled then it would not resolve
the runner when that happens. This is now fixed in this patch. Another
fix in this patch ensures that a parent animation is only cancelled if
the animation contains any classes to resolve. This prevents inline
animations from being cancelled.
2015-04-16 13:40:09 -07:00
Matias Niemelä e41faaa2a1 feat($animate): provide support for animations on elements outside of $rootElement
Beforehand it was impossible to issue an animation via $animate on an
element that is outside the realm of an Angular app. Take for example a
dropdown menu where the menu is positioned with absolute positioning...
The element will most likely need to be placed by the `<body>` tag, but
if the angular application is bootstrapped elsewhere then it cannot be
animated.

This fix provides support for `$animate.pin()` which allows for an
external element to be virtually placed in the DOM structure of a host
parent element within the DOM of an angular app.
2015-04-15 18:35:53 -07:00
Matias Niemelä 89f081e452 fix(ngAnimate): ensure ngClass-based classes are always resolved for CSS-enabled animations 2015-04-15 17:55:29 -07:00
Matias Niemelä 3333a5c380 fix(ngAnimate): do not abort animation if only ng-anchor-in is used 2015-04-15 16:34:41 -07:00
Chirayu Krishnappa f8f07e8220 chore(bower): (un)publish angular-message-format
Closes #11606
Closes #11607
2015-04-15 15:52:19 -07:00
Chirayu Krishnappa 7683166f26 chore(bower): minor refactor to DRY
The REPOS list was duplicated in publish.sh and unpublish.sh but had
different orderings of the repos.  This commit consolidates the list
into a common include file so that they are always in sync.  We could
improve the scripts a lot more but that's not in the current scope (this
is all I need to scratch my current itch.)

Closes #11605
2015-04-15 15:52:19 -07:00
Matias Niemelä 6dd64ab5f3 fix(ngAnimate): ensure that a filtered-out leave animation always runs its DOM operation
This patch fixes the issue where filtered-out leave animations were not
properly run the DOM operation when closed.

Closes #11555
2015-04-15 13:51:19 -07:00
Matias Niemelä 3af93a5ca8 test(ngAnimate): add basic integration tests for JS/CSS $animate-based animations 2015-04-15 13:50:16 -07:00
Matias Niemelä bee14ed1e7 fix(ngAnimate): ensure that animations work when the app is bootstrapped on the document node
Closes #11574
2015-04-15 13:47:24 -07:00
Chirayu Krishnappa 1a0bcb1f85 docs(i18n): expand the MessageFormat syntax documentation
Closes #11576
2015-04-15 13:12:31 -07:00
Chirayu Krishnappa 0d64f08005 chore(ngMessageFormat): rename angular-messageFormat to angular-message-format
Closes #11595
Closes #11597
2015-04-15 13:06:33 -07:00
Georgios Kalpakas dd8b157299 docs($http): minor fixes regarding params serializers
Closes #11601
2015-04-15 18:47:36 +02:00
Chirayu Krishnappa 8a45064f2b fix(ngMessageFormat): minified symbol and nested required expression
Add an E2E test that works against the minified module to test that the
minified build works correctly.

Fix a bug where mustHaveExpression was passed through to submessages
unchanged. Use of the messageFormat syntax automatically means that you
are using an expression.  Therefore, submessages should not be required
to also have messages.

Closes #11414
Closes #11592
2015-04-14 22:23:03 +01:00
Peter Bacon Darwin 40319a4ce2 docs(input[week]): add id to input element to fix e2e test 2015-04-14 22:08:57 +01:00
Peter Bacon Darwin bee6cbf45a docs(ngController): fix e2e test
The changes made in 2a156c2d7e caused this test
to fail. The test was trying to find an anchor with specified text but the
anchor had changed to a button.
2015-04-14 22:06:58 +01:00
Marcy Sutton 2a156c2d7e docs(): better accessibility in docs examples
Closes #11079
2015-04-11 14:39:10 -07:00
cexbrayat fe9cd9db96 docs(ngMessages): missing quote in sample
Closes #11527
2015-04-11 17:06:42 +02:00
Matias Niemelä 8bf5654ee0 docs(ngAnimate): update broken callback ngView example 2015-04-10 14:17:00 -07:00
Matias Niemelä a689ce63be docs($animateCss): remove out-dated return type details 2015-04-10 14:10:24 -07:00
Matias Niemelä fa0bbded1e fix(ngAnimate): ensure SVG classes are properly removed 2015-04-10 13:32:27 -07:00
Matias Niemelä b6afe1b208 docs(CHANGELOG): add changes for 1.4.0-rc.0 2015-04-10 10:44:35 -07:00
Matias Niemelä c8700f04fb feat($animate): complete refactor of internal animation code
All of ngAnimate has been rewritten to make the internals of the
animation code more flexible, reuseable and performant.

BREAKING CHANGE: JavaSript and CSS animations can no longer be run in
parallel. With earlier versions of ngAnimate, both CSS and JS animations
would be run together when multiple animations were detected. This
feature has now been removed, however, the same effect, with even more
possibilities, can be achieved by injecting `$animateCss` into a
JavaScript-defined animation and creating custom CSS-based animations
from there. Read the ngAnimate docs for more info.

BREAKING CHANGE: The function params for `$animate.enabled()` when an
element is used are now flipped. This fix allows the function to act as
a getter when a single element param is provided.

```js
// < 1.4
$animate.enabled(false, element);

// 1.4+
$animate.enabled(element, false);
```

BREAKING CHANGE: In addition to disabling the children of the element,
`$animate.enabled(element, false)` will now also disable animations on
the element itself.

BREAKING CHANGE: Animation-related callbacks are now fired on
`$animate.on` instead of directly being on the element.

```js
// < 1.4
element.on('$animate:before', function(e, data) {
  if (data.event === 'enter') { ... }
});
element.off('$animate:before', fn);

// 1.4+
$animate.on(element, 'enter', function(data) {
  //...
});
$animate.off(element, 'enter', fn);
```

BREAKING CHANGE: There is no need to call `$scope.$apply` or
`$scope.$digest` inside of a animation promise callback anymore
since the promise is resolved within a digest automatically (but a
digest is not run unless the promise is chained).

```js
// < 1.4
$animate.enter(element).then(function() {
  $scope.$apply(function() {
    $scope.explode = true;
  });
});

// 1.4+
$animate.enter(element).then(function() {
  $scope.explode = true;
});
```

BREAKING CHANGE: When an enter, leave or move animation is triggered then it
will always end any pending or active parent class based animations
(animations triggered via ngClass) in order to ensure that any CSS
styles are resolved in time.
2015-04-09 14:44:54 -07:00
Pawel Kozlowski 73ab107a1e docs($http): clarify side effects of transformRequest functions
Closes #11438

Closes #11503
2015-04-06 12:25:35 +02:00
tomoyuki kashiro 9dfa949dad chore(version-info): modify versioning for < v1.0.2
Angular v1.0.1 and earlier did not have valid versions and had a different
docs url format, so you can not access their api docs from the version
drop-down.

Closes #11132
2015-04-03 07:28:33 +01:00
Shahar Talmi a057e0896a fix(cookieReader): safely access $document so it can be mocked
Closes #11373
Closes #11388
2015-04-03 07:14:38 +01:00
Martin Staffa 948120ecdb fix(ngModel): allow setting model to NaN when asyncValidator is present
Closes #11315
Closes #11411
2015-04-03 07:11:27 +01:00
Peter Bacon Darwin 7757f0a9e3 chore(dependencies): general update (including new dgeni-packages)
Closes #11095
2015-04-03 06:00:39 +01:00
Peter Bacon Darwin 560566f396 docs(toJson): improve option param documentation
With an upgrade to dgeni-packages 0.10.13, this style of optional param
is rendered more correctly.

See #11095
2015-04-03 06:00:17 +01:00
Peter Bacon Darwin d8d30ce676 style($browserSpec): fix typo 2015-04-02 21:47:10 +01:00
David Li d996305b44 perf($rootScope): remove history event handler when app is torn down
Remember the popstate and hashchange handler registered with window
when the application bootstraps, and remove it when the application
is torn down

Closes #9897
Closes #9905
2015-04-02 21:47:10 +01:00
Georgios Kalpakas 79fa7ddf8d test(browerTrigger): ensure touch events initialize correctly on touch enabled Chrome
On certain browsers (e.g. on desktop Chrome with touch-events enabled),
using the `initTouchEvent()` method (introduced in 06a9f0a) did not
correctly initialize the event, nor did the event get dispatched on
the target element.

Using the `Event` constructor and manually attaching a `TouchList`,
works around the issue (although not a proper fix).

Fixes #11471
Closes #11493
2015-04-02 21:09:57 +01:00
mustela 3621dbc100 fix($resource) add @ support for properties names
Add support for properties that starts with @. This is useful when working with BadgerFish convention.

Closes #10533
Closes #11473
2015-04-02 20:49:08 +03:00
Pawel Kozlowski 65bed615df docs($http): fix $httpParamSerializerJQLike description 2015-04-02 19:46:10 +02:00
Pawel Kozlowski 6c8464ad14 feat($http): support custom params serializers
Closes #3740
Closes #7429
Closes #9224
Closes #11461
2015-04-02 19:02:56 +02:00
Georgios Kalpakas 731c8b5e2d feat($anchorScroll): allow scrolling to a specified element
Add an optional argument to `$anchorScroll()` to enable scrolling to an
anchor element different than that related to the current value of
`$location.hash()`. If the argument is omitted or is not a string,
the value of `$location.hash()` will be used instead.

Closes #4568
Closes #9596
2015-04-02 19:52:54 +03:00
Michał Gołębiowski 06a9f0a95f fix(ngTouch): register touches properly when jQuery is used
If jQuery was used with Angular the touch logic was looking for touches
under the original event object. However, jQuery wraps all events, keeping
the original one under the originalEvent property and copies/normalizes some
of event properties. Not all properties are copied, e.g. touches which caused
them to not be recognized properly.

Thanks to @mcmar & @pomerantsev for original patch ideas.

Fixes #4001
Closes #8584
Closes #10797
Closes #11488
2015-04-02 14:05:26 +01:00
Michał Gołębiowski 2cdb2016b9 feat(travis): run unit tests on iOS 8
Refs #11471
Closes #11479
2015-04-02 13:26:45 +01:00
Lucas Galfaso 10ae33b2d8 fix($parse): fix parse errors on older Android WebViews which choke with reserved keywords
Closes #11455
2015-04-01 14:02:57 +02:00
Matias Niemelä c55a494433 fix(ngAnimate): ensure that minified repaint code isn't removed
Closes #9936
2015-03-31 14:04:45 -07:00
Georgios Kalpakas ffbeb32172 refactor(filterFilter): introduce helper function for "DRYness" 2015-03-31 19:54:36 +03:00
Georgios Kalpakas b5002ab62a fix(filterFilter): fix matching against null/undefined
Included fixes:

* Do not convert `null`/`undefined` to strings for substring matching in
  non-strict comparison mode. Prevents `null`/`undefined` from being
  matched against e.g. 'u'.
* Let `null` (as a top-level filter expression) match "deeply" (as do
  booleans, numbers and strings).
  E.g. let `filterFilter(arr, null)` match an item like `{someProp: null}`.

Closes #11432
Closes #11445
2015-03-31 19:54:07 +03:00
Georgios Kalpakas 393f50324c style(filterFilter): fix indentation and remove newline for consistency 2015-03-31 19:47:09 +03:00
Peter Bacon Darwin 0a9c4681c2 style(ngStyle): remove unused $log param 2015-03-31 16:33:47 +01:00
Peter Bacon Darwin 50bd7059e1 test(ngStyle): should cope with both '' and '0px' for initial height 2015-03-31 16:30:41 +01:00
Martin Staffa 36fd167e1d Revert "perf(ngStyleDirective): use $watchCollection"
This reverts commit 4c8d8ad508, because
it broke lazy one-time binding for object literals
(introduced in c024f28217)

Fixes #11403
2015-03-31 09:44:39 +02:00
Martin Staffa da75d138b1 test(ngStyle): ensure lazy one-time binding is supported
Closes #11405
2015-03-31 09:44:26 +02:00
Brent Dearth 171b9f7f23 perf(ngOptions): only perform deep equality check on ngModel if using track by
Closes #11448
Closes #11447
2015-03-30 22:58:29 +01:00
Georgios Kalpakas 73f3515ba7 refactor($compile): remove unused return statement
As discussed in
https://github.com/angular/angular.js/commit/89447b3f2b4c6db62c24473a81fedc3b04242b85#commitcomment-10280666.
2015-03-28 14:41:59 +00:00
Martin Staffa 7e5c447fa9 fix(select): don't call $render twice if $viewValue ref changes
Credits to @tepez for the fix

Closes #11329
Closes #11412
2015-03-25 18:39:55 +00:00
Peter Bacon Darwin 4ba43d2e6f style($$messageFormat) does not need to have a provider 2015-03-25 17:26:45 +00:00
Peter Bacon Darwin f353db9d86 docs(ngMessageFormat): module name is actually ngMessageFormat 2015-03-25 17:22:04 +00:00
Fred Sauer b2b33608a3 docs($route): add param info for $routeUpdate event
Closes #11419
2015-03-25 14:41:40 +00:00
Peter Bacon Darwin 448e789142 docs(misc/FAQ): fix typo 2015-03-25 14:02:49 +00:00
Jason Bedard b8dbdb0c5e perf(benchmark): add ngmodel benchmarks to largetable-bp
Closes #11082
2015-03-23 21:26:10 +00:00
Peter Bacon Darwin 67af519764 docs(FAQ): add info about Anglar 1's versioning strategy
See https://github.com/angular/angular.js/issues/10122#issuecomment-84139724
2015-03-23 12:09:39 +00:00
Peter Bacon Darwin 4f12ed0e4e docs(filters): clarify filter name restrictions
See #10122
2015-03-23 11:58:01 +00:00
Martin Staffa afd0807520 docs($compile): clarify link fn's controller argument
Also add "bindToController" to exampe directive definition object.

Closes #10815
2015-03-22 13:58:24 +01:00
Bradley Price 6a6f403f24 docs($http): remove trailing comma
Remove trailing comma to keep the same flow with all other code examples on page.
2015-03-22 13:05:07 +01:00
wiseleo 7811eadac7 docs(orderBy): replace operator = with ===
Fix documentation error on line 20 incorrectly mentioning
an assignment operator in a comparison operation.
Code on line 235 uses strict comparison operator.

Closes #11392
Closes #11393
2015-03-22 13:03:43 +01:00
Yuvraj Patil e5d1d6587d docs(guide/Unit Testing): update Jasmine's description
Jasmine is a "behavior-driven development framework",
not a "test-driven development framework"

Closes #11383
2015-03-21 14:36:50 +01:00
Martin Staffa 8c52f1daf4 docs(guide/scope): fix grammar
Closes #9829
2015-03-21 14:36:49 +01:00
Martin Staffa ee6a3ccd24 docs(guide/direcive): don't use shorthand in ddo
All the other examples use the full syntax.
Closes #11180
2015-03-21 14:36:47 +01:00
RaphStein e0e40e8c0a docs(ngAria): change aria-live attribute value from polite to assertive
For ngMessages directive ngAria generates aria-live with value assertive and not polite.

Closes #11280
2015-03-21 14:36:46 +01:00
Vojta Jina f8c8cf698a fix($rootScope): allow destroying a root scope
When running (i.e. bootstrapping and killing) multiple apps on the same page,
it makes sense to destroy the root scope.

Closes #11241
Closes #10895
2015-03-20 11:41:21 +00:00
Wesley Cho 9f7a80c53d docs($httpBackend): change to more friendly language
- Change s**t to more neutral word

Closes #11380
Closes #11364
2015-03-20 10:55:49 +00:00
Julie Ralph bea99e34a4 chore(ci): fix location of print logs from wait_for_browser_provider 2015-03-19 14:40:38 -07:00
Julie Ralph c7ebce6fb8 chore(test): bump Protractor version to 2.0.0 2015-03-19 13:27:05 -07:00
Peter Bacon Darwin 41428477ed docs(input[number]): clarify that model must be of type number
The docs also now link through to the error doc, which contains a runnable
example of how to work around this restriction.

Closes #11157
Closes #11334
2015-03-19 14:27:59 +00:00
Peter Bacon Darwin cc4213f03e chore(docs): improve error doc layout and linking
You can now link to an error by its name, namespace:name or error:namespace:name.
For example these would all link to https://docs.angularjs.org/error/$compile/ctreq

```
{@link ctreq}
{@link $compile:ctreq}
{@link error:$compile:ctreq}
```
2015-03-19 14:27:59 +00:00
Peter Bacon Darwin 7c9ad277ad docs(error/ngModel/numfmt): provide documentation for this error
See: https://github.com/angular/angular.js/commit/db044c408a7f8082758b96ab739348810c36e15a#commitcomment-7577199

Closes #11157
Closes #11334
2015-03-19 14:27:59 +00:00
Bob Fanger 4588e627bb feat(ngClass): add support for conditional map within an array.
This change allows `ngClass` expressions to have both objects and strings
within an array:

```js
$scope.classVar = 'nav-item';
$scope.activeVar = true;
```

```html
<div ng-class=" [classVar, {'is-active': activeVar }] ">
```

In this case, the CSS classes that will be added are: 'nav-item' and 'is-active'.

Closes #4807
2015-03-18 11:17:44 +00:00
Julie Ralph ea9fd82ce1 chore(ci): force travis to print logs after driver provider timeout
Travis does not do the after_script step if before_script fails,
so wait_for_browser_provider.sh was not printing out logs.
Force it to print them manually.
2015-03-17 16:57:55 -07:00
Martin Staffa 44337f63fa fix(ngAria): handle elements with role="checkbox/menuitemcheckbox"
Fixes #11317
Closes #11321
2015-03-17 20:53:55 +00:00
Julie Ralph 4b7a46adad chore(ci): make wait_for_browser_provider time out after 2 minutes
Before, if something went wrong, wait_for_browser_provider.sh would
wait indefinitely, and logs would never get printed. Now, we'll bail
early, and get some actual logs on what the problem was.

Closes #11350
2015-03-17 20:40:03 +00:00
Peter Bacon Darwin 1af563d43e fix($http): throw error if success and error methods do not receive a function
Closes #11330
Closes #11333
2015-03-17 19:13:37 +00:00
Chirayu Krishnappa 1e58488ad6 feat($interpolate): extend interpolation with MessageFormat like syntax
For more detailed information refer to this document:
https://docs.google.com/a/google.com/document/d/1pbtW2yvtmFBikfRrJd8VAsabiFkKezmYZ_PbgdjQOVU/edit

**Example:**

```html

{{recipients.length, plural, offset:1
    =0 {You gave no gifts}
    =1 { {{ recipients[0].gender, select,
              male {You gave him a gift.}
              female {You gave her a gift.}
              other {You gave them a gift.}
          }}
       }
    one { {{ recipients[0].gender, select,
              male {You gave him and one other person a gift.}
              female {You gave her and one other person a gift.}
              other {You gave them and one other person a gift.}
          }}
       }
    other {You gave {{recipients[0].gender}} and # other people gifts. }
}}
```

This is a SEPARATE module so you MUST include `angular-messageformat.js`
or `angular-messageformat.min.js`.

In addition, your application module should depend on the "ngMessageFormat"
(e.g. angular.module('myApp', ['ngMessageFormat']);)

When you use the `ngMessageFormat`, the $interpolate gets overridden with
a new service that adds the new MessageFormat behavior.

**Syntax differences from MessageFormat:**

- MessageFormat directives are always inside `{{ }}` instead of
  single `{ }`.  This ensures a consistent interpolation syntax (else you
  could interpolate in more than one way and have to pick one based on
  the features availability for that syntax.)
- The first part of such a syntax can be an arbitrary Angular
  expression instead of a single identifier.
- You can nest them as deep as you want.  As mentioned earlier, you
  would use `{{ }}` to start the nested interpolation that may optionally
  include select/plural extensions.
- Only `select` and `plural` keywords are currently recognized.
- Quoting support is coming in a future commit.
- Positional arguments/placeholders are not supported. They don't make
  sense in Angular templates anyway (they are only helpful when using
  API calls from a programming language.)
- Redefining of the startSymbol (`{{`) and endSymbol (`}}`) used for
  interpolation is not yet supported.

Closes #11152
2015-03-17 16:17:56 +00:00
Wesley Cho 170ff9a37d fix($compile): throw error on invalid directive name
Directive names must start with a lower case letter.
Previously the compiler would quietly fail.
This change adds an assertion that fails if this is not the case.

Closes #11281
Closes #11109
2015-03-17 13:41:15 +00:00
rodneyebanks e57138d7ef feat(angular.Module): add decorator method
Closes #11305
Closes #11300
2015-03-17 12:59:29 +00:00
jasperSpeicher 9093efe062 docs(ngRepeat): improve the explanation of keys
Closes #11310
2015-03-17 12:54:02 +00:00
Caitlin Potter 8028315640 test($compile): make test cases more specific for #11326 2015-03-17 08:18:10 -04:00
James Talmage 9900610eea fix($compile): update data() when controller returns custom value
When controller functions return an explicit value that value should
be what is passed to the linking functions, and to any child/sibling
controllers that `require` it. It should also be bound to the data
store on the dom element.

Closes #11147
Closes #11326
2015-03-17 08:18:10 -04:00
Peter Bacon Darwin db866f1f86 docs(CHANGELOG): add changes for 1.4.0-beta.6 and 1.3.15 2015-03-17 12:06:22 +00:00
svershin d8492f4331 docs(misc/Downloading): update o latest stable version
Updated the CDN link and description to 1.3.14

Closes #11327
2015-03-15 21:00:39 +00:00
rodyhaddad 67688d5ca0 fix($sanitize): disallow unsafe svg animation tags
After #11124 got merged, a security vulnerability got introduced.
Animation in SVG became tolerated by the sanitizer.

Exploit Example:
```
<svg>
  <a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="?">
    <circle r="400"></circle>
    <animate attributeName="xlink:href" begin="0" from="javascript:alert(1)" to="&" />
  </a>
</svg>
```

Here we are animating an anchor's href, starting from a value that's a javascript URI,
allowing the executing of arbitrary javascript in the process.

Preventing only the animation of links is tricky, as SVG is weird and namespaces aren't predictable.
We've decided to have the sanitizer filter out svg animation tags instead.

Considering the sanitizer is commonly used to sanitize untrusted HTML code, this shouldn't affect
many apps in the wild. Also, no release has been with #11124 in it, but not this fix.

Closes #11290
2015-03-15 20:39:45 +00:00
rodyhaddad 9e8a687c37 chore(security): add warning banner to top of security sensitive files 2015-03-15 20:38:28 +00:00
Diego 3613a6007c refactor(ngPluralize):delete default directive restriction
delete the directive restriction to avoid code duplication since the default is already applied

Closes #11301
2015-03-13 21:10:57 +01:00
eeue56 2979bf38dd docs(guide/Services): Fix link to module.Factory 2015-03-13 19:54:22 +01:00
Amy 4c613a2603 docs(guide/Controllers): grammar and header fixes
fixed a comma and made the headers more logical.
2015-03-13 18:35:34 +01:00
Amy e6688ec280 docs(guide/Forms): format headers to match other docs
Primary header with page title, secondary headers for each description section.
2015-03-13 18:35:25 +01:00
Amy 4fdac4d22f docs(guide/Data Binding): add heading to page
the other pages have one, this makes them look more unified.
2015-03-13 18:35:11 +01:00
Matias Niemelä 2f4be3e2b9 chore(apis): add HashMap to the DI
HashMap will be used inside of angular-animate.js to store details of
ongoing animations on a per-element basis. Right now HashMap is only
available in core, but this patch will make it available to other areas.

Closes #11311
2015-03-13 12:40:15 -04:00
Julie Ralph 3086fcd644 chore(ci): bump sc version to 4.3.7 2015-03-13 09:35:17 -07:00
Peter Bacon Darwin 6a03ca2743 fix(ngOptions): fix model<->option interaction when using track by
This problem is beset by the problem of `ngModel` expecting models  to be
atomic things (primitives/objects).

> When it was first invented it was expected that ngModel would only be
a primitive, e.g. a string or a number. Later when things like ngList and
ngOptions were added or became more complex then various hacks were put
in place to make it look like it worked well with those but it doesn't.

-------------

Just to be clear what is happening, lets name the objects:

```js
var option1 = { uid: 1, name: 'someName1' };
var option2 = { uid: 2, name: 'someName2' };
var option3 = { uid: 3, name: 'someName3' };

var initialItem = { uid: 1, name: 'someName1' };

model {
  options: [option1, option2, option3],
  selected: initialItem
};
```

Now when we begin we have:

```js
expect(model.selected).toBe(initialItem);
expect(model.selected.uid).toEqual(option1.uid);
expect(model.selected).not.toBe(option1);
```

So although `ngOptions` has found a match between an option and the
modelValue, these are not the same object.

Now if we change the properties of the `model.selected` object, we are
effectively changing the `initialItem` object.

```js
model.selected.uid = 3;
model.selected.name = 'someName3';

expect(model.selected).toBe(initialItem);
expect(model.selected.uid).toEqual(option3.uid);
expect(model.selected).not.toBe(option3);
```

At the moment `ngModel` only watches for changes to the object identity
and so it doesn't trigger an update to the `ngOptions` directive.

This commit fixes this in `ngOptions` by adding a **deep** watch on the
`attr.ngModel` expression...

```js
scope.$watch(attr.ngModel, updateOptions, true);
```

You can see that in this Plunker:
http://plnkr.co/edit/0PE7qN5FXIA23y4RwyN0?p=preview

-------

But this isn't the end of the story. Since `ngModel` and `ngOptions` did
not make copies between the model and the view, we can't go around just
changing the properties of the `model.selected` object. This is particularly
important in the situation where the user has actually chosen an option,
since the `model.selected` points directly to one of the option objects:

```js
// User selects "someName2" option
expect(model.selected).toBe(option2);
expect(model.selected.uid).toEqual(option2.uid);
expect(model.selected).not.toBe(initialOption);
```

If we now change the `model.selected` object's properties we are actually
changing the `option2` object:

```js
expect(model.selected).toBe(option2);

model.selected.uid = 3;
model.selected.name = 'someName3';

expect(model.selected).toBe(option2);
expect(model.selected).not.toBe(option3);

expect(option2.uid).toEqual(3);
expect(option2.name).toEqual('someName3');
```

which means that the options are now broken:

```js
expect(model.options).toEqual([
  { uid: 1, name: 'someName1' },
  { uid: 3, name: 'someName3' },
  { uid: 3, name: 'someName3' }
]);
```

This commit fixes this in `ngOptions` by making copies when reading the
value if `track by` is being used. If we are not using `track by` then
we really do care about the identity of the object and should not be
copying...

You can see this in the Plunker here:
http://plnkr.co/edit/YEzEf4dxHTnoW5pbeJDp?p=preview

Closes #10869
Closes #10893
2015-03-13 11:55:01 +00:00
Peter Bacon Darwin 210c184184 style(ngOptionsSpec): ensure two newlines between specs 2015-03-13 11:43:49 +00:00
Izhaki 1846572d6f Added some extra sub-headings for clarity
Added `Normalization` and `Directive types`` subheadings to the `Matching directive` heading
2015-03-12 22:16:06 +01:00
Ciro Nunes 1c3bbada27 docs($templateCache): highlight the $templateCache service
Closes #11294
2015-03-12 22:14:43 +01:00
Devyn Stott 891b364c1b docs($log): Add debug button to example
Add debug button to example. It was in teh docs but not the example.

No breaking changes.
2015-03-12 21:45:09 +01:00
Marcin Wosinek 67297de109 docs(ngMessage): move up ngMessages link 2015-03-12 21:45:08 +01:00
Amy 68146cc092 docs(guide/Conceptual Overview): add a hyphen for clarity
Minor change, but the heading for "View independent business logic..."
would be more clear if it had a hyphen, "View-independent".
Perhaps it's because I'm new to javascript and its terminology,
but I read "View" as a verb rather than a noun on the first pass and
had to read on a bit to understand that it was, instead,
referring to The View. If you go just by grammar rules,
making "view independent" into the compound adjective,
"view-independent", makes it clear that it is modifying "business logic".
(http://www.grammarbook.com/punctuation/hyphens.asp - see Rule 1).
2015-03-12 21:44:59 +01:00
Peter Bacon Darwin c01b1f47c0 test(ngMock): test shallow copy of mock controller bindings
See #11239
2015-03-12 19:58:38 +00:00
Julie Ralph 1fc87e2b6a chore(ci): turn off verbose logging for sauce connect
We have not used the verbose data from these logs for months,
and it makes the Travis UI very slow.
2015-03-11 10:53:45 -07:00
Rouven Weßling 9b2a4c6851 test(IE8): remove workarounds for IE8 2015-03-11 16:53:29 +01:00
Peter Bacon Darwin 2b4dfa9e2b fix(date filter): display localised era for G format codes
This implementation is limited to displaying only AD (CE) years correctly,
since we do not support the `u` style year format that can be used to represent
dates before 1 AD.

Closes #10503
Closes #11266
2015-03-11 12:05:05 +00:00
Peter Bacon Darwin 68dbbfbf32 chore(ngLocale): regenerate locale files to include ERA info 2015-03-11 12:01:34 +00:00
Peter Bacon Darwin 4acb0af24c fix(ng/$locale): add ERA info in generic locale
This change also updates the closure i18n converter to pull in the ERA
info for generated locale files.
2015-03-11 12:01:33 +00:00
robiferentz bb5bf7f816 fix(jqLite): attr should ignore comment, text and attribute nodes
Follow jQuery handling of the `attr` function

Close #11038
2015-03-10 18:43:39 +01:00
Dave Jeffery 1924cf2216 docs(angular.extend): remove reference to non-existent parameter
The `deep` property is hard-coded to `false` and is not configurable
as the docs suggest.

Closes #11284
2015-03-10 13:26:41 +01:00
Rouven Weßling fb7db4a07b fix(rootScope): prevent memory leak when destroying scopes
Closes #11173
Closes #11169
2015-03-09 14:47:49 +00:00
gdi2290 4f1f9cfdb7 feat($interval): pass additional arguments to the callback
Similar to how [`setInterval`](http://mdn.io/setInterval#Syntax) works, this
commit allows users of `$interval` to add additional parameters to the call,
which will now be passed on to the callback function.

Closes #10632
2015-03-09 14:12:04 +00:00
gdi2290 3a4b6b83ef feat($timeout): pass additional arguments to the callback
Similar to how [`setTimeout`](mdn.io/setTimeout#Syntax) works, this commit
allows users of `$timeout` to add additional parameters to the call, which
will now be passed on to the callback function.

Closes #10631
2015-03-09 13:45:49 +00:00
bborowin 41fdb3d536 docs($compile): clarify when require will throw
To make things less confusing, explicitly state that require
WILL NOT throw a compile error if a link function is not specified.

Closes #11206
stackoverflow.com/questions/28730346/require-ddo-option-of-angular-directive-does-not-throw-an-error-when-it-should
2015-03-08 20:35:33 +01:00
Edward Delaporte 770a4ddcc6 docs(orderBy): Start with a simpler example.
Per the question raised at this Stack Overflow question:
http://stackoverflow.com/questions/24048590/angularjs-ng-repeat-orderby-date-not-working

The first example on this page is too complex to convey
the simplest possible case for using this function.

Closes #11144
2015-03-08 18:47:36 +01:00
Elliot Bentley f6b51fc0a2 docs(ngDisabled): Clarify "incorrect" example
Add obvious label to example of incorrect usage.
To a user scanning the docs (ie. me) it's easy to miss the fact
that this top example doesn't actually work.

Closes #11192
2015-03-08 18:14:17 +01:00
jmarkevicius f227f7a5af docs(guide/Animations): change *then* to *than* 2015-03-08 13:56:04 +01:00
Anthony Zotti 212975af96 docs(form): Add comma to line 319 for readability
Line 319 is hard to read on the first glimpse.

Currently the sentence reads:
"In Angular forms can be nested"

The sentence should read either
"In Angular, forms can be nested"
or
"Forms can be nested in angular"

I changed it to the former in this pull request.

Closes #11271
2015-03-08 13:56:03 +01:00
b0ri5 abf87673e5 docs(tutorial/0 - Bootstrapping): Add a "the" before "imperative / manual way"
I'm assuming "imperative / manual" is modifying "way" in which case I think "the" is needed.

I don't really know grammar, but as a native speaker it sounds odd without "the".

Closes #11269
2015-03-08 13:56:02 +01:00
Martin Staffa 248b036888 docs(tutorial/0 - Bootstrapping): clarify where the callback is registered
Closes #11270
2015-03-08 13:55:56 +01:00
Martin Staffa 3fd48742b0 test(ngJq): add e2e tests
Closes #11182
2015-03-06 13:51:40 +00:00
Martin Staffa 17f02d5bb2 chore(tests): don't rewrite urls for external scripts 2015-03-06 13:51:40 +00:00
Michel Boudreau 342e5f3ce3 fix(ngJq): don't rely on jqlite
Closes #11044
2015-03-06 13:51:39 +00:00
Peter Bacon Darwin 44e9d2ca6c docs(isNumber): fix link to isFinite 2015-03-06 11:54:55 +00:00
Peter Bacon Darwin 7705edc0da docs(isNumber): add info about using isFinite to exclude NaN
Closes #11230
2015-03-06 11:26:20 +00:00
Caitlin Potter d02d0585a0 feat(ngMock): allow mock $controller service to set up controller bindings
Adds a new mock for the $controller service, in order to simplify testing using the
bindToController feature.

```js
var dictionaryOfControllerBindings = {
  data: [
    { id: 0, phone: '...', name: '...' },
    { id: 1, phone: '...', name: '...' },
  ]
};

// When the MyCtrl constructor is called, `this.data ~= dictionaryOfControllerBindings.data`
$controller(MyCtrl, myLocals, dictionaryOfControllerBindings);
```

Closes #9425
Closes #11239
2015-03-06 10:54:14 +00:00
Peter Bacon Darwin 2d0eda10e4 docs(ngMessageExp): split ngMessage docs up to show its alias more clearly 2015-03-04 21:25:01 +00:00
gdi2290 4374f892c6 fix($animate): applyStyles from options on leave
Closes #10068
2015-03-04 14:26:10 +00:00
Peter Bacon Darwin caa0b9dab3 chore(privateMocks): use global angular to access helpers in they
When using `they` in modules such as `ngMessages` we do not have access to
the internal helper functions.
2015-03-04 13:14:03 +00:00
Matias Niemelä 0c541cfb2a chore(privateMocks): replace multiple occurrences of $prop for they() 2015-03-04 07:24:04 -05:00
Peter Bacon Darwin 2404b77e48 chore(gruntFile): add tthey and xthey to ddescribe-iit check 2015-03-04 12:20:49 +00:00
Peter Bacon Darwin 8783453784 style(privateMocks): remove unnecessary comment 2015-03-04 12:07:51 +00:00
Matias Niemelä e650c45894 feat(ngMock): add they helpers for testing multiple specs
There are now three new test helpers: `they`, `tthey` and `xthey`, which
will create multiple `it`, `iit` and `xit` blocks, respectively, parameterized
by each item in a collection that is passed.

(with tests and ammendments by @petebacondarwin)

Closes #10864
2015-03-04 12:05:18 +00:00
Steve Mao 82000111dc docs(CONTRIBUTING): add whitespaces for consistent styling
Closes #11214
2015-03-03 17:51:12 -07:00
Shahar Talmi ddc612056e refactor(filters/ngModel): extract common methods
Closes #11005
2015-03-03 14:57:03 +00:00
Shahar Talmi 0413bee8cc feat(ngModel): support conversion to timezone other than UTC
Closes #11005
2015-03-03 14:44:48 +00:00
Caitlin Potter c0498d45fe feat(angular.merge): provide an alternative to angular.extend that merges 'deeply'
Closes #10507
Closes #10519
2015-03-03 14:39:11 +00:00
Peter Bacon Darwin f591776313 test(filterFilter): improve tests related to custom toString 2015-03-03 14:13:13 +00:00
Martin R. Hufsky f8c4216170 feat(filterFilter): compare object with custom toString() to primitive
Closes #10464
Closes #10548
2015-03-03 14:09:23 +00:00
Peter Bacon Darwin 4501da327d docs(*): The Bootstrap CSS class alert-error is now alert-danger 2015-03-02 22:34:31 +00:00
Shahar Talmi 9b35dfb658 refactor($browser): remove private polling mechanism
The only feature of Angular using this mechanism was `$cookies`,
which no longer mirrors the browser cookie values and so does not
need to poll.

Closes #11222
2015-03-02 22:21:11 +00:00
Shahar Talmi 53c6636991 feat($cookiesProvider): provide path, domain, expires and secure options
This change provides properties on `$cookiesProvider` so that you can set the application
level default options for cookies that are set using the `$cookies` service
2015-03-02 22:20:00 +00:00
Shahar Talmi 92c366d205 feat($cookies): allow passing cookie options
The `put`, `putObject` and `remove` methods now take an options parameter
where you can provide additional options for the cookie value, such as `expires`,
`path`, `domain` and `secure`.

Closes #8324
Closes #3988
Closes #1786
Closes #950
2015-03-02 22:20:00 +00:00
Shahar Talmi 38fbe3ee83 feat($cookies): move logic into $cookies and deprecate $cookieStore
The new API on `$cookies` includes:

 * `get`
 * `put`
 * `getObject`
 * `putObject`
 * `getAll`
 * `remove`

The new API no longer polls the browser for changes to the cookies and no longer copy
cookie values onto the `$cookies` object.

The polling is expensive and caused issues with the `$cookies` properties not
synchronizing correctly with the actual browser cookie values.

The reason the polling was originally added was to allow communication between
different tabs, but there are better ways to do this today (for example `localStorage`).

DEPRECATION NOTICE:

`$cookieStore` is now deprecated as all the useful logic
has been moved to `$cookies`, to which `$cookieStore` now simply
delegates calls.

BREAKING CHANGE:

`$cookies` no longer exposes properties that represent the current browser cookie
values. Now you must explicitly the methods described above to access the cookie
values. This also means that you can no longer watch the `$cookies` properties for
changes to the browser's cookies.

This feature is generally only needed if a 3rd party library was programmatically
changing the cookies at runtime. If you rely on this then you must either write code that
can react to the 3rd party library making the changes to cookies or implement your own polling
mechanism.

Closes #6411
Closes #7631
2015-03-02 22:20:00 +00:00
Shahar Talmi 997fdea1ee refactor(ngCookies): split $cookies/$cookieStore to two files 2015-03-02 22:20:00 +00:00
Shahar Talmi 76b1b2bec2 refactor($browser): split cookie access into $$cookieReader and $$cookieWriter services 2015-03-02 22:19:59 +00:00
Casey Howard c62fa6bd89 fix(filterFilter): Fix filtering using an object expression when the filter value is undefined
Fixes #10419
Closes #10424
2015-03-02 22:16:21 +00:00
Caitlin Potter 3b8163b7b6 fix($browser): don't crash if history.state access causes error in IE
Reportedly, MSIE can throw under certain conditions when fetching this attribute.
We don't have a reliable reproduction for this but it doesn't do any real harm
to wrap access to this variable in a try-catch block.

Fixes #10367
Closes #10369
2015-03-02 20:29:41 +00:00
Brian Ford 2907a0288b docs(TRIAGING.md): improve process around PRs plz! label
Closes #10375
2015-03-02 19:40:54 +00:00
Marcy Sutton bb365070a3 feat(ngAria): add button role to ngClick
Closes #9254
Closes #10318
2015-03-02 13:48:18 +00:00
Peter Bacon Darwin 0f50b01cc7 test(aria): clean up test style and rename helper
Also removes unnecessary calls to `$apply`
2015-03-02 10:41:09 +00:00
Marcy Sutton 29cdaee2b6 feat(ngAria): add roles to custom inputs
This change adds the missing roles: `slider`, `radio`, `checkbox`

Closes #10012
Closes #10318
2015-03-02 10:40:22 +00:00
Jason Bedard 410f7c6826 fix(form): allow dynamic form names which initially evaluate to blank 2015-02-28 18:09:31 +01:00
Josh Kramer 9d071b2fc0 docs(ngModel): fix contenteditable description
contenteditable is supported in many more browsers than Angular itself is.

http://caniuse.com/#feat=contenteditable

Closes #11172
2015-02-28 18:02:37 +01:00
Marcin Wosinek 7cfa79e98e refactor(interpolate): remove redundant $watchGroup param
Closes #11021
2015-02-28 13:11:44 +01:00
Pawel Kozlowski f22e1fc961 fix(Angular): properly compare RegExp with other objects for equality
Fixes #11204

Closes #11205
2015-02-28 10:56:56 +01:00
Peter Bacon Darwin 80f139b860 chore(ngLocale): update locales with FIRSTDAYOFWEEK and WEEKENDRANGE 2015-02-27 21:53:10 +00:00
Santi Albo 3d149c7f20 feat(ngLocale): Add FIRSTDAYOFWEEK and WEEKENDRANGE from google data
Add more properties from Google closure localization data into ngLocale.
2015-02-27 21:48:31 +00:00
Dav 2c4ffd6af4 fix(filterFilter): do not throw an error if property is null when comparing objects
Closes #10991
Closes #10992
Closes #11116
2015-02-27 21:05:17 +00:00
Matias Niemelä d7ec5f392e fix(ngMessages): ensure that multi-level transclusion works with ngMessagesInclude
ngRepeat and any other directives that alter the DOM structure using
transclusion may cause ngMessagesInclude to behave in an unpredictable
manner. This fix ensures that the element containing the ngMessagesInclude
directive will stay in the DOM to avoid these issues.

Closes #11196
2015-02-26 23:52:56 -05:00
Peter Bacon Darwin bfd7b227db chore(code.angularjs.org/publish): push snapshot from jenkins master build
Since the CI server is not available, we are not able to pull the current
build from it to update the snapshot.

This commit changes Jenkins to push the snapshot directly
to the code.angularjs.org repository on every successful master build.
2015-02-25 11:03:53 +00:00
Julie Ralph 581ee9d0b6 chore(ci): update Karma to 0.12.32-beta.0
This will hopefully make the CI more stable because of its updated
version of socket.io.
2015-02-24 13:04:36 -08:00
Peter Bacon Darwin 57aa00e5dc docs(CHANGELOG): add changes for 1.4.0-beta.5 and 1.3.14 2015-02-24 17:51:15 +00:00
Peter Bacon Darwin 958bc1ab77 chore(bower/publish): run local precommit script if available
Closes #11164
2015-02-24 17:22:13 +00:00
Martin Staffa 3bc429ad9f chore(grunt): use path.normalize in grunt shell:npm-install
This makes the command runnable on Windows clients.
2015-02-23 20:49:37 +01:00
Tero Parviainen d8832d5527 docs(ngRepeat): extend description of tracking and duplicates
Add a section to the documentation on how tracking between items and DOM
elements is done, and why duplicates are not allowed in the collection.

Describe how the default tracking behaviour can be substituted with track by.

Tweak the wording in the `track by` section to discuss “tracking expressions”
instead of “tracking functions”.

Closes #8153
2015-02-23 19:58:33 +01:00
Martin Staffa f6d0ac5bc8 docs(ngDisabled): clarify the explanation of attributes & interpolation
Closes #11032
Closes #11133
2015-02-22 20:14:01 +01:00
Igor Minar 0356d72cd9 chore(travis,grunt): extract the npm install and cache busting logic into install-dependencies.sh
So now we are DRY.

Added extra error checking and improved the grunt file init setup so that stdio is visible in console.

Closes #11110
2015-02-21 18:17:53 -08:00
Igor Minar a773f89bc9 chore(grunt): blow away cached node_modules when npm-shrinkwrap.json changes
this replicates the travis setup in grunt from the previous commit

the reason why we duplicate this rather than having just a single place for this code is so that
we can individually time the actions on travis
2015-02-21 18:17:50 -08:00
Igor Minar f497358df1 chore(travis): don't break the build when travis cache is empty
`du` returns error code 2 when any of the directories don't exist which breaks the build.

this scenario is common when the cache was emptied or when travis is building forks that don't have travis cache enabled
2015-02-21 18:17:50 -08:00
Igor Minar 500d352901 chore(travis): blow away cached node_modules when npm-shrinkwrap.json changes
`npm install` blindly accepts the node_modules cache and doesn't verify if it matches requirements in the current npm-shrinkwrap.json.

This means that if we are using travis cache and npm-shrinkwrap.json changes npm will keep on using the old dependencies, in spite of the guarantees that shrinkwrap claims to offer.

https://github.com/angular/angular.js/pull/11110#issuecomment-75302946

With this change, we will blow away the node_modules directory if the shrinkwrap changes compared to the one
used to populate node_modules.
2015-02-21 18:17:50 -08:00
Igor Minar 05ae2815dc chore(karma): use karma 0.12.31 instead of a custom fork
Previously Vojta set us up to use a custom fork of Karma that used socket.io 1.3.4. This change moves us to an official release of Karma but downgrades socket.io back to 0.9.16.

We now need to hurry up and finish the socket.io upgrade in karma which was blocked on shrinkwrap issues in Angular that are resolved with the previous few commits in this PR.
2015-02-21 18:17:50 -08:00
Igor Minar f88178323a chore(clean-shrinkwrap): drop from property from the clean shrinkwrap
it usually contains urls to temp directories which are not interesting, the info
we do want to preserve is in the `resolved` property and we do keep that one.
2015-02-21 18:17:50 -08:00
Igor Minar 76edec7f9b chore(clean-shrinkwrap): preserve git+https:// resolved property
previously we thought that git:// was enough, but we also want git+https:// otherwise we can miss important info
in clean shrinkwrap file
2015-02-21 18:17:50 -08:00
Igor Minar 367c7d90d4 chore(npm): update npm dependencies 2015-02-21 18:17:50 -08:00
Igor Minar 750d06bc25 chore(npm/travis): upgrade to npm 2.5 and require it via package.json
currently karma's dependencies don't install on node 0.12 or io.js so we'll just update npm in hope that that
this will mitigate "cb() never called!" erorrs. See: https://travis-ci.org/angular/angular.js/jobs/51474043#L2181
2015-02-21 18:17:50 -08:00
Igor Minar efb74642a1 chore(npm): don't clean npm-shrinkwrap.json instead generate npm-shrinkwrap.clean.json
Previously we would clean up npm-shrinkwarp.json file in order to achieve serialization
stability, which would then allow us to create human readable diffs that allow code reviews
of npm-shrinkwrap to be meaningful.

This cleanup process does have an impact on the functionality of npm which was only recently
discovered by Vojta, when we tried to update to new Karma version. See: Automattic/engine.io-client#370

According to Julie, the root cause of these issues is npm/npm/#3581.

The workaround implemented in this commit is not to interfere with npm-shrinkwrap.json file, but instead
preserve the cleaned up version of its content in npm-shrinkwrap.clean.json which can then be used to
produce human readable diffs for code reviews of npm dependency updates.
2015-02-21 18:17:50 -08:00
Jason Bedard ec27ce7198 test($interpolate): ensure constant interpolation watchers are removed
Closes #11057
2015-02-21 19:05:16 +01:00
Hugo Magalhães 46b80654ca fix(ngSanitize): Do not ignore white-listed svg camelCased attributes
Closes #10779
Closes #10990
Closes #11124
2015-02-21 18:54:57 +01:00
Shahar Talmi c67f88b26c doc(filter): support timezones other than UTC
Closes #10999
2015-02-21 13:16:10 +01:00
awdyson cbedff0619 docs($sce): fix typo
Closes #11108
2015-02-21 13:12:45 +01:00
Georgios Kalpakas 5cdefba1b4 docs(limitToFilter): mark the begin param as optional
Closes #11094
2015-02-21 13:09:47 +01:00
bhalajin b299e73130 docs(guide/Services): fix unit test example
Closes #11081
2015-02-21 13:07:42 +01:00
Yousef 16f12c86f6 docs(tutorial/12): fix grammar and punctuation
Closes #11036
Closes #11037
2015-02-21 13:04:09 +01:00
Ahmed Aderopo Alejo a9e02de5e2 docs(minerr/unpr): provide more info on $scope injection errors
Closes #11030
2015-02-21 12:55:12 +01:00
Haowei Zhang 0a8e113542 docs($resource): fix typo
'parametrized' -> 'parameterized'

Closes #11026
2015-02-21 12:43:01 +01:00
Chris Anderson 3f09847b73 docs(guide/concepts): remove scare quotes and so-called
So-called is defined as "commonly named" or "falsely or improperly so named".
The scare quotes are definitely unnecessary, as well.
It makes it sound like things aren't actually called that,
or it hints at sarcasm: "He's the so-called 'mayor', but he never does anything!"

http://en.wikipedia.org/wiki/Scare_quotes

Closes #11018
2015-02-21 12:32:53 +01:00
rwuebker 7a52da6c63 docs(guide/controller): improve wording
Closes #11000
2015-02-21 12:27:58 +01:00
Pawel Kozlowski 5da1256fc2 fix($http): properly access request headers with mixed case
Fixes #10881
Closes #10883
2015-02-21 12:00:41 +01:00
Diego 910de49399 refactor(ngSwitch):delete default directive restriction
delete the directive restriction to avoid code duplication
since the default is already applied

Closes #10987
Closes #11119
2015-02-21 11:21:54 +01:00
Kevin Mayo 7fe139af5a docs(guide/Expressions): add punctuation for clarity
Closes #11107
2015-02-20 19:54:48 +01:00
Igor Minar 507ee2d9ba chore(travis): turn on caching for node_modules and bower_components directories
The cache behavior is documented at http://docs.travis-ci.com/user/caching/

This commit also disabled our custom caching via npm-bundler-deps.sh
2015-02-19 02:41:48 -08:00
Peter Bacon Darwin ef894c87ea fix(ngOptions): ngModel is optional 2015-02-18 13:32:00 +00:00
Peter Bacon Darwin 30b48132e0 fix(select): remove unknown option when model is undefined and empty option is available
Closes #11078
Closes #11092
2015-02-18 13:18:30 +00:00
Stephen Barker da9eac8660 feat(ngOptions): add support for disabling an option
This patch adds support for disabling options based on model values. The
"disable when" syntax allows for listening to changes on those model values,
in order to dynamically enable and disable the options.

The changes prevent disabled options from being written to the selectCtrl
from the model. If a disabled selection is present on the model, normal
unknown or empty functionality kicks in.

Closes #638
Closes #11017
2015-02-18 09:54:54 +00:00
Jason Bedard 5b5228675f perf($compile): replace forEach(controller) with plain loops
Closes #11084
2015-02-17 22:32:22 +00:00
Tamer Aydin aaae3cc416 feat(limitTo): extend the filter to take a beginning index argument
Extend the limitTo filter to take an optional argument for beginning index.
It provides a slice-alike functionality to manipulate the input.

Closes #5355
Closes #10899
2015-02-17 21:45:09 +01:00
Artem 49b54b0d77 docs(ngRepeat): clarify 'as' microsyntax usage
Closes #11087
2015-02-17 19:34:22 +01:00
Adam Bradley f627233312 fix(templateRequest): avoid throwing syntax error in Android 2.3
Android 2.3 throws an `Uncaught SyntaxError: Unexpected token finally`
pointing at this line. Change `.finally` to bracket notation.

Fixes #11089
Closes #11051
Closes #11088
2015-02-17 19:20:20 +01:00
Jason Bedard 75725b44f8 refactor($compile): combining elementControllers and controllers 2015-02-16 12:48:08 +01:00
Jason Bedard fa0aa83937 perf($compile): avoid .data when fetching required controllers
Closes: ##11059
2015-02-16 12:44:37 +01:00
Martin Staffa bd6c04a112 docs($resource): fix list level
Closes #11055
2015-02-13 23:51:57 +01:00
Peter Bacon Darwin 056a317008 fix(ngModel): fix issues when parserName is same as validator key
For $validate(), it is necessary to store the parseError state
in the controller. Otherwise, if the parser name equals a validator
key, $validate() will assume a parse error occured if the validator
is invalid.

Also, setting the validity for the parser now happens after setting
validity for the validator key. Otherwise, the parse key is set,
and then immediately afterwards the validator key is unset
(because parse errors remove all other validations).

Fixes #10698
Closes #10850
Closes #11046
2015-02-13 12:34:22 +00:00
Rouven Weßling 27fcca9a27 refactor(ngSanitize): remove workarounds for IE8
Closes #10758
2015-02-13 11:49:34 +00:00
Peter Bacon Darwin 2015ed2341 test(ngSanitize): add tests for decodeEntities 2015-02-13 11:49:34 +00:00
Peter Bacon Darwin 51faaffdbc perf(ngOptions): only watch labels if a display expression is specified
#11052
2015-02-13 11:29:47 +00:00
Julie Ralph 3c6a0e568d chore(ci): make all browserstack tests allowed failures 2015-02-12 13:21:03 -08:00
Julie Ralph cc744412b3 chore(ci): update to use the latest sauce connect (4.3 to 4.3.6) 2015-02-12 13:18:12 -08:00
Matias Niemelä c9a4421fc3 feat(ngMessages): provide support for dynamic message resolution
Prior to this fix it was impossible to apply a binding to a the
ngMessage directive to represent the name of the error. It was also
not possible to use ngRepeat or any other structural directive to
dynamically update the list of messages. This feature patch ensures
that both ngMessages can render expressions and automatically update
when any dynamic message data changes.

BREAKING CHANGE:

The `ngMessagesInclude` attribute is now its own directive and that must
be placed as a **child** element within the element with the ngMessages
directive. (Keep in mind that the former behaviour of the
ngMessageInclude attribute was that all **included** ngMessage template
code was placed at the **bottom** of the element containing the
ngMessages directive; therefore to make this behave in the same way,
place the element containing the ngMessagesInclude directive at the
end of the container containing the ngMessages directive).

```html
<!-- AngularJS 1.3.x -->
<div ng-messages="model.$error" ng-messages-include="remote.html">
  <div ng-message="required">Your message is required</div>
</div>

<!-- AngularJS 1.4.x -->
<div ng-messages="model.$error">
  <div ng-message="required">Your message is required</div>
  <div ng-messages-include="remote.html"></div>
</div>
```

Closes #10036
Closes #9338
2015-02-12 11:04:10 -05:00
Peter Bacon Darwin 732776f5f3 docs(FAQ): update the zipped file size 2015-02-12 11:59:15 +00:00
Tobyee c211e7a5ad fix(input): create max and/or min validator regardless of initial value
Also adds corresponding tests for ngMin / ngMax.

Fixes #10307
Closes #10327
2015-02-10 23:38:56 +01:00
Martin Staffa d6eba21733 fix(ngAria): correctly set "checked" attr for checkboxes and radios
Make sure the checked attribute is set correctly for:
- checkboxes with string and integer models using ngTrueValue /
ngFalseValue
- radios with integer models
- radios with boolean models using ngValue

Fixes #10389
Fixes #10212
2015-02-10 22:30:13 +01:00
Peter Bacon Darwin c1199fb6b0 chore(CHANGELOG): add release name! 2015-02-09 11:16:39 +00:00
Peter Bacon Darwin 06c39a033e chore(CHANGELOG): update to 1.4.0-beta.4 and 1.3.13 2015-02-09 10:39:40 +00:00
Marcy Sutton 9d53e5a38d fix(ngAria): ensure native controls fire a single click
Closes #10388
Closes #10766
2015-02-07 10:26:21 +00:00
Lucas Galfaso 030a42e79d fix(sanitize): handle newline characters inside <script> for IE
Tweak the regex used match characters inside <script> and <style> to a IE
compatible regex.
2015-02-06 07:17:04 +01:00
Shahar Talmi 898714df9e fix(ngMock): handle cases where injector is created before tests
This caused an exception for people who created an injector before the tests actually began to run. Since the array was initialized only in beforeEach, anyone accessing it before that would throw. This is solved easily but initializing the array immediately.

Closes #10967
2015-02-06 03:32:42 +02:00
Lucas Galfaso 966f6d831f fix($parse): Initialize elements in an array from left to right
When constructing an array, never lazy initialize the elements and build
the array strictly from left to right.
When evaluating the expressions in a function call, never do so lazy.
When evaluating expressions inside object literals, never do so lazy.

Closes: #10968
2015-02-05 11:21:01 +01:00
izeye 28114faff4 docs(misc/Downloading): change AngularJS version to the latest
Closes #10964
2015-02-04 07:53:33 -08:00
Lucas Galfaso cc8755cda6 fix(sanitize): handle newline characters inside special tags
Handle newlines characters when they are present inside <script> and <style> tags.

Closes #10943
2015-02-04 15:26:44 +01:00
Lukas Elmer 7b7b56d36d chore(docs): fix nav scrolling for non-mobile screens
Closes #10936
2015-02-04 13:37:18 +00:00
Morris Singer 9278ae67c6 docs(guide/forms): improve wording
Closes #01937
2015-02-04 13:16:53 +00:00
dtritus a509e9aa14 fix($location): prevent page reload if initial url has empty hash at the end
If initial url has empty hash at the end, $location replaces it with url
without hash causing an unwanted page reload.

Closes #10397
Closes #10960
2015-02-04 12:48:55 +00:00
Michel Boudreau 09ee82d84d feat(ng-jq): adds the ability to force jqLite or a specific jQuery version
Adds the ability to specify that jqLite should be used or to use a specific jQuery version
2015-02-04 11:01:14 +01:00
Peter Bacon Darwin c1cf053f37 docs(CHANGELOG): update changelog for 1.4.0-beta.3 and 1.3.12 2015-02-03 20:51:30 +00:00
Lucas Galfaso 2e5a7e52a0 fix($parse): handle null targets at assign
When assigning to a sub property of a property that its value is `null`
then write an empty object to the property that will contain the sub-property
2015-02-03 19:46:22 +01:00
Peter Bacon Darwin 5dfa630555 docs(CHANGELOG): update changelog for 1.4.0-beta.3 and 1.3.12 2015-02-02 20:27:32 +00:00
Peter Bacon Darwin 452d1cd66e chore(compare-master-to-stable): support beta release versions 2015-02-02 19:56:27 +00:00
Shahar Talmi c6d8512a1d feat(filter): support conversion to timezone other than UTC
Closes #10858
2015-02-02 14:57:42 +00:00
Richard Zschech 8a2c80ce7f style(*) add curly braces to multiline if and for statements
Closes #10865
2015-02-02 14:48:55 +00:00
Chris 2f3633d68f docs(guide): update "AngularJS" book link
Added latest 2014 revision "AngularJS: Up and Running" with Amazon link.
"AngularJS" was previous 2013 version.

Closes #10920
2015-02-02 14:03:03 +00:00
Hannah Howard 6c6a4086b7 fix ($compile): keep prototype properties for template URL directives
Previously, if a directive definition object was defined with methods like `compile`
provided on the prototype rather than the instance, the Angular compiler failed
to use these methods when the directive had a `templateURL`. This change ensures
that these prototypical methods are not lost.

This enables developers to define their directives using "classes" such as
in CoffeeScript or ES6.

Closes #10926
2015-02-02 11:49:14 +00:00
Lucas Galfaso 0d424263ea refactor($parse): new and more performant $parse
Change the way parse works from the old mechanism to a multiple stages
parsing and code generation. The new parse is a four stages parsing
* Lexer
* AST building
* AST processing
* Cacheing, one-time binding and `$watch` optimizations

The Lexer phase remains unchanged.

AST building phase follows Mozilla Parse API [1] and generates an AST that
is compatible. The only exception was needed for `filters` as JavaScript
does not support filters, in this case, a filter is transformed into a
`CallExpression` that has an extra property named `filter` with the value
of `true`.

The AST processing phase transforms the AST into a function that can be
executed to evaluate the expression. The logic for expressions remains
unchanged. The AST processing phase works in two different ways depending
if csp is enabled or disabled. If csp is enabled, the processing phase
returns pre-generated function that interpret specific parts of the AST.
When csp is disabled, then the entire expression is compiled into a single
function that is later evaluated using `Function`. In both cases, the
returning function has the properties `constant`, `literal` and `inputs`
as in the previous implementation. These are used in the next phase to
perform different optimizations.

The cacheing, one-time binding and `$watch` optimizations phase remains
mostly unchanged.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API
2015-01-31 11:19:09 +01:00
Peter Bacon Darwin 2003fcf0de chore(version-info): silence the HTTP curl to get the cdn version 2015-01-30 21:55:46 +00:00
Peter Bacon Darwin 3130a82b21 chore(version-info): remove console.logs and fix code style 2015-01-30 21:25:14 +00:00
Caitlin Potter 6a38dbfd3c fix($compile): do not initialize optional '&' binding if attribute not specified
BREAKING CHANGE:

Previously, '&' expressions would always set up a function in the isolate scope. Now, if the binding
is marked as optional and the attribute is not specified, no function will be added to the isolate scope.

Closes #6404
Closes #9216
2015-01-30 21:25:14 +00:00
Henry Zhu 30e5b52344 style(*): add jscs rule disallowKeywordsOnNewLine: "else" 2015-01-30 12:46:55 +00:00
Henry Zhu ebde4681bd style(*): add jscs rule requireSpaceBeforeKeywords
Closes #10772
2015-01-30 12:36:19 +00:00
Henry Zhu ad68a41e88 style(*): add jscs rule requireSpacesInForStatement
Closes #10772
2015-01-30 12:36:19 +00:00
Henry Zhu 1f3ab484a7 style(*): add jscs rule disallowSpacesInCallExpression
Closes #10772
2015-01-30 12:36:18 +00:00
Henry Zhu d9498a173c style(*): add jscs rule disallowKeywordsOnNewLine: "else"
Closes #10772
2015-01-30 12:36:18 +00:00
Peter Bacon Darwin 29ad3b7f36 chore(npm): update grunt-jscs to 1.2.0 (jscs to 1.10.0), fix styles
Closes #10772
2015-01-30 12:36:18 +00:00
Lucas Galfaso c1500ea775 perf($scope): Add a property $$watchersCount to scope
Add a property $$watchersCount to scope that keeps the number of
watchers in the scope plus all the child scopes. Use this property
when traversing scopes looking for watches

Closes: #5799
2015-01-30 12:29:24 +01:00
Peter Bacon Darwin 4bc89bfe6d chore(doc-gen): update to dgeni-packages 0.10.8
Closes https://github.com/angular/dgeni-packages/pull/105
2015-01-30 10:53:34 +00:00
Rohit Kandhal 54097f63d5 docs(tutorial/step-11): update link to Jasmine matchers
Closes #10909
2015-01-29 22:33:26 +00:00
Ian Young 2264413beb docs(ngHide): use proper selector when overriding the CSS
The animation selector gives the default styles greater specificity that
should be matched when overriding.

Closes #10902
Closes #10913
2015-01-29 22:13:35 +00:00
Martin Staffa 8a6cbb3c94 test(validators): minlength and required must use viewValue in $isEmpty 2015-01-29 23:06:24 +01:00
Martin Staffa bfcf9946e1 fix(validators): maxlength should use viewValue for $isEmpty
Closes #10898
2015-01-29 23:06:23 +01:00
Caitlin Potter b462f5dcf2 docs($compile,$route): reword "controller alias" to clarify
Clarify that these aliases are identifier names used to reference the controller.
2015-01-29 16:48:06 -05:00
Caitlin Potter bb1c379b36 docs($compile): create new error for "missing controller identifier" 2015-01-29 16:48:06 -05:00
Caitlin Potter 62d514b069 fix($compile): respect return value from controller constructor
The return value of the controller constructor is now respected in all cases.

If controllerAs is used, the controller will be re-bound to scope. If bindToController is used,
the previous binding $watches (if any) will be unwatched, and bindings re-installed on the new
controller.
2015-01-29 16:48:06 -05:00
Caitlin Potter 35498d7045 feat($compile): allow using bindToController as object, support both new/isolate scopes
bindToController is now able to be specified as a convenient object notation:

```
bindToController: {
  text: '@text',
  obj: '=obj',
  expr: '&expr'
},
scope: {}
```

It can also be used in conjunction with new scopes, rather than exclusively isolate scopes:

```
bindToController: {
  text: '@text',
  obj: '=obj',
  expr: '&expr'
},
scope: true
```

Closes #10420
Closes #10467
2015-01-29 16:47:30 -05:00
Caitlin Potter 630b80fc00 chore($controller): don't use new for minErr instance
minErr creates a new error anyways, it's not meant to be called as a constructor.
2015-01-29 16:26:54 -05:00
Martin Staffa a80d9449b7 docs(guide/production): clarification in disabling debug data
Closes #10762
2015-01-29 19:59:32 +01:00
Caitlin Potter dda65e992b fix($controller): throw better error when controller expression is bad
Previously, the error was a JS runtime error when trying to access a property of `null`. But, it's
a bit nicer to throw a real error and provide a description of how to fix it. Developer ergonomics
and all that.

Closes #10875
Closes #10910
2015-01-29 12:52:25 -05:00
Justin Schiff aa0f64496a fix(angular.copy): support copying %TypedArray%s
angular.copy can now copy a %TypedArray%s.

Limitations: It is not possible to update the length of a %TypedArray%, so currently an error is thrown
if the destination object is a %TypedArray%. However, it is possible to change values in a typed array,
so in the future this may only be a problem if the length of the source and destination is different.

Closes #10745
2015-01-29 12:17:10 -05:00
Vojta Jina e61eae1b1f fix($parse): remove references to last arguments to a fn call
This can be an issue if running (and killing) multiple apps/injectors on
the same page. The `args` array holds references to all previous arguments
to a function call and thus they cannot be garbage-collected.

In a regular (one app/injector on a page) app, this is not an issue.

Closes #10894
2015-01-29 14:44:42 +00:00
Wes Alvaro 400fbbf1d6 routeParams are {!Object<string, string>}
Calling Object.keys on null is a TypeError. And the mapping should be string -> string.

Closes #10896
2015-01-29 14:38:16 +00:00
Owen Smith 27bf2ce40c fix(ngRoute): dont duplicate optional params into query
When calling updateParams with properties which were optional, but
previously undefined, they would be duplicated into the query params as
well as into the path.

Closes #10689
2015-01-29 10:25:57 +00:00
marc c69caa7bee fix(ngScenario): Allow ngScenario to handle lazy-loaded and manually bootstrapped applications
I know protractor is preferred, and ngScenario is only in maintenance mode. But, we are limited to
ngScenario based on the devices/browsers we are targeting (no web-driver available). So, we need
to address the bug where ngScenario does not work with manual bootstrap and also has issues if
angular.resumeBootstrap is not yet defined (race condition when lazy-loading).

Closes #10723
2015-01-29 10:15:45 +00:00
Shahar Talmi 8c46919199 fix(filter): format timezone correctly
This fixes timezone formatting in case UTC timezone is used

Closes #9359
2015-01-29 01:18:22 +02:00
Peter Bacon Darwin d729fcf030 fix(a): don't reload if there is only a name attribute
Closes #6273
Closes #10880
2015-01-28 14:30:51 +00:00
Shahar Talmi 0baa17a3b7 feat(ngMocks): cleanup $inject annotations after each test
this will help in detecting unannotated functions both in apps and angular core in case only part of the tests are run with strictDi
2015-01-28 13:47:46 +00:00
Pablo Villoslada Puigcerber 2ece1c927b docs(notarray): add error example and code blocks with suggested fixes
Add code examples for the error and the suggested fixes.
Followup of #10352.

Closes #10872
2015-01-27 21:58:57 +01:00
Alex Yursha 7602cd5e7e docs(guide/location): replace invalid link
Closes #10882
2015-01-27 21:25:21 +01:00
Jason Bedard 560951e988 refactor($interpolate): move standalone functions to the service scope
Closes #10413
2015-01-27 15:42:11 +01:00
Agrumas 1735d5e8d5 chore(i18n): regenerate locales due to closure library update
This includes change to the currency symbol of Lithuania.

Closes #10855
Closes #10856
2015-01-27 10:30:55 +00:00
Peter Bacon Darwin c88b119ef5 chore(i18n): update closure library to latest
This includes changed to Lithuanian currency and Mynamar Burmese date formats

Closes #10855
Closes #10856
2015-01-27 10:27:46 +00:00
Caitlin Potter 6cf6a1b975 docs(CHANGELOG.md): remove reverted form change 2015-01-26 18:57:50 -05:00
Jeff Cross 76df116574 revert: fix(form): ignore properties in $error prototype chain
This reverts commit 31a5b8353a.
2015-01-26 14:50:48 -08:00
Caitlin Potter 440c122556 docs(CHANGELOG.md): add changelog notes for v1.3.11 and v1.4.0-beta.2
Closes #10876
2015-01-26 16:11:54 -05:00
cmsdkfz f7114d0c1c refactor($q): change variable name
Change the variable name to be more accurate describing what it stands for.
2015-01-26 11:04:44 +01:00
Caitlin Potter 2958cd308b fix(htmlAnchorDirective): remove "element !== target element" check
It's not really needed due to the way click events are dispatched and propagated

Closes #10866
2015-01-25 23:39:54 -05:00
Vinti Maheshwari 9f7c5ceba7 chore(gruntFile): ensure build is run before test:modules
Closes #10188
2015-01-25 02:33:09 +00:00
Peter Bacon Darwin 2f32614378 test($location): ensure that link rewriting is actually being tested
If the link URL is not within the given base URL then the link would not
be rewritten anyway.

See https://github.com/angular/angular.js/pull/9906/files#r19813651
2015-01-25 00:35:22 +00:00
Caitlin Potter 8b33de6fd0 fix($location): don't rewrite when link is shift-clicked
Closes #9904
Closes #9906
2015-01-25 00:34:35 +00:00
Peter Bacon Darwin d40749caab docs(input): update example to use ngModel best practices
Update the rest of the directives to use object properties for models.

Closes #10851
2015-01-24 22:41:29 +00:00
Mark Hoffmeyer e13224b2df docs(input[checkbox]): update example to use ngModel best practices
It's not required for the example to function, but it prevents scope weirdness/unexpected
behavior when using directives (especially with ngTransclude!). I think it's a good pattern
to encourage and might prevent a bug down the road for for people who just scan for the
monospace font. See
[Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)
for mgModel best practices.

Closes #10851
2015-01-24 22:40:54 +00:00
Marcin Wosinek 36a14e65d1 docs(select): link to ngOptions
Closes #10854
2015-01-24 19:20:16 +01:00
Georgios Kalpakas 3228d3b499 fix(ngPluralize): fix wrong text content when count is null/undefined
When `lastCount` was evaluated to an non-numeric value (e.g. "other") and
`count` was evaluated to `NaN` (e.g. `null`/`undefined`), the text content
would be (wrongly) based on the previous template.
This commits makes sure the text content is updated correctly.

In order to customize the message shown upon `null`/`undefined` one can
specify a `'NaN'` property on the `when` exression object.

Closes #10836

Closes #10841
2015-01-24 14:01:33 +01:00
Jake Harclerode 6d173aeb5d docs($httpBackend): enhance readability
Closes #10852
2015-01-24 12:46:28 +01:00
samilamti d0ceeaa37e docs(guide/Introduction): define CRUD and add punctuation
Added description of what CRUD means.
Improved readability: Ensured that colons were followed by a capital letter
and added some sprinkled commas.

Closes #10804
2015-01-24 10:57:37 +00:00
Caitlin Potter 301663e734 fix(openPlunkr): enable cmd+click for us mac users :> 2015-01-23 16:47:19 -05:00
Mike Haggerty dca5fa7b81 feat(openPlunkr): enable ctrl+click
This change allows users to ctrl+click on the "Edit in Plunker"
button which will set the posted form's target attribute to
"_blank" instead of "_self" which is the default.

Closes #10641
Closes #10826
2015-01-23 16:47:19 -05:00
Rouven Weßling d557875a8d test($rootScope) test the correct setting of the constructor in Internet Explorer 11
Closes #10759
2015-01-23 21:32:35 +00:00
Caitlin Potter b146af1127 fix(htmlAnchorDirective): don't add event listener if replaced, ignore event if target is different element
Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute
before linkage, the anchor directive would always prevent default.

Now, the anchor directive will not register an event listener at all if the original directive is replaced with a non-anchor, and
will ignore events which do not target the linked element.

Closes #4262
Closes #10849
2015-01-23 15:39:59 -05:00
Pablo Villoslada Puigcerber cea8e75144 fix(filterFilter): throw error if input is not an array
Throw error if filter is not used with an array.

BREAKING CHANGE: Previously, the filter was not applied if used with a non array.
Now, it throws an error. This can be worked around by converting an object to an array, using
a filter such as https://github.com/petebacondarwin/angular-toArrayFilter

Closes #9992
Closes #10352
2015-01-23 14:21:58 -05:00
Pawel Kozlowski b3a9bd3ae0 fix($templateRequest): cache downloaded templates as strings
Fixes #10630
Closes #10646
2015-01-23 18:43:26 +01:00
Caitlin Potter 31a5b8353a fix(form): ignore properties in $error prototype chain
Closes #10469
Closes #10727
2015-01-23 14:37:17 +00:00
Rouven Weßling 301e7aae24 refactor(Angular): inline the only call to sortedKeys()
Closes #10757
2015-01-21 21:21:44 +01:00
Nick Van Dyck f2e2b31ece docs(ngMessages): fix typo
Closes #10821
2015-01-21 20:18:42 +01:00
Boshen Chen 331cac233f docs(ngInit): fix code block not being displayed in the note section
Closes #10791
2015-01-20 21:34:43 +01:00
Pawel Kozlowski 7e3557e96b docs(CHANGELOG): add changes for 1.3.10 and 1.4.0-beta.1 2015-01-20 20:43:54 +01:00
Pawel Kozlowski d435464c51 feat($http): provide a config object as an argument to header functions
Closes #7235
Closes #10622
2015-01-20 19:42:59 +01:00
Alexandr Subbotin c2031b1e9e fix(ngRepeat) do not allow $id and $root as aliases
Currently user can use `$id` or `$root` as alias in ng-repeat directive that leads to rewriting
these scope-related variables. This commit fixes this behavior by throwing an error when user try
to use these values.

Closes #10778
2015-01-20 10:39:55 -05:00
Pawel Kozlowski d17fbc3862 fix(ngController): allow bound constructor fns as controllers
Fixes #10784
Closes #10790
2015-01-19 20:11:34 +01:00
Matias Niemelä 0db5b21b1d fix($animate): ensure no transitions are applied when an empty inline style object is provided
Closes #10613
Closes #10770
2015-01-19 14:37:58 +00:00
Caitlin Potter c260e73863 fix(ngRepeat): do not sort object keys alphabetically
BREAKING CHANGE:

Previously, the order of items when using ngRepeat to iterate
over object properties was guaranteed to be consistent by sorting the
keys into alphabetic order.

Now, the order of the items is browser dependent based on the order returned
from iterating over the object using the `for key in obj` syntax.

It seems that browsers generally follow the strategy of providing
keys in the order in which they were defined, although there are exceptions
when keys are deleted and reinstated. See
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_issues

The best approach is to convert Objects into Arrays by a filter such as
https://github.com/petebacondarwin/angular-toArrayFilter
or some other mechanism, and then sort them manually in the order you need.

Closes #6210
Closes #10538
2015-01-19 09:39:08 +00:00
Peter Bacon Darwin e5ad6d6ecd chore(travis): update browsers to the latest version
Update the used browsers to the latest versions available

Closes #10620
2015-01-19 08:22:51 +00:00
Peter Bacon Darwin bd9bc3f828 test(privateMocks): fix for the latest version of Safari 2015-01-19 08:19:20 +00:00
Alexandr Subbotin 2b8baf7e10 refactor($templateRequest): remove repeated decrementation and unnecessary local variable
Closes #10780
2015-01-18 19:53:24 +01:00
Pawel Kozlowski b8e8c5587f docs(ngClass): fix jscs style errors 2015-01-18 19:25:34 +01:00
Evan Spiler 37dd419478 docs(ngClass): fix formatting
Closes #10793
2015-01-18 19:11:17 +01:00
Robin Andersson 8a433f3cc5 docs($cookie): clarify return value if no cookie exist
Closes #10794
2015-01-18 19:09:10 +01:00
thorn0 1476810a2c docs(angular.bootstrap): passed fns are called on config stage
Closes #10789
2015-01-17 18:10:02 +01:00
Martin Staffa 833ea05abf test(form): test if $pending inputs are correctly removed
It's a separate test because $pending behaves differently from $error
- the property is completely removed when no pending inputs / forms
are left.
2015-01-16 21:43:53 +01:00
Martin Staffa ca5fcc6f7a refactor(ngModel): clarify the arguments of $setValidity 2015-01-16 21:43:53 +01:00
Martin Staffa 2408f2ded5 fix(form): clean up success state of controls when they are removed
Fixes #10509
2015-01-16 21:43:53 +01:00
Martin Staffa 1bf1a6203c docs(migration): in 1.3, global controllers are disabled by default
Closes #10775
2015-01-16 21:25:39 +01:00
Sekib Omazic b7117afa2f docs($rootScope.Scope): Simple typo
Closes 10767
2015-01-16 21:11:57 +01:00
Sekib Omazic 3ae79c0105 docs(ngInclude): Typo fixed
Typo fixed
2015-01-16 21:09:17 +01:00
Sekib Omazic 2b64f6e318 docs(ngMessages): --typos.length
Merci~

Closes #10769
2015-01-15 15:46:13 -05:00
Caitlin Potter 23c8a90d22 fix($compile): support class directives on SVG elements
Closes #10736
Closes #10756
2015-01-15 13:58:57 -05:00
Marcin Wosinek 0504395c14 docs(design): highlight source button when focused 2015-01-15 13:57:07 +00:00
Kiran Rao 3831de8a05 docs(CONTRIBUTING): add colons for consistent styling
Closes #10744
2015-01-15 13:54:25 +00:00
campersau 40abdaf407 docs($templateRequest): remove duplicate "the" in return description
Introduced with: 1e5e527c84

Closes #10714
2015-01-15 13:51:58 +00:00
Martin Mouterde 3422cbac80 docs(date): fix milliseconds syntax description
There is no need to prefix 'sss' with ',' or '.'.

Closes #10680
2015-01-15 13:43:25 +00:00
anyong 08035545ed docs(tutorial/0): remind users to refresh page
On line 32-34 after reverting to step-0 and starting the webserver, the
browser may have already cached the master branch of the app and the user
will see the master version in their browser. I just added a reminder to
tell them to refresh the page if this happens!

Closes #10615
2015-01-15 13:14:56 +00:00
Kok-Hou Chia 9580bc2c2e docs(tutorial/7): correct typos
Closes #10587
2015-01-15 13:12:36 +00:00
Tyler Morgan 5a9dde1c27 docs(guide/Directives): demonstrate how to pass data from isolate to parent scope
It looks like this used to be in the Angular docs as per this thread:
https://groups.google.com/d/msg/angular/3CHdR_THaNw/AxqKwUw5t0oJ. I recently
spent some time trying to get this to work and was very frustrated by lack of
documentation.

Closes #10567
2015-01-15 13:03:12 +00:00
Olivier Giulieri 3a17799098 docs(css): fix position and size of Table of Contents "close" button
Closes #10555
2015-01-15 12:53:04 +00:00
Peter Bacon Darwin 1a7e9de8d8 chore(version-info): use branchPattern where we are replacing * 2015-01-14 20:44:32 +00:00
Peter Bacon Darwin 299b3e7e01 chore(release-scripts): split BranchPattern from BranchVersion
The release scripts need the BranchPattern to be of the form: 1.4.* so that
they can match the version using Regex.

The doc gen scripts need a SemVer pattern that will match beta releases.
The convention is that 1.4.x is not satisfied by 1.4.0.beta.0
2015-01-14 20:36:17 +00:00
Peter Bacon Darwin 54cae0f1d0 chore(package.json): increment the branch pattern to 1.4 2015-01-14 18:18:46 +00:00
Jonathan Gruber 4af7cdaf4d docs(tutorial/step_10): Added missing semicolon
Added a missing semicolon in definition of $scope.setImage.

Closes #10752
2015-01-14 09:41:49 -05:00
Caitlin Potter 593b18c66a revert: chore(npm): Make require()-able as part of publish script
This reverts commit babc20b43d.

(We wanted to get some feedback before doin this)
2015-01-13 14:25:59 -05:00
Peter Bacon Darwin f2e1a930aa docs(CHANGELOG): add changes for 1.3.9 and 1.4.0-beta.0 2015-01-13 00:58:55 +00:00
Ben Clinkinbeard babc20b43d chore(npm): Make require()-able as part of publish script
(This has not been tested locally with browserify --- but it should work!
If it doesn't, please file a bug rather than just leaving a comment on this
commit :)

Closes #10731
2015-01-12 19:08:45 -05:00
Peter Bacon Darwin ba90261b75 fix(ngOptions): support one-time binding on the option values
Utilize the $watchDelegate on the watcher used to detect changes to the labels.

Closes #10687
Closes #10694
2015-01-12 19:48:42 +00:00
Peter Bacon Darwin fc21db8a15 fix(ngOptions): prevent infinite digest if track by expression is stable
Closes #9464
2015-01-12 19:48:41 +00:00
Peter Bacon Darwin b4bdec35cb refact(ngOptions): specialize readValue and writeValue based on multiple attribute 2015-01-12 19:48:41 +00:00
Peter Bacon Darwin 933591d69c fix(ngOptions): update model if selected option is removed
Closes #7736
2015-01-12 19:48:41 +00:00
Peter Bacon Darwin cf9331ac66 style(ngOptionsSpec): add extra newline for better formatting 2015-01-12 19:48:41 +00:00
Peter Bacon Darwin 02977c5bab test(ngOptions): should not insert a blank option if one of the options maps to null
Closes #7605
2015-01-12 19:48:41 +00:00
Peter Bacon Darwin 9f5ac048d7 test(ngOptions): should place non-grouped items in the list where they appear
Closes #10531
2015-01-12 19:48:41 +00:00
Peter Bacon Darwin 408f89d8e6 refact(ngOptions): move into its own file
Since select is not aware of ngOptions, it makes sense to move it into its
own file for more easy maintenance.
2015-01-12 19:48:41 +00:00
Peter Bacon Darwin 7fda214c4f fix(ngOptions): ensure that the correct option is selected when options are loaded async
**Major reworking of select and ngOptions**:

* The `SelectController` is now used as an abstraction for the `select` and `ngOptions` directives
to override to get their desired behaviour
* The `select` directive is completely oblivious to the ngOptions directive now - the `ngOptions`
directive could be deleted without having to make any changes to the `select` directive.
* Select related directives (single/multiple/ngOptions) can provide specific versions of
`SelectController.writeValue` and `SelectController.readValue`, which are responsible for getting
the `$viewValue` in or out of the actual `<select>` element and its `<option>` children.

BREAKING CHANGE:

When using `ngOptions`: the directive applies a surrogate key as the value of the `<option>` element.
This commit changes the actual string used as the surrogate key. We now store a string that is computed
by calling `hashKey` on the item in the options collection; previously it was the index or key of the
item in the collection.

(This is in keeping with the way that the unknown option value is represented in the select directive.)

Before you might have seen:

```
<select ng-model="x" ng-option="i in items">
  <option value="1">a</option>
  <option value="2">b</option>
  <option value="3">c</option>
  <option value="4">d</option>
</select>
```

Now it will be something like:

```
<select ng-model="x" ng-option="i in items">
  <option value="string:a">a</option>
  <option value="string:b">b</option>
  <option value="string:c">c</option>
  <option value="string:d">d</option>
</select>
```

If your application code relied on this value, which it shouldn't, then you will need to modify your
application to accommodate this. You may find that you can use the `track by` feaure of `ngOptions`
as this provides the ability to specify the key that is stored.

BREAKING CHANGE:

When iterating over an object's properties using the `(key, value) in obj` syntax
the order of the elements used to be sorted alphabetically. This was an artificial
attempt to create a deterministic ordering since browsers don't guarantee the order.
But in practice this is not what people want and so this change iterates over properties
in the order they are returned by Object.keys(obj), which is almost always the order
in which the properties were defined.

Closes #8019
Closes #9714
Closes #10639
2015-01-12 19:48:41 +00:00
Julie Ralph eb6cb785df chore(testing): bump protractor to version 1.6.0 2015-01-12 11:46:46 -08:00
Roman Konstantinovich aa798f1236 fix($location): right button click in firefox
When user click right mouse button on links in firefox, browser goes to
link. See http://jsfiddle.net/kromxr/76fKM/12/

Closes #7984
2015-01-12 17:13:54 +01:00
vasileorza 5a60302389 feat($timeout): allow fn to be an optional parameter
Closes #9176
Close #9723
2015-01-12 11:38:34 +00:00
Petr Peller 034fade3e8 docs(error/nobase): Added trailing slash for base path
Trailing slash seems to be necessary, otherwise `$routeProvider` does not match routes correctly. Following is not matched:

URL http://www.example.com/b/foo/1234
`<base href="/b/foo">`
```
$routeProvider.when('/:id', {
            templateUrl: '/view/path.html',
            controller: 'MyCtrl',
            reloadOnSearch: false
        });
```
2015-01-11 20:27:12 +01:00
Pawel Kozlowski e24f22bdb1 fix($templateRequest): propagate HTTP status on failed requests
Fixes #10514
Closes #10628
2015-01-11 10:56:19 +01:00
Jesse Palmer 371c1e19d8 docs(app): increment copyright year
Closes #10712
2015-01-11 10:54:42 +01:00
Jason Deppen b5e00cf615 docs(ngModel): from makes more sense than the other thing
Not sure if this is a worthy change but it confused me when I read it. It is worthy, thank you for submitting this! Cheers!

In practice, different from is by far the most common of the three, in both British and American English:
http://www.oxforddictionaries.com/us/words/different-from-than-or-to

Closes #10710
2015-01-11 01:22:06 -05:00
Andrew Joslin 5765061652 docs(ngMessages): fix typo on messages
The css class `.ng-inactive` applies when there is no message present
2015-01-10 17:59:59 +01:00
Leonardo Braga b146cae02c refactor(minErr): cleanup the generation of the error message
Removes a "magic number" used multiple times in the code
Removes unnecessary variables "arg" and "prefix"
Removed a condition within the "for" loop that generates query string parameters
2015-01-10 17:25:58 +01:00
Julie Ralph 3353afbb59 chore(travis): split out the docs e2e tests into their own travis job
Previously, they were in the 'unit' job to save travis VMs, but this
was confusing and made it more difficult to track down errors easily.
2015-01-09 14:10:29 -08:00
Julie Ralph 40cb57c8f6 chore(travis): make browserstack unit tests allowed failures 2015-01-09 10:23:31 -08:00
Peter Bacon Darwin f06f28e018 revert: refact(): no need to trim empty hash from $location.absUrl()
This reverts commit f3b088a4e4.

The commit didn't take into account that IE9 may actually return empty
hash URLs for $location.absUrl().
2015-01-09 13:24:05 +00:00
Peter Bacon Darwin f3b088a4e4 refact(): no need to trim empty hash from $location.absUrl()
Only `$browser.url()` ever contains an empty hash fragment so that is the
only call that needs to be trimmed.

Closes #10515
2015-01-08 20:12:00 +00:00
Lucas Galfaso ef1a9d2cda chore(ngModelOptions): remove reference to angular.copy
Replaced a reference to `angular.copy` with just `copy`
2015-01-08 20:02:28 +01:00
Shahar Talmi 9c9c6b3fe4 fix(ngModelOptions): allow sharing options between multiple inputs
Closes #10667
2015-01-08 12:36:54 +01:00
quentin 51d6774286 feat($filter): Display Infinity symbol when number is Infinity
Infinity is a value and should not be treated as an empty string

Closes #10421
2015-01-08 12:14:48 +01:00
Leonardo Braga e079111b33 fix(ngChecked): ensure that ngChecked doesn't interfere with ngModel
Corrects an issue which occurs when an element's ng-modeol and ng-checked attributes have the same
value.

Closes #10662
Closes #10664
2015-01-07 20:45:41 -05:00
Lucas Galfaso e1132f53b0 fix(ngClass): handle multi-class definitions as an element of an array
Handles multi-class definition as an element of an array

Closes #8578
Closes #10651
2015-01-07 20:36:46 +01:00
Karl ab4b632dbf refactor(ngMessages): remove unused function argument
Closes #10652
2015-01-07 19:56:00 +01:00
eemmosi 1b704071c8 docs(tutorial/Routing): improve wording
Closes #10668
2015-01-07 19:53:11 +01:00
Peter Bacon Darwin 647d93338f chore(benchmark): add ngOptions benchmark 2015-01-07 13:35:25 +00:00
Pawel Kozlowski 1334b8c832 fix(dateFilter): ignore invalid dates
Fixes #10640
2015-01-06 23:18:32 +01:00
Uri Goldshtein d2a9a163fb docs(guide/index): add angular-easyfb with Facebook login to login libraries
Merci~

Closes #5792
2015-01-06 13:40:59 -05:00
Bryce Hanscomb e24d968276 style(ngRoute): move comment inside relevant function
This is a functional workaround for https://github.com/6to5/6to5/issues/376
And makes the comment code-style more consistent with line 143 and line 463.
2015-01-05 21:10:22 +01:00
Andrey Pushkarev a01ce6b81c fix(filterFilter): use isArray() to determine array type
In JavaScript, an array is a special type of object, therefore typeof [] returns object.
Added corresponding unit tests.

Changed condition for array type to isArray.

Closes #10621
2015-01-02 13:14:23 -05:00
Marc Laval c66b4b6a13 fix(ngPluralize): generate a warning when using a not defined rule
When using `ng-pluralize` and a rule is missing, then generate a warning

Fix #10207
2015-01-02 12:53:02 +01:00
Leonardo Braga 66ceecc295 refact($SnifferProvider): use bodyStyle var instead of document.body.style
Closes #10602
2014-12-31 15:09:16 +01:00
Pawel Kozlowski 349742b3f0 test($http): remove unused inject() calls
Closes #10611
2014-12-31 14:50:30 +01:00
Rus1 2ff7edfdd1 docs(ngInclude): replace <tt> with <code>
Using obsolete <tt> HTML tag may not be good for Angular examples

Closes #10594
2014-12-30 15:47:59 -05:00
Raphael Luba 1e5e527c84 docs($templateRequest): fix "returns" description to match code
Closes #10603
2014-12-30 19:01:20 +01:00
Mike Sidorov 1c76bf7e94 chore(*): add .gitattributes with new lines configuration
Closes #10431
Closes #10605
2014-12-30 18:53:50 +01:00
Daniel Tsui 6018f5da3f docs(misc/FAQ): grammatical improvements
-Non-idiomatic use of an expression "from the ground up".
-Missing commas.

Closes #10593
2014-12-29 21:19:04 +01:00
袴田 俊輔 3616b9b07c refactor(ngScenario): use Date.now() for get current Time
Closes #10579
2014-12-29 21:15:53 +01:00
Lucas Galfaso d224fe8172 docs(input): fix typo
Fix a typo on an example from the `input` directive
2014-12-28 20:57:43 +01:00
Lucas Galfaso e9bf93d510 refactor(*): rename internal function int to toInt
Renamed the internal function `int` to `toInt` as `int` is a reserved word

Closes #7768
2014-12-28 20:56:05 +01:00
mjfroehlich 2e721a7914 docs(guide/modules): fix minor typos
Closes #10584
2014-12-28 18:50:13 +01:00
Chris Schmitz 1eb6036d29 docs($compile) fix a typo
Remove unnecessary 'and' in $compile docs.

Closes #10582
2014-12-28 18:48:40 +01:00
OKNoah 4836dacae6 docs($http): fix markdown formatting
Closes #10571
2014-12-28 18:42:01 +01:00
Lucas Galfaso 0e2ac3cd70 chore($cache): do not add entry to LRU hash when value is undefined
When adding entries to the cache and the `value` is `undefined`, no
entry should be added to the `lruHash`
2014-12-28 16:59:57 +01:00
Peter Bacon Darwin 0f9fd2f642 test(input): split tests into smaller files
This is complement to the previous commit.
It also refactors the input compile helpers to make it cleaner and more
consistent.
2014-12-24 23:19:39 +00:00
Peter Bacon Darwin 3e42b22b0e refact(input): split input.js into smaller files
The input.js file is unnecessarily large, containing many directives including the
vast `ngModel`. This change moves ngModel and a few other directives into their
own files, which will make maintenance easier.
2014-12-24 13:07:07 +00:00
David Souther deb3cb4dae feat(ngMock/$exceptionHandler): log errors when rethrowing
Now the `rethrow` mode will also record a log of the error in the same
way as the `log` mode.

Closes #10540
Closes #10564
2014-12-23 18:16:51 +00:00
David Souther b43fa3bb30 test($exceptionHandlerProvider): call inject() to run tests
In the current angular-mocksSpec, the tests for $exceptionHandlerProvider
call `module` to run tests on `$exceptionHandlerProvider.mode()`, but do
not call `inject()` to pump the module definitions.

Closes #10563
2014-12-23 16:28:08 +00:00
gokulkrishh 521c12c265 docs(guide/*): spelling/grammar improvements
Closes #10552
2014-12-22 10:43:55 -05:00
Caitlin Potter 7f5051bb2a docs($rootScope): remove erroneous closing parenthesis
Closes #10549
2014-12-22 08:33:10 -05:00
Kevin Primat 25623b709f docs(guide/location): add missing definite article
The sentence was missing a definite article so was unclear. Added one to clarify.

Closes #10547
2014-12-22 08:24:27 -05:00
Olivier Giulieri e4f23c4d25 docs(guide): fix spaces
Closes #10539
2014-12-22 01:07:46 +00:00
gdi2290 8928d02345 perf(ngStyleDirective): use $watchCollection
Since we are simply watching a flat object collection it is more performant
to use $watchCollection than a deepWatch...

Closes #10535
2014-12-22 00:35:38 +00:00
Dan Cancro 5bb2636aac docs(guide/index): Link to starter options
Add a link to a comparison spreadsheet of alternative generators, examples,
tutorials and seeds that one can use to get started on a new Angular project.

Closes #10526
2014-12-22 00:30:02 +00:00
Robert Haritonov c95e38c603 docs(tutorial/12): fix path to jquery in bower
Closes #10504
2014-12-22 00:12:45 +00:00
Peter Bacon Darwin a3c3bf3332 feat(limitTo): ignore limit when invalid
BREAKING CHANGE: limitTo changed behavior when limit value is invalid.
Instead of returning empty object/array it returns unchanged input.

Closes #10510
2014-12-21 10:03:43 +00:00
Shahar Talmi 2caec44632 refactor(limitTo): no need for all those checks if we use slice
Closes #10537
2014-12-21 10:03:43 +00:00
leticialozano eae848a712 docs($http): fix typo
Closes #10534
2014-12-20 14:21:54 +01:00
Brian Ford 47a55ca767 docs(changelog): release notes for 1.3.8 prophetic-narwhal 2014-12-19 13:22:00 -08:00
sandeep 3d78bf3fa8 docs(guide/index): add book Responsive Web Design with AngularJS
This book explores the AngularJS features that can help a developer for building a responsive application.

Merçi beaucoup~

Closes #10513
2014-12-18 23:58:21 -05:00
Brian Ford 6e80d0ad54 docs(guide/$location): improve formatting 2014-12-18 15:01:51 -08:00
Ben Nelson ae637acdfb docs(api/index): grammar is important and so should you
I changed the word "into" to "within".
Original description underneath ngAnimate reads: "Use ngAnimate to enable animation features into your application".
I changed the text to read: "Use ngAnimate to enable animation features within your application".
The change in wording makes the description read better and gives it a more professional feel.

Closes #10517
2014-12-18 13:49:01 -05:00
Pawel Kozlowski 661f6d9ecf fix(orderBy): compare timestamps when sorting date objects
Fixes #10512
Closes #10516
2014-12-18 19:41:25 +01:00
Olivier Giulieri 56a7abd38f docs(guide): fix typo
Closes #10511
2014-12-18 18:43:30 +01:00
olexme 7d70dcdab1 docs($animate): fix misleading $animate.cancel example
The given example is wrong, you can't cancel the promise returned by "then"
since it is not the one originally tracked by "addClass".

Closes #10498
2014-12-17 20:14:22 +00:00
Todd Skinner 9e6161e579 docs($httpBackend): correct grammar
Closes #10496
2014-12-17 11:15:20 +00:00
Georgios Kalpakas bd28c74c1d fix(filterFilter): make $ match properties on deeper levels as well
Closes #10401
2014-12-17 10:17:07 +01:00
kwypchlo cd77c089ba perf(limitTo): replace for loop with slice 2014-12-16 22:43:46 +01:00
kwypchlo 83f88c1818 refactor(orderBy): remove unneeded function wrapping 2014-12-16 22:42:13 +01:00
Georgios Kalpakas fb2c585897 fix(filterFilter): let expression object {$: '...'} also match primitive items
Closes #10428
2014-12-16 22:40:34 +01:00
Kevin Primat bdbe4fd34a docs(Angular): improve sentence flow
Closes #10482
2014-12-16 19:04:05 +01:00
Kevin Primat 0b4e150aa5 docs(Angular): fix punctuation
Closes #10481
2014-12-16 19:02:02 +01:00
Jack Kingsman e091bb7dbb docs(error/badcfg): add missing "but"
Sentence meaning was unclear; added what I assumed should have been a "but"

Closes #10473
2014-12-16 14:31:24 +00:00
marmalade b62c858499 docs(guide/Scopes): fix capitalization
This sentence should begin with a capital 'R', not a lower case one.

Closes #10472
2014-12-16 14:29:53 +00:00
Chi Kei Chan 4a18274670 docs(guide/E2E Testing): add '-' to 'end-to-end'
Closes #10458
2014-12-16 14:28:45 +00:00
Zachary Lopez e3bf1ed217 docs(angular.identity): add @param and @returns tags
Closes #10457
2014-12-16 14:26:29 +00:00
Chi Kei Chan a5f037d033 docs($templateRequest): fix run-on sentence
The description of $templateRequest contains a run-on sentence that makes it confusing to understand.

ORGINAL: If the HTTP request fails or the response data of the HTTP request is empty then a `$compile` error will be thrown (the exception can be thwarted by setting the 2nd parameter of the function to true).

NEW: If the HTTP request fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the exception can be thwarted by setting the 2nd parameter of the function to true).

Closes #10456
2014-12-16 14:25:18 +00:00
Alexander Tseung 25152bb218 docs(tutorial/index): improve capitalization
Improve capitalization in acronyms for better clarity.
2014-12-16 14:21:27 +00:00
Aleksey Bobyr 24eb528b05 docs(guide/expression): update diff list between JavaScript and Angular expressions
add paragraphs about function declaration, comma and void operators and
RegExp to the diff list in the beginning of articule

Closes #10418
Closes #10452
2014-12-16 14:21:01 +00:00
thorn0 d161cc6b25 docs(select): improve formatting and wording
The part about using `select as` and `track by` together was hard to read.
And it wasn't clear what happens if they're used together.

Closes #10409
2014-12-16 14:18:51 +00:00
Jesús Rodríguez Rodríguez d604f941e8 fix(CHANGELOG): missing version number for 1.2.28
Well, the version number was missing there.
2014-12-16 12:44:07 +01:00
Peter Bacon Darwin 85758ce3af docs(CHANGELOG): remove reverted commit 2014-12-16 07:56:13 +00:00
Caitlin Potter 924e68c7d5 fix(ngAria): trigger digest on ng-click via keypress, pass $event to expression
Minor improvement to ng-click directive from ngAria. Now, if bindings are updated
during the click handler, the DOM will be updated as well. Additionally, the $event
object is passed in to the expression via locals, as is done for core event directives.

Closes #10442
Closes #10443
Closes #10447
2014-12-15 20:47:53 -05:00
Peter Bacon Darwin f297aa5d0a chore(CHANGELOG): update with changes for 1.2.28 2014-12-15 22:14:51 +00:00
Brenard Cubacub 337ce67612 docs(API Reference): fix punctuation
Closes #10453
2014-12-15 21:27:29 +01:00
Todd Skinner 8b56c08327 docs(angular.copy): fix grammar
Closes #10459
2014-12-15 21:24:53 +01:00
Peter Bacon Darwin 32eec67023 chore(CHANGELOG): update with v1.3.7 changes 2014-12-15 19:21:28 +00:00
Georgios Kalpakas fd1528a6c8 chore(CHANGELOG): add breaking change note for #9757 2014-12-15 18:48:06 +00:00
Chi Kei Chan 6cb5fbf5ef docs(error/badname): fix grammatical error
Closes #10460
2014-12-15 19:07:58 +01:00
Alexander Tseung f6644c720e docs(tutorial/step_08): fix capitalization
Closes #10466
2014-12-15 19:05:05 +01:00
Chi Kei Chan 0d9aafba3b docs(angular.fromJson): replace the word "Thingy"
Replace the word "thingy" with "JSON string" to specify what thingy means.

Closes #10468
2014-12-15 19:03:06 +01:00
Julie Ralph 0524e92d2e docs(migration): add end to end upgrade info to migration doc
There are a couple of changes to some Protractor tests that need to be made
when migrating from AngularJS 1.2 to 1.3 - document these in the migration
guide.

See https://github.com/angular/protractor/issues/1480

Closes #10377
2014-12-15 13:46:21 +00:00
Shahar Talmi 9b96cea462 feat($rootScope): allow passing locals argument to $evalAsync
Closes #10390
2014-12-15 13:45:12 +00:00
Jason Bedard c90ad96808 fix($parse): a chain of field accessors should use a single getterFn 2014-12-15 13:03:05 +01:00
Lucas Galfaso 69f69db1e0 revert($compile): use createMap() for $$observe listeners when initialized from attr interpolation
This reverts commit 8e28bb4c2f.
2014-12-14 13:32:55 +01:00
Jason Bedard 8e28bb4c2f fix($compile): use createMap() for $$observe listeners when initialized from attr interpolation 2014-12-14 12:41:04 +01:00
Pawel Kozlowski ab41e48493 docs(dateFilter): fix docs to match implementation for week no formatting
The existing documentation claims that dateFilter determines week no
according to the ISO8601 standard, but this is not the case as illustrated
by tests in this PR. More specifically, the implementation deviates from
ISO8601 in 2 important aspects:
- impl assumes Sun to be the first day of a week, ISO8601 mandates Mon
- impl allows weeks 0 (for years starting on Fri, Sat) while ISO8601
would mark them as a week 52/53 of a previous year.

Fixes #10314
Closes #10313

Closes #10445
2014-12-14 11:28:46 +01:00
Sekib Omazic ef640cbc2a fix(ngRepeat): allow extra whitespaces in (key,value) part of micro-syntax
e.g. (  aaa  ,   bbb  ) will be accepted by parser

Fixes #6827
Closes #6833
2014-12-14 10:22:38 +01:00
Ruben Vicario Gonzalez 081fef60b2 docs(tutorial/index): improve punctuation
Closes #10449
2014-12-14 09:50:28 +01:00
Wes 99d1a438b6 docs(Courses): fix syntax issue in developer guide
The courses section should use commas between links to differentiate the instances of each link

Closes #10448
2014-12-13 21:27:18 -05:00
Dan Tennery-Spalding 6bd4292c24 docs(API Reference): corrected two typos - two missing commas
In the ngAnimate section, there were two commas missing from two sentences. This is inconsistent with the grammar used in the rest of the API documentation and made the document (slightly) more difficult to read. The two sentences are shown below, with the new commas added:

1. "Once defined, the animation can be triggered"
                           ^
                    comma added

2. "Once registered, the animation can be triggered"
                              ^
                    comma added

Closes #10447
2014-12-13 20:17:54 -05:00
Aleksandar Djindjic e0663312fb docs($rootScope): clean up inheritance example
Closes #10441
2014-12-13 18:06:50 +01:00
Jason Bedard 9ae0c01c2b perf($compile): only re-$interpolate attribute values at link time if changed since compile 2014-12-13 12:56:39 +01:00
Jon Hoguet 79b3b8b686 chore($location): use $window instead of window
Fix one place were there was a reference to `window` and not to `$window`
2014-12-13 12:52:42 +01:00
Pawel Kozlowski 1b740974f5 feat($http): pass response status code to data transform functions
Fixes #10324
Closes #6734

Closes #10440
2014-12-12 19:51:34 +01:00
Georgios Kalpakas b9bdbe615c fix($http): only parse as JSON when opening/closing brackets match
Previously, due to weak JSON-detecting RegExp, string like `[...}` and
`{...]` would be considered JSON (even if they obviously aren't) and an
expection would be thrown while trying to parse them.

This commit makes sure the opening and closing brackets match. This
doesn't completely eliminate false positives (e.g. `[]{}[]`), but does
help reduce them.

Closes #10349
Closes #10357
2014-12-12 18:46:00 +01:00
Stefan 6617b42bc7 docs(guide/Forms): added link to input type "date"
Closes #10415
2014-12-11 21:19:32 +01:00
Vojta Jina 8a907eb3ff chore(travis): run the build twice (BS and SL)
Temporarily run the each job twice:
- using BrowserStack
- using SauceLabs
2014-12-11 09:52:00 -08:00
Rouven Weßling aac3c4aa63 chore($$raf) remove moz prefix for requestAnimationFrame
This drops support for Firefox 22 and older.

The moz-prefix is still supported, but there is an effort to drop it eventually:
https://bugzilla.mozilla.org/show_bug.cgi?id=909154

Closes #9577
2014-12-10 16:01:02 -05:00
Pawel Kozlowski d162f152b8 refactor($http): avoid re-creating execHeaders function
The execHeaders function was being re-defined inside mergeHeaders
function. Additionally it was mutating its arguments.

Closes #10359
2014-12-10 20:57:28 +01:00
Rouven Weßling 4025883803 fix($http): don't convert FormData objects to JSON
This won't enable FormData uploads in itself, as the Content-Type is automatically set to application/json.

Closes #10373
2014-12-10 19:06:07 +01:00
thorn0 c437d0a470 docs(CHANGELOG.md): better group changes in 1.3.6
Closes #10392
2014-12-10 19:04:00 +01:00
Danny Callaghan 5d28d19623 docs(guide/Animations): fix punctuation
Closes #10398
2014-12-10 19:01:42 +01:00
Caitlin Potter 7fd2dc11ca chore(bower/unpublish.sh): add angular-messages and angular-aria
The unpublish script was not set to unpublish those packages

Closes #10379
2014-12-09 16:20:06 -05:00
Julie Ralph 63db09753e style(testability): throw a more informative error when getting testability
The angular.getTestability method requires an element parameter to determine
which Angular application to use. Currently, if the element provided is
undefined or outside of an Angular app, the error message is 'cannot read
property get of undefined'. Improving to a more relevant error message.
2014-12-09 11:48:38 -08:00
Caitlin Potter a097aa95b7 fix(orderBy): do not try to call valueOf/toString on null
8bfeddb5d6 added changes to make relational operator work as it
normally would in JS --- unfortunately, this broke due to my failure to account for typeof null
being "object".

This refactoring attempts to convert object values to primitives still, in a fashion similar to
the SortCompare (and subsequently the ToString() algorithm) from ES, in order to account for `null`
and also simplify code to some degree.

BREAKING CHANGE:

Previously, if either value being compared in the orderBy comparator was null or undefined, the
order would not change. Now, this order behaves more like Array.prototype.sort, which by default
pushes `null` behind objects, due to `n` occurring after `[` (the first characters of their
stringified forms) in ASCII / Unicode. If `toString` is customized, or does not exist, the
behaviour is undefined.

Closes #10385
Closes #10386
2014-12-09 13:34:27 -05:00
Pawel Kozlowski b3dfb38359 refactor($http): avoid using closure vars in serverRequest fn
Closes #10361
2014-12-09 19:24:52 +01:00
Pawel Kozlowski 3b5ba87797 refactor($http): drop superfluous argument to sendReq
Closes #10360
2014-12-09 18:50:17 +01:00
Grzegorz Marzencki e50002baed docs($resource): fix typo
Closes #10383
2014-12-09 18:12:22 +01:00
Brian Scoles a8089166f5 docs(guide/Expressions): fix grammar, flow and punctuation
Closes #10384
2014-12-09 18:10:08 +01:00
Wesley Cho d8e3707860 feat($compile): add support for ng-attr with camelCased attributes
SVG attributes are case sensitive and some have upper case letters in them
This change ensures that we can identify these, when being used with the `ng-attr`
directive, by encoding upper case letters with a preceding underscore.

For example to apply `ng-attr` to the `viewBox` attribute we could write
`ng-attr-view_box` - or any of the other variants: `ng:attr:view_box`,
`data-ng-attr-view_box`, etc.

Closes #9845
Closes #10194
2014-12-09 11:34:27 +00:00
Caitlin Potter ca4df475e1 docs(CHANGELOG.md): remove the closes ... from 2dc34a96 notes 2014-12-08 19:12:15 -05:00
Caitlin Potter 02c9dc6e16 docs(CHANGELOG): add v1.3.6 changes
Closes #10376
2014-12-08 19:10:34 -05:00
Tobias Davis 6ad109e745 docs($interval): correcting example code indentation
Bueno!

Closes #10372
2014-12-08 16:29:39 -05:00
Georgios Kalpakas c5cba6e9c1 chore(changelog): add test for addition of trailing newline
Adds tests for the functionality added by #9550.

Closes #10358
2014-12-08 13:04:15 -05:00
active-low 924d3c6bfe docs(contributing): correct push -f command
`git push -f` needs branch specification

In all cases, please consult the git manpages before consulting angular's contributing guide
when you need help with git, thx ^^

Closes #10356
2014-12-08 11:05:49 -05:00
Giuseppe Caruso ee29819dba docs(guide/controllers): Just a typo
Gingerbreak would break testing. :)

Oh my gosh he's right, it totally w/ould. That is so embarrassing!

Closes #10353
2014-12-08 10:50:03 -05:00
Clark DuVall 41f03e4b02 docs(ngView): remove multiple position: relative
Closes #10363
2014-12-08 09:04:13 +01:00
Shahar Talmi facfec9841 fix(http): preserve config object when resolving from cache
Fixes #9004
Closes #9030
2014-12-06 10:16:28 +01:00
Vojta Jina e2d1969d68 chore(grunt): remove unused code 2014-12-05 19:13:24 -08:00
Vojta Jina f380cd220c chore(travis): clean up browserstack/saucelabs scripts 2014-12-05 19:13:24 -08:00
Vojta Jina 2db0aabee3 chore(travis): enable both SauceLabs and BrowserStack
Setting env var `BROWSER_PROVIDER` to `browserstack` or `saucelabs`
determines which browser provider will be used.

This does not affect the build as all jobs are set to use SauceLabs.

Switch to Karma with Socket.io 1.x, which solves some issues(*) with BS.
Thus removing `config.transports` as it is not used anymore
(Socket.io 1.x starts with polling and tries to upgrade if available).

(*) folks from BS were fiddling with socket.io configuration to get it stable.
See https://github.com/dhimil/karma/commit/4c04011850bf66a8a7556cd76ad662c568399481
This is not necessary with Socket.io 1.x.
2014-12-05 19:13:23 -08:00
Ciro Nunes ee42cfea04 refactor(ngAria): remove local camelCase method
Closes #10338
Closes #10337
2014-12-05 22:13:24 +00:00
Ciro Nunes fbbf6ac161 docs(compile): document $attrs.$normalize
Closes #10345
2014-12-05 14:18:56 -05:00
Clay Anderson a1c5f2b4f0 docs(guide/forms): enhanced form examples to utilize $touched
The "Binding to form and control state" example now makes use of
control states that were introduced in 1.3.
For example, users are now informed of validation requirements upon
clicking 'Save'.

Closes #10066
2014-12-05 15:28:21 +01:00
Martin Staffa 2d6a0a1dc1 fix(ngModelController): always use the most recent viewValue for validation
This fixes issues where a parser calls $setViewValue. This is a common
strategy for manipulating the $viewValue while the user is entering
data into an input field.

When the $viewValue was changed inside the parser, the new viewValue
would be committed, parsed and used for validation. The original parser
however would run after that and pass the original (outdated) viewValue
on to the validators, which could cause false positives, e.g. for
minlength.

Fixes #10126
Fixes #10299
2014-12-05 14:36:41 +01:00
Mads Konradsen 0c4f9fa574 docs(ie): remove fixes needed for IE8 since we don't support it now
Closes #10330
Closes #10316
2014-12-05 12:20:34 +00:00
Peter Bacon Darwin 7ad66527ba docs(guide/migration): add info about change that could break isolated directive usage
Closes #10236
2014-12-05 11:32:25 +00:00
Caitlin Potter f2e7f875e2 feat($$jqLite): export jqLite as a private service
This makes it easy to use jqLite's nicer class API (compared to jQuery) in modules
like ngAnimate.
2014-12-04 18:05:07 -05:00
Caitlin Potter 40a537c25f fix(ngAnimate): do not use jQuery class API
jQeury's class API causes problems with SVG elements --- using jqLite in all cases
prevents issues.

Closes #10024
Closes #10329
2014-12-04 18:05:00 -05:00
Brian Ford cb192293f4 docs($animate): improve formatting of inline code 2014-12-04 13:15:09 -08:00
Pawel Kozlowski 8c3a42cd68 refactor($templateRequest): avoid double calls to $templateCache.put
Closes #10265
2014-12-04 21:24:06 +01:00
Peter Bacon Darwin 96e7897fef docs($location.ihshprfx): remove docs for unused error 2014-12-04 12:52:43 +00:00
Peter Bacon Darwin 2dc34a9699 fix($location): allow hash fragments with hashPrefix in hash-bang location urls
Previously if there was a hash fragment but no hashPrefix we would throw an error.
Now we assume that the hash-bang path is empty and that the hash is a valid fragment.

This prevents unnecessary exceptions where we clear the hashBang path, say by
navigating back to the base url, where the $browser leaves an empty hash symbol
on the URL to ensure there is no browser reload.

BREAKING CHANGE:

We no longer throw an `ihshprfx` error if the URL after the base path
contains only a hash fragment.  Previously, if the base URL was `http://abc.com/base/`
and the hashPrefix is `!` then trying to parse `http://abc.com/base/#some-fragment`
would have thrown an error. Now we simply assume it is a normal fragment and
that the path is empty, resulting `$location.absUrl() === "http://abc.com/base/#!/#some-fragment"`.

This should not break any applications, but you can no longer rely on receiving the
`ihshprfx` error for paths that have the syntax above. It is actually more similar
to what currently happens for invalid extra paths anyway:  If the base URL
and hashPrfix are set up as above, then `http://abc.com/base/other/path` does not
throw an error but just ignores the extra path: `http://abc.com/base`.

Closes #9629
Closes #9635
Closes #10228
Closes #10308
2014-12-04 12:49:31 +00:00
Peter Bacon Darwin 10ac594809 fix($browser): prevent infinite digests when clearing the hash of a url
By using `location.hash` to update the current browser location when only
the hash has changed, we prevent the browser from attempting to reload.

Closes #9629
Closes #9635
Closes #10228
Closes #10308
2014-12-04 12:49:31 +00:00
Jason Bedard d21dff21ed fix(ngmodel): fixing many keys incorrectly marking inputs as dirty 2014-12-03 16:47:35 -05:00
Jason Bedard 55d9db56a6 fix(inputs): ignoring input events in IE caused by placeholder changes or focus/blur on inputs with placeholders
Closes #9265
2014-12-03 16:46:55 -05:00
Lucas Galfaso 579aa59324 chore(docs): fix jscs error
Removed a triling whitespace
2014-12-03 21:45:47 +01:00
Steve Shaffer b9e5eaf669 docs(select): Updated ngOptions track by examples
Made the example shown consistent with the advice above it regarding not using
`select as` and `track by` in the same comprehension expression.  Also changed
references to `trackexpr` to `track by` since `trackexpr` is not defined
except in the examples.

Added filter + track by example for ngOptions

The documentation for ngRepeat includes such an example specifying the proper
order for filters and and "track by" clauses in the comprehension expression,
but these docs for ngOptions do not.
2014-12-03 21:31:43 +01:00
Justin 228281eecc docs($location): improve $location.hash() example
Closes #10300
2014-12-03 21:11:27 +01:00
Pawel Kozlowski acb066e84a fix(ngMock): allow numeric timeouts in $httpBackend mock
Fixes #4891
2014-12-03 21:06:33 +01:00
Lucas Galfaso ed1243ffc7 fix(parse): fix operators associativity
Make the operators `&&`, `==`, `!=`, `===`, `!==`, `<`, `>`, `<=`, `>=`
follow Javascript left-to-right associativity
2014-12-03 20:53:20 +01:00
Caitlin Potter 3aa5752894 fix(orderBy): make object-to-primtiive behaviour work for objects with null prototype 2014-12-03 14:19:25 -05:00
Caitlin Potter 8bfeddb5d6 fix(orderBy): maintain order in array of objects when predicate is not provided
In ES262, there are two properties which are used to get a primitive value from an Object:

- valueOf() -- a method which returns a primitive value represented by the Object
- toString() -- a method which returns a string value representing the Object.

When comparing objects using relational operators, the abstract operation ToPrimitive(O, TypeHint) is used,
which will use these methods to retrieve a value.

This CL emulates the behaviour of ToPrimitive(), and ensures that no ordering occurs if the retrieved value
is identical.

This behaviour was previously used for Date objects, however it can be safely made generic as it applies to
all objects.

Closes #9566
Closes #9747
Closes #10311
2014-12-03 14:19:24 -05:00
hartz89 015111fd79 docs(ngTransclude): improve markup consistency
Closes #10298
2014-12-03 19:38:00 +01:00
Julien Valéry cc0fbe37d4 docs($compile): fix spelling
Closes #10296
2014-12-03 19:21:38 +01:00
Jason Bedard 1b640f9665 test($interpolate): adding tests for watching $interpolate functions
Closes #10119
2014-12-03 19:15:08 +01:00
Caitlin Potter 32806caf13 docs(guide/css-styling): form controls are not always input elements
People frequently write custom form controls using the `ngModel` directive, this just
refactors the text to be more clear that this is possible (imho).
2014-12-02 22:00:00 -05:00
Caitlin Potter 9c113aa4af style(guide/css-styling): remove trailing whitespace
Pretty self-explanatory, no mystery here.
2014-12-02 22:00:00 -05:00
Caitlin Potter 9a616eade4 refactor(toJson): remove breaking change from previous CL
Closes #10297
2014-12-02 17:32:39 -05:00
Caitlin Potter 7daf4e0125 test(toJson): add extra test cases for new pretty behaviour 2014-12-02 17:32:38 -05:00
Rahul Doshi 1191edba4e feat(jsonFilter): add optional arg to define custom indentation
also change toJson function to accomodate passing in of number of spaces

Closes #9771
2014-12-02 17:32:38 -05:00
Philipp Denzler c8c9bbc412 docs(guide/Working With CSS): ng-touched/untouched
Add description for ng-touched and ng-untouched CSS classes.

Closes #10302
2014-12-02 17:13:34 -05:00
Lucas Galfaso 429938da1f fix($parse): Follow JavaScript context for unbound functions
Use `undefined` as the context when a function is ounbound.
E.g. when executing `foo()()`, then `foo()` is executed using the
scope as the context, the function returned by `foo()` will
have an `undefined` context
2014-12-02 22:45:32 +01:00
Georgios Kalpakas a75537d461 fix(filterFilter): don't match primitive sub-expressions against any prop
Basically, implement the logic detailed in the 2nd point of
https://github.com/angular/angular.js/pull/9757#issuecomment-63544399
2014-12-02 13:52:21 -05:00
Georgios Kalpakas 5ced914cc8 fix(filterFilter): ignore function properties and account for inherited properties
Closes #9984
2014-12-02 13:52:21 -05:00
Georgios Kalpakas a631a759d2 test(filter): test expression object with inherited properties
Related to #9984
2014-12-02 13:52:21 -05:00
Georgios Kalpakas f7cf846045 fix(filterFilter): correctly handle deep expression objects
Previously, trying to use a deep expression object (i.e. an object whose
properties can be objects themselves) did not work correctly.
This commit refactors `filterFilter`, making it simpler and adding support
for filtering collections of arbitrarily deep objects.

Closes #7323
Closes #9698
Closes #9757
2014-12-02 13:52:11 -05:00
Pawel Kozlowski 96c61fe756 fix(numberFilter): numbers rounding to zero shouldn't be negative
Closes #10278
2014-12-02 19:36:39 +01:00
chasefleming 915a891ad4 fix(linky): make urls starting with www. links, like markdown
It's super cool!

Closes #10290
2014-12-02 13:25:54 -05:00
Carson McDonald 8df47db72f docs(guide/scope): fix typo
Closes #10289
2014-12-02 19:21:02 +01:00
Olivier Combe 013b522c9e feat($injector): print caller name in "unknown provider" errors (when available)
NGEUROPE!!!!!

Closes #8135
Closes #9721
2014-12-02 12:19:15 -05:00
Mike Stickel 7c6be43e83 fix(ngSanitize): exclude smart quotes at the end of the link
When smart quotes are included in content filtered through linky, any
smart quote at the end of a URL string was being included in the link
text and the href.

Closes #7307
2014-12-02 12:11:35 +00:00
Peter Bacon Darwin e93710fe0e fix($location): strip off empty hash segments when comparing
The url is the same whether or not there is an empty `#` marker at the end.
This prevents unwanted calls to update the browser, since the browser is
automatically applying an empty hash if necessary to prevent page reloads.

Closes #9635
2014-12-02 12:04:59 +00:00
Marcy Sutton 5481e2cfcd feat(ngAria): bind keypress on ng-click w/ option
Closes #10288
2014-12-01 19:15:57 -05:00
Georgios Kalpakas c6b57f1ec6 docs(guide/accessibility): fix dangling links 2014-12-01 14:43:04 -08:00
Pawel Kozlowski 240e0d5c8e docs(CHANGELOG): add v1.3.5 changes 2014-12-01 22:29:36 +01:00
Martin Staffa 9fa73cb4e7 fix(select): use strict compare when removing option from ctrl
Otherwise, if the removed option was the empty option (value ''),
and the currently selected option had a value of 0, the select
would think that the currently selected option had been removed,
causing the unknown option to be added again.

Fixes #9714
Fixes #10115
Closes #10203
2014-12-01 19:54:14 +01:00
Pawel Kozlowski f6458826ac fix($emplateRequest): propagate rejection reason when ignoreRequestError flag is set
Closes #10266
2014-12-01 19:50:13 +01:00
Pawel Kozlowski ab2531143e refactor($templateRequest): simplify filtering out of transform functions
Closes #10264
2014-12-01 19:31:53 +01:00
Shahar Talmi 9a83f9d2fa fix(ngMock): annotate $RootScopeDecorator
Fixes #10273
Closes #10275
Closes #10277
2014-12-01 19:25:43 +01:00
Peter Bacon Darwin 3f07eb227d test($location): fix test of {rewriteLinks:false}
The test for not rewriting links was invalid and just happened to be
passing by chance (false-positive).
2014-12-01 13:39:27 +00:00
Peter Bacon Darwin 446e5669a1 test($location): fix typo 2014-12-01 13:38:47 +00:00
Peter Bacon Darwin b264be40bc revert: fix(Angular.js): toKeyValue is not serializing null values
This commit contained broken tests and was not ready to be merged.

(reverted from commit 814c9847e8)
2014-12-01 12:42:18 +00:00
Josh Kurz 814c9847e8 fix(Angular.js): toKeyValue is not serializing null values
Signed-off-by: Josh Kurz <jkurz25@gmail.com>
2014-11-30 20:35:14 -05:00
Jesse Palmer dde613f18e chore(docs): fix dangling links warning in $http API
Closes #10270
2014-11-30 12:50:41 +01:00
Chris Tanseer e6a2527cdf docs($rootElement): fix minor grammatical errors
Closes #10269
2014-11-29 23:19:32 +01:00
Caitlin Potter d0351c4803 style(ngHref): make jscs happy ;-; 2014-11-28 22:28:39 -06:00
Sagar Ranglani b2b6d74ae5 docs(ngHref): fix poor paragraph construction
It was bad.

In order to improve the docs, the inclusion of the last sentence would help define `ngHref` well.

Closes #10254
2014-11-28 22:09:18 -06:00
Lucas Galfaso 30694c8027 fix(select): fix several issues when moving options between groups
* When an option was moved to a previous group, the group that
loose the option would remove the label from the controller
* When an entire option group was removed, the options in the
group were mot removed from the controller

Closes #10166
2014-11-27 20:40:43 +00:00
Ates Goral 655ac6474b docs(guide/ie): fixed minor typo
Closes #10251
2014-11-27 21:14:01 +01:00
Eric Theise e5a9b265ba docs(tutorial): fix grammar
Should either be "a different version" or "different versions";
this goes with the latter.

Closes #10249
2014-11-27 19:02:31 +01:00
Danny Shekhtman e2b9eccde0 docs(guide): fix typo
Closes #10245
2014-11-27 08:53:05 +01:00
Sugan Krishnan 9b3d9656a6 docs($compile): fix grammar
Closes #10231
2014-11-27 08:52:13 +01:00
Caitlin Potter 1e6a5b29a6 style(*): IE9 does still have issues with apply on some native functions
This partially reverts 8f05ca5552

Related to #10242
2014-11-26 21:51:31 +00:00
Caitlin Potter 8f05ca5552 style(*): IE is a real browser, and chakra is pretty solid
- IE9+ do not have issues with Function.prototype.bind() on builtin fns (asked Brian Terlson)
  (NOTE: there may still be corner cases where builtins will not have `bind()` --- this may
  need to be reverted on complaint).
- HTMLScriptElement#text is an IDL-spec'd attribute, and we use it in all cases --- so the
  comment was sort of nonsense.
- The value of `msie` does not depend on whether the user is using a "real" browser or not.

Closes #10242
2014-11-26 14:36:33 -06:00
Lucas Galfaso 2ec8d1ffc0 fix(linky): encode all double quotes when serializing email addresses
When encoding a URL or an email address, then escape all double quotes

Closes #10090
2014-11-26 21:35:11 +01:00
Shahar Talmi 08cd5c19c7 fix(ngMock): respond did not always take a statusText argument
minor fix so that `respond` can take a `statusText` argument
even when having status 200 by default

Closes #8270
2014-11-26 20:03:23 +01:00
Or Neeman 41dc7d5ebd docs(ngRoute): clarify JSDoc for caseInsensitiveMatch
Closes #10220
2014-11-26 19:05:53 +01:00
Georgios Kalpakas 0caa5ad83f docs(CHANGELOG): remove * component
Closes #10222
2014-11-26 19:04:24 +01:00
Mathew Foscarini 5d36353bc9 docs($compile): fix grammar
Closes #10204
2014-11-25 19:51:33 +01:00
Guillaume Pannatier 719d5c5fa5 fix($httpBackend): allow canceling request with falsy timeoutId
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
2014-11-25 19:17:57 +01:00
Guillaume Pannatier 266da34098 test($httpBackend): use browser.defer mock instead of fakeTimeout 2014-11-25 19:17:01 +01:00
Lucas Galfaso 9474ec120a docs(CHANGELOG): add v1.3.4 changes 2014-11-25 00:05:18 +01:00
Pawel Kozlowski 09a9832358 fix(Angular): properly get node name for svg element wrapper
Fixes #10078
Closes #10172
2014-11-24 22:11:00 +00:00
Jason Bedard bf6a79c348 perf(*): use Object.create instead of creating temporary constructors
Closes #10058
2014-11-23 22:37:08 +00:00
Lucas Galfaso 8ee8ffeba0 fix(linky): encode double quotes when serializing email addresses
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 #8945
Closes #8964
Closes #5946
Closes #10090
Closes #9256
2014-11-23 21:58:18 +00:00
Peter Bacon Darwin 42d09f1772 docs(NgModelController): clarify the value parameter for $isEmpty 2014-11-23 15:24:36 +00:00
Martin Staffa 8692f87a46 fix(input): set ngTrueValue on required checkbox
Fixes #5164
2014-11-23 15:08:39 +00:00
Peter Bacon Darwin 40406e2f22 fix(input[date]): do not use $isEmpty to check the model validity 2014-11-23 15:08:39 +00:00
Peter Bacon Darwin 4644c5840f revert: fix(input): always pass in the model value to ctrl.$isEmpty
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)
2014-11-23 15:08:39 +00:00
thorn0 addb4bdd57 chore(docs): regroup version selector options into major branches and latest
Before this change we grouped by the  discontinued stable/unstable distinction.

Closes #10053
2014-11-23 13:26:33 +00:00
Gonzalo Ruiz de Villa 7496e8e5b7 refactor(*): combine sequence of .push() into one statement
Closes #10192
2014-11-23 09:38:36 +01:00
Dustin e9b9421cdb fix ($http): throw error when string URL is provided 2014-11-22 15:34:55 -08:00
Rado Kirov 7a374691b9 docs(injector): adds a missing backtick and reformat list.
Closes #10189
2014-11-22 14:48:02 -08:00
Shang Heng (Shawn) Wei 3be6835e0f docs($location): add examples for some methods
Closes #9754
2014-11-22 14:16:57 -08:00
shwei a3d79775e1 refactor(ngForm): Remove checking event.preventDefault and calling event.returnValue. Related to issue #4557. Worked with @bullwrinkle on this. 2014-11-22 14:13:12 -08:00
Rado Kirov 920b595080 doc(injector): adds strictDi documentation to appropriate methods.
Closes #9624
2014-11-22 14:01:37 -08:00
Jack Franklin 3109342679 docs(guide/unit-testing): improve unit testing guide
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
2014-11-22 13:47:41 -08:00
Pawel Kozlowski aa01be8b2c test($http): parsing headers with multiple values
Closes #9473

Closes #10176
2014-11-22 22:11:59 +01:00
Brian Ford bb4d3b73a1 fix(ngModelOptions): preserve context of getter/setters
Many thanks to @NevilleS and @jbedard for collaborating with me on a solution to this!

Closes #9394
Closes #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`.
2014-11-22 12:36:12 -08:00
Wesley Cho 6dbd606ad7 fix($locale): Allow currency filter to fall back to maxFrac from locale
- Modify default fallback to `NUMBER_FORMATS.PATTERNS[1].maxFrac`

- Remove unnecessary resetting

Closes #10179
2014-11-22 12:29:06 -08:00
thorn0 764fa869dd fix($browser): allow chaining url() calls in setter mode
Closes #10157
2014-11-22 16:48:54 +01:00
Neville Samuell 7812dfcee8 fix($location): allow empty string URLs to reset path, search, and hash
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.com

Fixes #10063

Closes #10064
2014-11-22 16:30:41 +01:00
Georgios Kalpakas 00b623e86b docs(ngMaxlength): document what happens on negative/non-numeric values
Closes #9998
2014-11-22 16:00:44 +01:00
Georgios Kalpakas 92f87b1142 fix(ngMaxlength): ignore maxlength when not set to a non-negative integer
This makes the behaviour of maxlength/ngMaxlength more inline with the
spec.

Closes #9874
2014-11-22 16:00:44 +01:00
Georgios Kalpakas 5c1fdff691 feat(ngMaxlength): add support for disabling max length limit
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 #9874
Closes #9995
2014-11-22 16:00:43 +01:00
Georgios Kalpakas 891acf4c20 fix($route): fix redirection with optional/eager params
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 #9819

Closes #9827
2014-11-22 15:34:16 +01:00
Georgios Kalpakas 93552fed1c test($route): fix test names 2014-11-22 15:34:16 +01:00
Peter Bacon Darwin b5fbd6a2f6 chore(favicon): provide retina friendly favicon
See https://github.com/angular/angularjs.org/pull/143
2014-11-22 10:54:28 +00:00
Peter Bacon Darwin 5c43b94fc4 chore(i18n): update locale to CLDR v26 2014-11-21 14:42:44 +00:00
Georgios Kalpakas 7dd94b9595 docs(ngAnimate.$animate): fix classes during the various animation phases
Closes #10124
2014-11-21 13:57:35 +00:00
Peter Bacon Darwin 95f8a8bab0 style(ngBind): remove trailing whitespace 2014-11-21 13:51:04 +00:00
Tony Rizko dc5bba8615 docs(ngBindHtml): fix awkward wording
Fixes #10097
Closes #10129
2014-11-21 13:29:16 +00:00
Peter Bacon Darwin 16c8f29ef6 docs(ngShow/ngHide): add spaces to improve readability of CSS
Closes #10101
2014-11-21 11:08:22 +00:00
Pawel Kozlowski d3fb8dd776 docs($filter): clarify what is a valid filter name
Also updates the CHANGELOG to add info about this breaking some
previous invalid uses of $filter

Closes #10054
Closes #10131
2014-11-21 11:04:24 +00:00
Caitlin Potter 95e03bce7e style($http): make jscs happy 2014-11-21 00:26:39 -05:00
Dustin Chilson 5388ca5710 docs($http): describe how to remove a header on a per request basis
Closes #10144
2014-11-21 00:26:17 -05:00
Brian Ford 1b275fb00e chore(scripts): fix 1.2.x tag name 2014-11-20 15:02:34 -08:00
Lucas Galfaso 1c68d00fbf docs(ngAnimate): Fix typo
The ngAnimate makes reference to a function `$animateProvider.classNamePrefix`
that does not exist, the correct function is `$animateProvider.classNameFilter`

Closes #10142
2014-11-20 23:34:37 +01:00
Brian Ford 158241e212 chore(scripts): publish 1.2.x releases to npm with correct tag 2014-11-20 14:31:58 -08:00
AlexChan eab271876c fix(input): call $setTouched in blur asynchronously if necessary
If the model is blurred during an apply it should trigger
$setTouched asynchronously.

Fixes #8762
Fixes #9808
Closes #10014
2014-11-20 23:01:43 +01:00
Peter Bacon Darwin 637d3b47d1 docs($httpProvider): add info about defaults.cache
Closes #10134
2014-11-20 21:25:38 +00:00
Martin Staffa 8ac369e829 docs(ngModelController): update wordings, add more general info
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.
2014-11-20 22:19:02 +01:00
Jeff Cross 5c611e898a docs(CHANGELOG): update changelog with 1.2.27 2014-11-20 10:28:02 -08:00
Peter Bacon Darwin dc9775da96 doc(ngModelController): move example below members 2014-11-19 21:31:56 +00:00
IShotTheSheriff e8941c0fe5 feat(ngModelController): add $setDirty method
- extract existing functionality to public method: $setDirty
- add tests to corresponding changes
- refactor code to use extracted method

Closes #10038
Closes #10049
2014-11-19 20:07:07 +01:00
Toilal bb16759f0b docs(jqLite): clarify that Debug Data must be enabled for scope/isolateScope methods
Closes #9515
Closes #10123
2014-11-19 19:54:15 +01:00
Georgios Kalpakas 2b41a5868a feat(ngPluralize): add support for count to be a one-time expression
Closes #10004
2014-11-18 23:49:24 +01:00
Jamshid Afshar 637c020f82 fix($http): return empty headers, ignore properties in Object prototype
Fix response headers with an empty value Empty response header values are legal
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html).

The headers getter fn will now only return null if the header property is not an own property.

Closes #7779
Closes #10113
Closes #10091
2014-11-18 16:37:38 -05:00
Georgios Kalpakas f7fde935d5 docs($location): fix method-name and typos in ihshprfx error
Closes #10106
2014-11-18 19:05:45 +01:00
Peter Bacon Darwin 5f552896ab chore(docs): update to dgeni-packages 0.10.7
This update to dgeni-packages fixes some trimIndentation issues

Closes #10101
2014-11-18 14:24:22 +00:00
Peter Bacon Darwin d5968c7853 docs(CHANGELOG): add 1.3.3 changes 2014-11-18 08:23:38 +00:00
PatrickJS 4f4ff5f31b fix(NgModelController): typo $rawModelValue -> $$rawModelValue 2014-11-18 08:08:47 +01:00
Martin Staffa e3764e30a3 fix(ngModel): don't run parsers when executing $validate
Previously, $validate would execute the parsers to obtain a
modelValue for validation. This was necessary, because a validator
that is called outside of model / view update (e.g. from an observer)
otherwise might only an undefined modelValue, because a previous
view update has found a validation $error and set the model
to undefined (as is tradition in angular)

This is problematic as validators that are run immediately after
the ngModelController initializes would parse the modelValue
and replace the model, even though there had been no user input.

The solution is to go back to an older design: the ngModelController
will now internally record the $$rawModelValue. This means a model
or view update will store the set / parsed modelValue regardless
of validity, that is, it will never set it to undefined because of
validation errors.

When $validate is called, the $$rawModelValue will passed to the
validators. If the validity has changed, the usual behavior is kept:
if it became invalid, set the model to undefined, if valid,
restore the last available modelValue - the $$rawModelValue.

Additionally, $validate will only update the model when the validity
changed. This is to prevent setting initially invalid models other
than undefined to undefined (see #9063)

Fixes: #9063
Fixes: #9959
Fixes: #9996
Fixes: #10025

Closes: #9890
Closes: #9913
Closes: #9997
Closes: #10048
2014-11-17 20:26:27 +01:00
Martin Staffa c9899c53ac test(ngModel): group validation tests 2014-11-17 20:26:17 +01:00
Jeff Cross 4d4e6036a9 chore(docs): add favicon to docs app 2014-11-17 09:32:21 -08:00
samuel durand 4d885cbd62 docs($anchorScrollProvider): remove repeated word
Closes #10093
2014-11-17 14:44:23 +00:00
Brian Westrich eec2020518 docs(tutorial/step-5): include sort and filter in json view experiment
Closes #10082
2014-11-17 14:33:50 +00:00
Brian Westrich 2901c53f42 docs(tutorial/step-4): "unknown" option is actually blank
The name 'unknown' doesn't appear as a choice, the new choice is just blank.
Side note: once I choose one of the non-blank options, I no longer see the blank option.

Closes #10079
2014-11-17 13:47:47 +00:00
Peter Bacon Darwin e80053d91f fix($rootScope): handle cyclic references in scopes when creating error messages
Use the new private function `stringify` to convert scope values to strings,
since this can cope with cyclic references and other oddities.

Closes #10085
2014-11-17 13:38:04 +00:00
Peter Bacon Darwin fa12c3c86a fix(ngRepeat): support cyclic object references in error messages
Now that `minErr` can cope with objects that cannot be normally stringified
to JSON, just pass the error arguments straight through without trying to
stringify them first.

Closes #9838
Closes #10065
Closes #10085
2014-11-17 13:37:58 +00:00
Peter Bacon Darwin cf43ccdf9b fix(minErr): stringify non-JSON compatible objects in error messages
Fix the JSON stringification to output a more meaningful string when an
object cannot be normally converted to a JSON string, such as when the
object contains cyclic references that would cause `JSON.stringify()`
to throw an error.

Closes #10085
2014-11-17 13:37:52 +00:00
Shahar Talmi a9352c19ce feat($location): allow to location to be changed during $locationChangeStart
Closes #9607
Closes #9678
2014-11-15 23:25:21 +00:00
Jakub Hampl 6f19a6fd33 fix($http): don't parse single space responses as JSON
Closes #9907
2014-11-15 12:43:24 +01:00
Kent C. Dodds f30163e63a docs(nav): highlight current nav-index-listing
Color the current nav-index-listing item dark red
to make it easier to know where you are.

Closes #9970
Closes #9974
2014-11-15 11:30:23 +01:00
Marcy Sutton 5b23bc9b07 docs(ngAria): Add Usage Details and Examples
Closes #10031
2014-11-14 18:08:42 -05:00
Marcy Sutton 9d1e87a3f1 docs(guide/accessibility): Content updates
Also includes new section on ngMessages
2014-11-14 18:06:59 -05:00
Peter Bacon Darwin 6604c23614 fix(select): ensure the label attribute is updated in Internet Explorer
Only changing the `<option>` text value is not enough to trigger a render
change in IE. We need to explicit update the `label` property too.

Closes #9621
Closes #10042
2014-11-14 21:17:28 +00:00
Peter Bacon Darwin 195deca6e2 test(select): refactor option elements expectations to use toEqualOption matcher
By using a new matcher our tests become less brittle with respect to unimportant
extra attributes.
2014-11-14 21:16:42 +00:00
Caitlin Potter 85eb9660ef fix(ngPattern): match behaviour of native HTML pattern attribute
From https://html.spec.whatwg.org/multipage/forms.html#attr-input-pattern

> The compiled pattern regular expression, when matched against a string, must have its start
anchored to the start of the string and its end anchored to the end of the string.

Closes #9881
Closes #9888
2014-11-14 20:18:57 +00:00
David Stensland d81ff8885b fix(ngMock): call $interval callbacks even when invokeApply is false
Make ngMock.$interval behave like ng.$interval

Closes #10032
2014-11-14 11:42:24 -05:00
Caitlin Potter eca14d98a4 chore($q): make jscs happy
jscs loves to be happy and does not love trailing whitespace.
2014-11-14 11:11:39 -05:00
Bernie Telles 22ecbc50f4 docs($q): explain what the $q service does in description
Explain what the $q service does in description, instead of origin document.

The original explanation was less accessible to people new to promises and JS in general.

Closes #10056
2014-11-14 11:09:37 -05:00
Chatchavan Wacharamanotham 7f857e44a2 docs(guide/compiler): replaced 'locals' with 'scope'
In "Understanding How Scopes Work with Transcluded Directives" section, a text referred to an
obsolete 'locals' instead of 'scope'.

Closes #10018
2014-11-14 11:03:24 -05:00
Caitlin Potter be6920b356 test(orderBy): add test cases for ordering array-like objects
Closes #10060
2014-11-14 10:02:23 -05:00
Karol Wypchło 8eabc5463c perf(orderBy): copy array with slice instead of for loop
Use array slice method to copy entire array instead of a for loop
http://jsperf.com/new-array-vs-splice-vs-slice/54

Closes #9942
2014-11-14 09:34:16 -05:00
Anton Savchenko 14ff529fbb refact(angular.bind): use concat() rather than duplicating code
Closes #4200
2014-11-13 13:33:24 +00:00
Jason Bedard fbad280570 refactor($parse): separate tokenizing vs parsing more
Fixes `a.b` and `a .b` generating different getterFns
Fixes `{'': ...}` turning into `{"''": ...}`
Fixes `{.: ...}` parsing as `{'.': ...}` instead of throwing
Fixes #9131
2014-11-12 23:36:23 +01:00
Pawel Kozlowski 8b775a0d58 docs(guide/expressions): clarify regexp literals usage in expressions
Closes #10026

Closes #10030
2014-11-12 22:50:21 +01:00
Pawel Kozlowski 0bbc6ee481 docs($route): fix description of the caseInsensitiveMatch property
Closes #10028
2014-11-12 21:02:24 +01:00
Blaise Kal 381b185117 docs(guide/expressions): replace curly quotes with straight quotes in code example
REAL QUOTES HAVE CURVES

Closes #10017
2014-11-12 13:50:09 -05:00
Henrique Ramos Limas fa0d8c47c3 docs($controller): mention "controller as" syntax
Closes #10011
2014-11-12 08:13:43 +00:00
PatrickJS 7e233eb58a docs($q): missing finally notifyCallback API
finally allows for notifyCallback and is missing in the Docs
https://github.com/angular/angular.js/blob/v1.3.2/src/ng/q.js#L288

Closes #10010
2014-11-12 08:04:56 +00:00
Caitlin Potter b7afd11d26 refactor($parse): don't use bind-once interceptor for non-bind-once expressions
Side-effects:
  - Logic for allOrNothing watches now lives in $interpolate rather than $parse

Credit to @jbedard for idea to remove $watch interceptors craziness from $interpolate. Even though
it technically didn't actually work, it was worth a shot, and helped clean things up a bit. Go team!

Closes #9958
Closes #9961
2014-11-11 20:29:36 -05:00
Georgios Kalpakas 8582088b36 docs($q): remove IE8-specific notice
Closes #10008
2014-11-11 21:03:51 +01:00
Pawel Kozlowski 0db573b749 feat($routeProvider): allow setting caseInsensitiveMatch on the provider
Fixes #6477

Closes #9873
2014-11-11 20:20:16 +01:00
codef0rmer 5e78af769e docs(guide/Index): add book AngularJS UI Development
Matthias and I wrote a book on AngularJS which might be helpful for Angular developers.

Merci~!

Closes #9971
2014-11-11 14:13:28 -05:00
AlexChan 804e75045c docs(ngModel.NgModelController) use $evalAsync instead of $apply for event handling
Have the apply called safely during events by using `$evalAsync` rather than `$apply`
This will help ensure that an apply for a user directive is not called during a digest cycle.

Closes #9891
2014-11-11 13:59:17 -05:00
Dim ebc3b7b1c3 docs(minerr/unpr): fix code example
Closes #10000
2014-11-11 12:35:19 +01:00
Andreas Fischer 830846f664 docs(guide/Modules): missing "a" in "a collection"
Closes #10001
2014-11-11 12:24:30 +01:00
yarsh 0462ee6659 docs(ngModelOptions): minor grammer error
Closes #9928
2014-11-11 10:20:32 +01:00
rsperberg 9cc6835819 docs(guide/Conceptual Overview): change "a" to "an" before "ng-controller"
Closes #9895
2014-11-10 20:41:04 +01:00
inphovore ee1fc1dc13 docs(guide/Bootstrap): batarang link correction
Closes #9869
2014-11-10 19:42:20 +01:00
Nicholas Albion 41b36e689c docs($compile): bindToController clarification
It was not clear that `bindToController` is a boolean.

Closes #9835
2014-11-10 19:19:05 +01:00
Georgios Kalpakas 52545e5a74 docs($browser): minor docs fixes
Remove obsolete `XHR` param from the docs and correct
`$log` param description.

Closes #9810
2014-11-10 19:07:15 +01:00
Justin 2abea7514a docs(select): minor markdown syntax fix
Half the sentence was being highlighted as code.

Closes #9983
2014-11-10 12:05:46 -05:00
Martin Staffa f157d02793 docs(ngModelController): clarify parse errors
Closes #9952
2014-11-09 23:31:27 +01:00
Rouven Weßling 77d8ae1d45 refactor($location) Remove unused variables
These were left around in 736c8fbbae

Closes #9482
2014-11-09 16:18:00 +01:00
Henry Zhu e21b6ff3ff style(*): add rule requireSpacesInConditionalExpression
Closes #9973
2014-11-09 15:51:01 +01:00
Henry Zhu 06016bb12c style(*): add rules requireSpace(After|Before)BinaryOperators 2014-11-09 15:51:01 +01:00
Arjunkumar 50e72fcae1 docs(guide/migration): typo fix
spell check propery to property

Closes #9937
2014-11-08 14:56:39 +01:00
micellius b84e62bd28 docs(CHANGELOG): ohmygosh they're different ohmygoshohmygosh
Align versioning format

Closes #9968
2014-11-08 08:11:51 -05:00
Igor Minar b6fd184a93 docs(CHANGELOG): add a security note to the 1.3.2 log 2014-11-07 17:09:44 -08:00
Caitlin Potter 1db9e617ce docs(CHANGELOG): slight fixup 2014-11-07 14:11:10 -05:00
Caitlin Potter 0918f146e4 docs(CHANGELOG): add v1.3.2 changes 2014-11-07 14:09:32 -05:00
Brian Ford 6dfd938bbc docs(guide/index): link to security 2014-11-07 10:32:10 -08:00
Brian Ford 4f5a60bcca docs($parse): formatting, link to security docs 2014-11-07 10:32:10 -08:00
Brian Ford e593939411 docs(security): add security doc 2014-11-07 10:32:10 -08:00
Martin Staffa 9e305948e4 fix(select): use strict comparison for isSelected with selectAs
Closes #9639
Closes #9949
2014-11-07 13:22:01 -05:00
Lucas Galfaso ed99821e4d fix($parse): stateful interceptors override an undefined expression
When using `$parse` with a stateful interceptor and the expression
is `undefined`, then return the result from the interceptor

NOTE from Igor: this is not the best solution. We need to refactor
this and one-time + $interpolate code to properly fix this. @caitp
is on it. See discussion in the PR.

Closes #9821
Closes #9825
2014-11-07 10:17:32 -08:00
Chirayu Krishnappa e057a9aa39 fix($parse, events): prevent accidental misuse of properties on $event 2014-11-06 19:30:48 -08:00
Chirayu Krishnappa e676d642f5 fix($parse): add quick check for Function constructor in fast path 2014-11-06 19:30:48 -08:00
Lucas Galfaso 288b531626 docs(CHANGELOG): Document breaking change from 23bc92b1
Document the breaking change from 23bc92b1

Closes #9947
2014-11-06 15:27:44 -05:00
rsperberg 7a4df50480 docs(guide/concepts): spell "Angular" with cap "A", fix typos
In these two instances, Angular was spelled with a lower-case "a." All occurrences should be spelled
consistently.

Compound adjectives preceding the noun they modify should generally be hyphenated (cf Chicago Manual
of Style, 6.40), e.g., "so-called directives."

Closes #9896
2014-11-06 14:16:16 -05:00
Adir 6550198003 docs(guide,tutorial): fix outdated Protractor API link
Link to the gh-pages deployment of protractor docs, it's much easier on the eyes.

Closes #9946
2014-11-06 13:57:50 -05:00
Marcy Sutton c6909ed144 docs(guide/accessibility): Add in-depth guide
Closes #9930
2014-11-06 10:17:37 -05:00
Marcy Sutton 187e43185d feat(ngAria): announce ngMessages with aria-live
By including the `ngAria` module, `ngMessages` will automatically include the aria-live
attribute with an assertive voice, allowing validation messages to be spoken throuhg a
screenreader.

Closes #9834
2014-11-05 17:50:18 -05:00
Peter Bacon Darwin 91834bcf37 test($compile): use ngMock.Scope.$countChildScopes() 2014-11-05 20:41:51 +00:00
Dave Longley 841c090755 fix($compile): do not rebind parent bound transclude functions
The `$compile` public API documentation indicates that
a transclude function may be passed as a second parameter, but
it was not clear that this is **not** the same function that is given
to directive link functions as the `transcludeFn` parameter.

We would like to be able to pass in a transclude function the public
linking function that is returned from `$compile` if we wish to, for
example, use lazy compilation inside a directive.

Doing so, however, highlighted two bugs:

* First, the transclude function would get rebound, incorrectly, changing
its scope from its original binding.
* Second, the `containingScope` would not be updated and the wrong
`$parent` would be assigned to the `transcludedScope` resulting in a
memory leak.

This patch fixes both of these issues.

It also converts various private optional positional parameters on `publicLinkFn`
into an `options` parameter, which is an object hash. The new `options`
parameter is documented as part of the public API.

Thanks to @lgalfaso, @tbosch, and @petebacondarwin.

Closes #9413
2014-11-05 20:41:51 +00:00
Kent C. Dodds da960544f1 docs(guide/Running in Production): ng-strict-di
Adding note about Strict DI mode.

Closes #9908
2014-11-05 14:43:13 -05:00
Igor Minar 74981c9f20 feat(ngMock): decorator that adds Scope#$countChildScopes and Scope#$countWatchers
When writing tests it's often useful to check the number of child scopes
or watchers within the current current scope subtree. Common use-case for advanced
directives is to test that the directive is properly cleaning up after itself. These
new methods simplify writing assertions that verify that child scopes were properly
destroyed or that watchers were deregistered.

Closes #9926
Closes #9871
2014-11-05 13:23:19 -05:00
danielmbarlow dc4b06559f docs(tutorial/step_12): added 'see phone-detail change'
This one caught me out for a while because, despite the note underneath, I didn't notice the addition
of <div class="phone-images"> and it's repeater until later.

Closes #9924
2014-11-05 12:13:57 -05:00
danielmbarlow 56138bdd63 docs(tutorial/step_12): small change to overview
The bullet points at the beginning of the article were a little hard to understand because they
didn't follow the grammatical form of the preceding articles. I hope these small modifications make
it a little easier for someone else to read.

Closes #9922
2014-11-05 09:08:56 -05:00
danielmbarlow 0ccc4fcd89 docs(tutorial/step_05): explain need for $httpBackend.flush in tests
There is an excellent explanation for the need for this in the documentation that may be helpful to
tutorial users, so I added a link to it.

Closes #9919
2014-11-05 08:36:37 -05:00
Julie Ralph b7e2b01bb5 chore(ci): update protractor to version 1.4.0 2014-11-04 17:16:19 -08:00
Tobias Gesellchen 0c19482d03 chore(.gitignore): ignore IntelliJ IDEA module files
Ignore IntelliJ IDEA modules files in the git repository

Closes #5273
2014-11-04 12:46:31 -05:00
Tero Parviainen 0f7bcfdf93 docs(guide/scope): describe watch depths
Describe and visualize the three watch strategies: By reference, by collection items, and by value.

Closes #9388
2014-11-03 12:44:16 -08:00
Loring Dodge 9a26ab5870 docs($route): replace comma with "and"
Remove a comma and replace with "and" on line 444

Closes #9889
2014-11-03 20:58:46 +01:00
jbnizet d906ed3100 docs(input): replace dateTimeLocal by datetime-local
Fixes #9856
Closes #9870
2014-11-02 19:58:32 +01:00
Martin Staffa 0b16d10d2d docs(ngValue): clarify the limitations of ngValue and option elements 2014-11-02 19:47:09 +01:00
Martin Staffa e0198c1cda docs(ngModelController): add $name property 2014-11-02 18:43:52 +01:00
Martin Staffa ba731ab850 docs(ngModelController): remove bogus @param fields 2014-11-02 18:43:52 +01:00
Caitlin Potter e69c1806a8 style(routeSpec.js): make jshint happy 2014-11-01 18:11:51 -04:00
cmichal b4770582f8 fix(ngRoute): allow proto inherited properties in route params object
copy route params with angular.copy before using angular.extend which looks only for enumerable own
properties

Closes #8181
Closes #9731
2014-11-01 18:08:24 -04:00
Henry Zhu 2a2fd14c08 docs(guide/Forms): clarify ngModel behavior for validation
Bueno!

Closes #9866
2014-10-31 18:08:22 -04:00
Jeff Cross e4eb382f2d docs(changelog): add release notes for 1.3.1 spectral-lobster 2014-10-31 10:39:14 -07:00
Ryan Smith ed6e91b318 fix($animate): properly handle class resolution when element data is missing
Closes #9636
2014-10-31 12:28:58 -04:00
Julie Ralph 7b7b082125 chore(ci): fix broken sauce connect download url 2014-10-31 09:24:07 -07:00
eltacodeldiablo 3831e45a7d chore(.editorconfig): remove settings for ngLocale after change to scripts 2014-10-31 11:27:35 -04:00
Henry Zhu 018991f8c8 chore(build): exclude generated files in src/ngLocale from jscs check
The robots don't generate super-clean code ._.
2014-10-31 11:27:35 -04:00
Henry Zhu c77f5d1a29 chore(travis): reorder linting tasks to after unit tests 2014-10-31 11:27:34 -04:00
Henry Zhu 030101a43a style(*): add numerous JSCS rules to unify code-styles in the tree
Changes:

  - add rule requireSpaceBeforeBlockStatements (require space before brace when opening block statement)
  - add operators to rule disallowSpaceAfterPrefixUnaryOperators (no space after prefix inc/dec ops)
  - add rule disallowSpaceBeforePostfixUnaryOperators (no space before postfix inc/dec ops)
  - add rule disallowSpacesInsideArrayBrackets (array literals no longer padded with spaces)
  - add rule requireCommaBeforeLineBreak (line can't start with comma token)
  - add rule validateLineBreaks (require LF linebreaks)

Closes #9792
2014-10-31 11:27:16 -04:00
Uri Goldshtein 2a0254e181 docs(guide/index): add link to angular-meteor
Bueno!

Closes #9844
2014-10-30 11:12:54 -04:00
Tim Raymond ce20dd06fe docs(ngValue): replace input[select] with option for clarity
It is impossible to create an `input[select]`, so it appears
the intention here was actually `option`.

Fixes #7994
Closes #8203
2014-10-29 20:40:48 +01:00
Jeff Cross d7a78e420a docs(select): add more notes about ngRepeat and clean up style
Closes #9592
2014-10-29 12:15:39 -07:00
Juan Gabriel Jimenez Campos 4b4098bfca fix(select): assign result of track exp to element value
Fixes a regression where the option/select values would always be set to
the key or index of a value within the corresponding collection. Prior to
some 1.3.0 refactoring, the result of the track expression would be bound
to the value, but this behavior was not documented or explicitly tested. A
cache was added in order to improve performance getting the associated
value for a given track expression.

This commit adds one explicit test for this behavior, and changes several
other trackBy tests to reflect the desired behavior as well.

Closes #9718
Fixes #9592
2014-10-29 11:37:48 -07:00
Ralph Samuel c3b3b90bc9 docs(guide/Scopes): add "the" in front of "DOM" on line 42
Closes #9818
2014-10-29 13:50:57 -04:00
kboutsen 43b1a3739a docs(tutorial/step_4: update test to match new $bindings behaviour
var phoneNameColumn = element.all(by.repeater('phone in phones').column('{{phone.name}}'));
should be
var phoneNameColumn = element.all(by.repeater('phone in phones').column('phone.name'));

Closes #9823
2014-10-29 11:02:04 -04:00
Jeff Cross b4db713cde fix(jenkins): reset baseUrl in protractor conf
Commit 22b817ec11 changed the url
used by protractor in all docs tests to prepend "build/docs", which
was already set to the `baseUrl` in `protractor-jenkins.conf`. This
commit just changes the protractor config's `baseUrl` to adapt
to the changes in the spec files.

Closes #9783
2014-10-28 13:19:25 -07:00
Georgios Kalpakas df3d739654 docs(guide/*): fix typos and links
Fix some typos and link-errors introduced in
https://github.com/angular/angular.js/commit/d1ccf176351cda2b49599374c7d4ba594796012f.

Related to #9786
Closes #9800
2014-10-27 12:32:30 -04:00
ChristianKohler 99ec8d66c5 chore(docs): clarify comment which was copy&paste from dgeni example
It makes people happy, so why not

Closes #9798
2014-10-27 12:23:04 -04:00
Brian Ford d1ccf17635 docs(guide/*): improve explanation of strictDi
Closes #9786
2014-10-27 04:26:43 -07:00
Brian Ford c3fcbbd750 docs(guide/services): use array annotation in example 2014-10-27 02:51:02 -07:00
Brian Ford 29d727210d docs(guide/bootstrap): link to batarang 2014-10-27 02:24:07 -07:00
Christian Liebel 875f8f6557 test(ngSanitize): fix test descriptions
SVG attribute test splitted, descriptions changed accordingly

Related to #9770
Closes #9787
2014-10-25 14:03:26 +02:00
Judy Tuan f34c1ff53f docs(misc/Develop): update required Java version 2014-10-25 13:53:26 +02:00
Peter Bacon Darwin 54ddca537e chore(docs/search): ensure that default search goes to API first
Closes #9736
2014-10-25 09:39:24 +02:00
Kent C. Dodds 2cd5b4ec44 fix($compile): returning null when an optional controller is not found
Currently, `undefined` is returned. However, the desired behavior is to
return `null` when the controller is optional and not found.

(If this breaks your app, it really shouldn't .v.)

Closes #9404
Closes #9392
2014-10-24 15:14:31 -04:00
Kent C. Dodds 4bf254c155 test($compile): add test for optional require in directives with ^ operator
The directive property `require` allows optional requirement via
the `?` before or after the `^` operator. Add tests to ensure this
functionality is not lost inadvertently.

Closes #9391
Closes #9392
2014-10-24 15:14:20 -04:00
Shahar Talmi d0226ebbbf chore(npm): updated some packages so shrinkwrap works with npm@2.x
some packages were using versions that do not match semver@4 semantics and therefore generated
errors when trying to create shrinkwrap with npm@2.x. this shrinkwrap will make it much easier to
update the shrinkmap from now on

Closes #9706
2014-10-24 15:09:03 -04:00
Shahar Talmi 3df9de2e31 chore(npm): add cheerio to npm shrinkwrap
Closes #9706
2014-10-24 15:09:00 -04:00
Shahar Talmi 4d12812bb4 refactor(tests): remove some duplicate conditions
Closes #9706
2014-10-24 15:08:56 -04:00
Shahar Talmi 42f7c80bb6 chore(tests): remove redundant file
Closes #9706
2014-10-24 15:08:43 -04:00
Georgios Kalpakas 7574dd25d9 style(filterSpec): fix white-space and newline inconsistencies
Closes #9765
2014-10-24 14:51:34 -04:00
flezen 3b3d9218e8 docs(tutorial/step_11): it says there are 4 tests, BUT THERE ARE 5!
Bueno!

Closes #9775
2014-10-24 11:17:47 -04:00
Georgios Kalpakas e780eeee27 test(ngSanitize): enhance test regarding the xlink:href attribute
Closes #9770
2014-10-23 21:13:07 -04:00
Georgios Kalpakas 4cccf0f2a8 fix(ngSanitize): attribute name: xmlns:href -> xlink:href
Closes #9769
2014-10-23 21:03:18 -04:00
Christian Liebel a54b25d779 feat(ngSanitize): accept SVG elements and attributes
SVG elements and attributes are now accepted and sanitized by ngSanitize.

Closes #9578
Closes #9751
2014-10-23 16:40:34 -04:00
Caitlin Potter 36666f6fad chore(compileSpec): make jscs happy
Broke because 40bbc98178 landed before d3b1f502e3
2014-10-23 16:29:52 -04:00
Henry Zhu d3b1f502e3 style(*): add rule disallowSpacesInAnonymousFunctionExpression beforeOpeningRoundBrace, including i18n generator 2014-10-23 15:59:26 -04:00
Henry Zhu 94f5a285bf fix(i18n): rename datetimeSymbols to be camelCase 2014-10-23 15:59:25 -04:00
Henry Zhu 7f65f97919 style(*): add rule requireSpacesInFunction beforeOpeningCurlyBrace
This rule enforces a space after the curly brace
for function declarations, anonymous function expressions,
and named function expressions.
2014-10-23 15:59:25 -04:00
Henry Zhu 922162853b style(*): add rule disallowSpacesInFunctionDeclaration beforeOpeningRoundBrace 2014-10-23 15:59:25 -04:00
Henry Zhu 655fccce3a style(*): add disallowSpacesInNamedFunctionExpression beforeOpeningRoundBrace 2014-10-23 15:59:24 -04:00
Gabriel Monteagudo 40bbc98178 feat($compile): allow $watchCollection to be used in bi-directional bindings
an asterisk can be specified in the binding definition to use $watchCollection instead of $watch.
e.g. scope: { prop: '=*' }

Closes #9725
2014-10-23 14:08:55 -04:00
Olivier Louvignes 9ad6c77568 docs($animate): describe how to avoid conflicts with 3rd party CSS frameworks
Closes #8569
Closes #9722
2014-10-23 18:31:14 +02:00
Peter Bacon Darwin cfe7b0e9ef docs(ngShowHide): use local bootstrap CSS 2014-10-23 12:05:05 +02:00
Rouven Weßling 031d4cd2a9 chore($sniffer) remove Opera < 15 vendor prefixes and document it
Closes #9483
2014-10-22 15:38:36 -04:00
alindberg acbd302efb docs(tutorial/tutorial): instructions to install npm on debian
Additional package required for a Debian install

Closes #9749
2014-10-22 14:16:21 -04:00
Rouven Weßling 37790e920d refactor(Angular) use Object.keys instead of manually constructing array
Shrink dat coed ;u

Closes #9704
2014-10-22 14:00:54 -04:00
Pablo Villoslada Puigcerber 531a8de72c fix($observe): check if the attribute is undefined
Check if the attribute is undefined before manually applying the function because if not an
undefined property is added to the scope of the form controller when the input control does not
have a name.

Closes #9707
Closes #9720
2014-10-22 13:45:37 -04:00
Martin Hochel d488a89466 docs($http): document $httpProvider.interceptors in $httpProvider documentation
☆.。.:・゜☆ HASHBANG #NGEUROPE ☆.。.:・゜☆

Fixes #9366
Closes #9728
2014-10-22 11:25:22 -04:00
Nehil Jain 3635721ce4 docs(guide/expressions): add commas to run-on sentences to make them clearer
Closes #9738
2014-10-22 10:49:18 -04:00
Cyril Lakech e9c5be58ab docs(form.FormController): add date parse error tokens to FormController.$error
☆.。.:・゜☆  Closes #9743 ☆.。.:・゜☆
2014-10-22 10:26:24 -04:00
marcin-wosinek 5d7763ebf9 docs($templateCache): clarify inline template
Current doc doesn't state required tag location clear enough. It was
[stack overflow|http://stackoverflow.com/a/16125138] where I've found that requirement

Closes #9741
2014-10-22 10:01:58 -04:00
Jackson Ray Hamilton 0a380b4264 docs(guide/bootstrap): close script tag
Closes #9739
2014-10-22 00:44:53 -04:00
Michal Cieplucha 52ceec2229 fix(templateRequest): allow empty html template
allow empty html template and not throw error

Closes #9581
2014-10-21 06:31:25 -07:00
Jason Bedard 38d12de661 refactor(*): removing unused vars
Close #9710
2014-10-21 14:22:24 +02:00
Dwayne Crooks 89c57a8761 docs(ngModel.NgModelController): remove extra 'to'
Closes #9702
2014-10-20 21:34:04 +01:00
Caitlin Potter 2240c113f5 chore(tests): implement e2e test harness outside of docs app
Included:

- A sample test fixture
- A sample test
- Server middleware to serve the E2E harness
- Convenient test helpers to simplify loading the right fixture

Closes #9557
Closes #9527
2014-10-20 11:26:09 -04:00
Caitlin Potter fc56c9b3cc chore(package.json): add cheerio dependency
It's tinier than jsdom, and seems to work okay for generating the fixtures.
2014-10-20 11:24:35 -04:00
Peter Bacon Darwin 22b817ec11 chore(docs): fix path to docs-app e2e tests
These tests are not generated by dgeni and so needed to have the paths
to the pages updated manually.

Closes #9680
2014-10-20 10:42:34 -04:00
Peter Bacon Darwin 762713e660 chore(docs): configure the base path for protractor tests in examples
Updates to dgeni-packages 0.10.5 which supports this configurability.
Change the dgeni config and protractor config so that we can have protractor
tests that are hosted outside the build/docs folder.

Provides support for https://github.com/angular/angular.js/pull/9557#discussion_r18977324
2014-10-20 10:42:25 -04:00
Peter Bacon Darwin d97b427656 docs(error/$injector/modulerr): add info about not monkey-patching ng
Closes #7709
Closes #9692
2014-10-20 14:20:46 +01:00
Po Chen 303610c743 docs(guide/location): fix a typo
Closes #9693
2014-10-20 13:20:05 +01:00
Bastien Caudan 1025f6ebf4 fix(ngMock): $httpBackend should match data containing Date objects correctly
If a response or expectation contained a date object then `$httpBackend.expect`
was not matching correctly.

This commit encodes then decodes the object being matched to ensure consistency.

Closes #5127
2014-10-20 13:06:44 +01:00
lguyot a7f886e6c8 docs(tutorial/step-11): remove excess words
Closes #9690
2014-10-20 12:11:03 +01:00
Augustas b8f3ad4b21 docs(tutorial/step-7) - correct a url
Closes #9688
2014-10-20 11:43:58 +01:00
Henry Zhu 483ce91da2 style(*): add disallowSpacesInsideParentheses rule to jscs
Closes #9685
2014-10-20 10:39:46 +01:00
Henry Zhu 31ec9f14ef style(*): add validateParameterSeparator rule to jscs
Closes #9685
2014-10-20 10:39:37 +01:00
Henry Zhu 8b921617e9 style(*): add disallowTrailingComma rule for objects and arrays
Closes #9685
2014-10-20 10:39:32 +01:00
Henry Zhu e4ce0ddda5 chore(jscs): alphabetize jscs rules 2014-10-20 10:39:15 +01:00
Peter Bacon Darwin e1c0a8e642 docs(guide/introduction): remove ambiguous "code-behind" jargon
This commit tries to remove the jargon and explain in plain English what
it means to add "code-behind" via a directive.

Closes #9684
2014-10-20 10:32:06 +01:00
Rouven Weßling ba9d0738cd refact(Angular.js) remove unused functions
This removes the functions size() and isLeafNode().

Closes #9682
2014-10-20 10:21:57 +01:00
Peter Bacon Darwin 998c61cbe0 chore(docs): copy the correct docs assets
The docs images had been duplicated in

```
docs/img/
```

and

```
docs/app/assets/img
```

This commit fixes the gulp build to use the doc images from `docs/img` and
removes the duplocates from `docs/app/assets/img`

Closes #9655
2014-10-19 11:56:58 +01:00
Brian Ford 35e2a068ad docs(guide/forms): add animated gifs 2014-10-19 11:25:35 +01:00
Brian Ford 146440c5b2 chore(grunt): do not rewrite gif urls 2014-10-19 11:25:35 +01:00
Dmytro Yarmak bf9e7bfb5a fix($rootScope.$on) check listener existense while deregistering
Check that listener is still present in $$listeners before decrease
$$listenerCount. It fixes problem with incorrect $$listenerCount after
call deregistering function multiple times.

Closes #9666
Closes #9667
2014-10-19 11:21:56 +01:00
Henry Zhu ed3f799b5c style(*): disallow space after object keys, other rules
add `disallowSpaceAfterObjectKeys` and associated changes.
add `disallowMixedSpacesAndTabs` (no files changed)
add `disallowMultipleLineStrings` (no files changed)

Closes #9679
2014-10-19 11:09:16 +01:00
Peter Bacon Darwin b64b9ea02c docs(guide/directive): clarify directive matching example
Closes #9311
2014-10-19 11:02:02 +01:00
Wédney Yuri 7fa66348cb docs(angular.extend): explanation of deep copy.
It is very common to see many developers confused about it.

Closes #9672
2014-10-19 10:54:32 +01:00
Starojitski e5c53b393b docs(tutorial/step-2): add missing span elements
In Lession 1 template has phone names within `span` element, while in
lession 2 the name is directly within the wrapper `div`

Closes #9670
2014-10-19 09:30:19 +01:00
Juan M. Cuello 24d00cce4f docs(error/dupes): Little fix in explanation text.
Little fix in docs/content/error/ngRepeat/dupes.ngdoc.

Closes #9673
2014-10-18 15:38:55 -04:00
Henry Zhu accb22d644 style(*): enforce spaces after keywords, add spaces
Closes #9677
2014-10-18 10:15:40 -04:00
Michał Gołębiowski 1785251eab refactor($sce): don't depend on $document
The $sce dependency on $document was added in 64241a5 because it was thought
it's not possible to easiy use the msie variable in this module. This was
changed in 45252c3, though so it's no longer needed to depend on $document.

Closes #9671
2014-10-18 01:48:37 +02:00
Caitlin Potter fe58238e35 chore(.jshintrc): make jshint happy due to 1bd473e 2014-10-17 18:27:26 -04:00
Caitlin Potter 1bd473eb45 fix($templateRequest): ignore JSON Content-Type header and content
Normally, if there is a Content-Type header with the string "application/json", or else the content
looks sort of JSON-y, $http will attempt to deserialize the JSON into an object. $templateRequest
is intended to request markup, and as such should never attempt to parse JSON, regardless of the
headers or shape of the content.

Closes #5756
Closes #9619
2014-10-17 18:07:35 -04:00
Martin Staffa 9078a6ae37 docs(guide/form): shorten line lengths for better readability 2014-10-17 23:23:45 +02:00
Martin Staffa e9dcec0c5d docs(guide/forms, input): add information how to modify built-in validators
Closes #5757
Closes #7798
2014-10-17 23:23:44 +02:00
Martin Staffa d5457bb83b docs(guide/forms): update custom validation section with $validators 2014-10-17 23:23:41 +02:00
Martin Staffa 036871df5e docs(input): clarify input and ngModel behavior 2014-10-17 23:23:39 +02:00
Martin Staffa c06e12276b docs(guide/forms, ngModel): update list of css classes 2014-10-17 23:23:37 +02:00
Martin Staffa 4aaf47534e docs(ngModel): clarify usage of formatters / parsers and $setValidity 2014-10-17 23:23:36 +02:00
Kim Pettersen 502bb648ff chore($locale): add quotation marks to reserved keyword "short"
Although the "short" keyword was pulled as a reserved word from ES5, compilers like
YUICompressor still treat it as reserved and may break.

See 7.6.1.1 of ES5 spec for updated reserved words: http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262%205th%20edition%20December%202009.pdf

Closes #5320
2014-10-17 14:05:16 -07:00
Shahar Talmi 6cba9c5e7c refactor(ngScenario): remove redundant msie variable 2014-10-17 23:06:55 +03:00
Shahar Talmi 6e5e76e4b1 refactor(Angular): removed redundant test 2014-10-17 22:50:53 +03:00
Shahar Talmi 45252c3a54 fix($sce): use msie instead of $document[0].documentMode
this is important so that people can mock $window without having to add stuff that angular uses internally into it

Closes #9661
2014-10-17 22:35:31 +03:00
Siddhartha c2edef86c5 docs(readme): fixing the &lt; in the benchmarks readme.md page
Closes #9615
2014-10-17 01:01:04 -07:00
Henry Zhu 5b982998c3 chore(jscs) change deprecated rules for jscs todo
Closes #9616
2014-10-17 00:54:19 -07:00
Henry Zhu d7f84e2d7f chore(jscs): update jscs and update deprecated rules
Updated grunt-jscs and deprecated rules:
requireLeftStickedOperators and requireRightStickedOperators.

Fixes #9429
Closes #9616
2014-10-17 00:54:00 -07:00
Joao henriques fddf4bd5fe docs($location) fix $$parse parameter name
Replaced newAbsoluteUrl by url parameter.

Closes #9650
2014-10-17 00:39:06 -07:00
Georgios Kalpakas c2fb4b6986 test($resource): enhance test-case to verify correct behaviour
Previously, the test-case verified that calling `toJson()`, would remove
the `$promise` and `$resolved`, but not that other `$`-prefixed properties
would not be removed.

Closes #9628
2014-10-17 00:30:37 -07:00
Karol Wypchło 8b2f1a47b5 fix(loader): fix double spaces
Fix double spaces in return statement. Double spaces between return and
returned value brake minification process of some minifiers (bug found on JSMin
https://github.com/mrclay/jsmin-php).

Closes #9630
2014-10-17 00:28:48 -07:00
Brian Ford fb1b202f38 docs(guide/forms): improve readability and formatting 2014-10-16 15:17:32 -07:00
Daniel Luz 47e15aa2b4 docs(ngEventDirs): update remarks on behavior
The event directives haven't stopped propagation by default in a long time.
If that behavior is desired, the handler may use the provided `$event` to call:

    $event.stopPropagation();

Closes #9640
2014-10-16 16:44:22 -04:00
Georgios Kalpakas 22da294cbb docs(jqLite): typo: getComputedStyles() -> getComputedStyle() 2014-10-16 20:06:04 +02:00
Michał Gołębiowski 22407a9296 refactor(jqLite): remove a duplicate DOMContentLoaded handler attachment 2014-10-16 12:36:45 +02:00
Andrey Taritsyn fc70a98be4 refactor($compile): simplify regular expressions
Closes #9637
2014-10-15 21:27:11 -07:00
Alex Norton 49d03a5b2e docs(guide/directive): fix typo 2014-10-15 15:05:02 -07:00
Tobias Bosch ed85ec4d70 docs(input): ngModel uses priority 1 2014-10-15 09:18:49 -07:00
Jeremiah Hoyet 6502ab0977 doc(angular.forEach): note difference from ES262's Array.prototype.forEach
Since Angular's forEach is not a strict polyfill, and takes different paths depending on the type
of collection it is dealing with, it does not throw a TypeError when converting the obj with
ToObject(), as this operation does not need to be performed.

This difference is documented nicely here.

Closes #9142
2014-10-14 10:55:31 -04:00
Julie Ralph 02aa4f4b85 fix(testability): escape regex chars in findBindings if using exactMatch
Move the function to escape regexps to Angular.js, fix the link, and use it in
the $$testability service.

Closes #9595
Closes #9600
2014-10-14 10:42:13 +01:00
Ciro Nunes 69bf2f02d0 docs(ngModel): fix anchor text
Closes #9604
2014-10-14 10:12:25 +01:00
Georgios Kalpakas fd375c5d46 chore(CHANGELOG): fix name of jqLiteDocumentLoaded function
The newly added private jqLiteDocumentLoaded function is referred to as
jqDocumentComplete (due to a wrong commit message).

Closes #9610
2014-10-14 09:48:14 +01:00
Afshin Mokhtari b8b63df664 docs(CONTRIBUTING): prototypical -> prototypal
Closes #9608
2014-10-14 09:45:37 +01:00
HeberLZ 28661d1a8c fix($parse): support dirty-checking objects with null prototype
Objects created with `Object.create(null);` do not have a `valueOf` method unless
they supply one themselves. To accomodate these, Object.prototype.valueOf is
used when the type of the value is "object", and the `valueOf` property is not
a function (E.G. it's not in the object at all).

Closes #9568
2014-10-13 23:09:19 -04:00
Michał Gołębiowski 7f4d24c6fa chore(npm): update npm dependencies
Some of previous dependencies versions (e.g. Karma) didn't work with
Node 0.11.14, see:
https://github.com/karma-runner/karma/pull/1182

The only dependencies not updated in this commit are:

1. grunt-jscs-checker: its
rules have changed a lot so it will require more work to use the newer
version
2. gulp-jshint: the update breaks docs linting, it requires investigation

Closes #9571
2014-10-13 15:55:20 -07:00
Jeff Cross 399a7afafe docs(changelog): add release notes for 1.3 2014-10-13 15:27:20 -07:00
spaceribs f277c56837 docs(directive): add an example showing templateUrl functions
Related to #2895
2014-10-13 14:55:17 -07:00
Matias Niemelä 02be700bda feat($animate): introduce the $animate.animate() method 2014-10-13 12:11:52 -07:00
Matias Niemelä e5f4d7b10a feat($animate): allow $animate to pass custom styles into animations
$animate now supports an optional parameter which provides CSS styling
which will be provided into the CSS-based animations as well as any
custom animation functions. Once the animation is complete then the
styles will be applied directly to the element. If no animation is
detected or the `ngAnimate` module is not active then the styles
will be applied immediately.

BREAKING CHANGE: staggering animations that use transitions will now
always block the transition from starting (via `transition: 0s none`)
up until the stagger step kicks in. The former behaviour was that the
block was removed as soon as the pending class was added. This fix
allows for styles to be applied in the pending class without causing
an animation to trigger prematurely.
2014-10-13 12:11:52 -07:00
Jesse Palmer 63ef085b9a docs(ngIf): fixes font color change
The single quote causes the color of the font to change in the example, so I changed the text in the example to account for this.

Closes #9599
2014-10-13 12:05:30 -07:00
Lucas N. Munhoz 0f6aa10413 docs($httpBackend): add module declaration for best understanding
According with the Issue #9537. This module declaration in the test is very important. When I started to test in angular I copy and paste this code to see how it works, and I get this `module undefined error`, and just after read some blog posts I figure out that this line is essential for testing your module. So, for best understanding of begginers this can be very helpful.

Closes #9563
2014-10-13 11:53:56 -07:00
jimmywarting 3345bf8bc7 docs(limitTo): fixed incorrect field type
There is no such thing as [type=integer] only number

Closes #9591
2014-10-13 11:49:22 -07:00
Georgios Kalpakas 8b568d7c38 test(currencyFilter): fix disambiguous locator warning in e2e tests
The e2e tests for the `currencyFilter` issued the following warnings:
> warning: more than one element found for locator by.binding("amount | currency:"USD$"")
This commit removes the warnings by locating the elements by ID and not by
binding.

Closes #9593
2014-10-13 11:48:17 -07:00
Pavel Pomerantsev 520db0ca7e refactor(ngAnimate): remove unused function argument
Closes #9585
2014-10-13 11:47:10 -07:00
Michał Gołębiowski 4a85512174 refactor($browser): more test coverage around history.state manipulation
Check that pushState is not invoked if $browser.url() and $browser.state()
is passed to $browser.url setter.

Also, a minor refactor in $browser.url code and $browser specs.

Refs #9587
2014-10-13 10:46:09 -07:00
alirezamirian 28133cbd2a docs($compile): tiny grammar correction
Closes #9590
2014-10-13 10:07:40 -07:00
Matias Niemelä b747d3bf4b refactor($animate): clean up core $animate code 2014-10-13 09:51:49 -07:00
Matias Niemelä c44fc6d811 refactor($animate): use $animate.$$setClassImmediately to save code 2014-10-13 09:51:44 -07:00
Michał Gołębiowski 1efaf3dc13 fix($browser): account for IE deserializing history.state on each read
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.

Also:
1. Prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.
2. Fix the issue of routes sometimes not firing the URL change in all browsers.

Closes #9587
Fixes #9545
2014-10-13 09:00:54 -07:00
Michał Gołębiowski 393c1c7c20 chore(jqLite): remove leftover attachEvent/detachEvent from tests 2014-10-13 16:44:22 +02:00
Tero Parviainen 874cac825b fix($parse): stabilize one-time literal expressions correctly
Change `oneTimeLiteralWatchDelegate` to use the last value in the
digest cycle to check if the literal value is stable
2014-10-13 10:51:30 +02:00
Omede Firouz 57f804a4ed refactor($interpolate): cleanup switch statement, curlies unnecessary
Closes #9530
2014-10-12 23:49:34 -07:00
Richard a708632c9f docs(guide/unit-testing): use whitespace to improve readability
☆.。.:・゜☆ Merci (◜௰◝) ☆.。.:・゜☆

Closes #9572
2014-10-12 23:02:23 -04:00
Peter Bacon Darwin 353de4f531 chore(docs): apply the anchorScroll offset feature to the docs app
Closes #9360
2014-10-12 17:55:43 +01:00
Peter Bacon Darwin 09c39d2ce6 feat($anchorScroll): support a configurable vertical scroll offset
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes #9368
Closes #2070
Closes #9360
2014-10-12 17:55:43 +01:00
Peter Bacon Darwin 0dd316efea feat(jqLite): add private jqDocumentComplete function
This helper function can be used to execute a callback only after the
document has completed its loading, i.e. after the `load` event fires
or immediately if the page has already loaded and
`document.readyState === 'complete'`.
2014-10-12 17:52:44 +01:00
cwclark b6f4d4b8d4 Added caveat to attr() function of jqLite
attr() does not support functions as parameters.
2014-10-11 09:04:09 -07:00
Rahul Doshi 20685ffe11 feat(currencyFilter): add fractionSize as optional parameter
currencyFilter accepts number of decimals to round off to

Closes #3642
Closes #3461
Closes #3642
Closes #7922
2014-10-10 22:46:25 -07:00
Tobias Bosch 9ba24c54d6 fix($http): allow empty json response
When a response contains an `application/json` header and
the response is empty the response should be left as is.

Fixes #9532
Closes #9562
2014-10-10 13:16:28 -07:00
Georgios Kalpakas 44746332fa chore(CHANGELOG): add an extra new line after each item in the "BREAKING CHANGES" list
This ensures that the next item will appear on a new line and be properly
parsed as new list item (and not as the continuation of the current item),
even if the current item does not end with a newline character.
Currently, it would result is something like this:

    - **item 1**: due to ...
      blah1 blah1 blah1- **item 2**: due to...
      blah2 blah2 blah2

instead of the intended:

    - **item 1**: duo to ...
      ...
    - **item 2**: due to ...
      ...
2014-10-10 19:06:55 +01:00
Justin Walsh 9a2b6efd11 docs(guide/Working With CSS): add doc for ng-isolate-scope 2014-10-10 10:46:28 -07:00
Warlock e83fab9568 docs(angular.extend): merge redundant sentences 2014-10-10 10:37:15 -07:00
Georgios Kalpakas 86a3361353 chore(CHANGELOG): remove duplicate breaking change for 1.3.0-rc.5 2014-10-10 10:33:20 -07:00
Jeff Cross ea1897606f docs(select): clarify policy of track by and select as 2014-10-10 10:24:25 -07:00
Igor Minar d71fb6f271 fix(jqLite): remove native listener when all jqLite listeners were deregistered
This fixes an iOS issue where some events buble only when native listeners are present (see #9509),
but more importantly previously we would pass wrong argument into the `removeEventListenerFn`  which
caused native listeners to be never deregistered. Oops!

Closes #9509
2014-10-10 10:22:10 -07:00
Jeff Cross addfff3c46 fix(select): add basic track by and select as support
Instead of throwing an error when using "track by" and "select as" expressions,
ngOptions will assume that the track by expression is valid, and will use it to
compare values.

Closes #6564
2014-10-10 10:07:18 -07:00
Matthew Miller 6e4955a308 fix($http): don't run transformData on HEAD methods
7b6c1d0 created this issue by using `Content-Type` to
determine when to run `fromJson`.  Because `HEAD` methods do not contain
a body but are supposed to return the `Content-Type` header that would
have been returned if it was a `GET` this functionality fails.

Closes #9528
Closes #9529
2014-10-10 09:54:18 -07:00
Georgios Kalpakas 9db70d3959 test($route): fix typo in test description
Closes #9541
2014-10-10 00:14:52 -07:00
Jeff Cross b90f5e59cf docs(select): make more explicit that track by+select as will throw an error
Closes #9503
2014-10-09 14:33:34 -07:00
Georgios Kalpakas 9e0ab14826 test(ngMock.$httpBackend): add tests for the existence of when shortcut methods
Closes #9322
2014-10-09 14:24:56 -07:00
James Kleeh e499433f60 docs($q): implement the same example for constructor as deferred
The current documentation has a `return` in the middle of nowhere and somewhat complicates the example with unnecessary code. This implements the same code as in the example for the other way of using $q in order to simplify the differences between them.
2014-10-09 14:24:16 -07:00
Peter Bacon Darwin bb390ef525 chore(docs): update to dgeni-packaged 0.10.3
Fixed dangling links to `#animations` fragments

Closes #9367
2014-10-09 22:21:38 +01:00
Lucas Galfaso aa99df9e53 docs(*): fix dangling links
Fix many dangling links
2014-10-09 22:21:38 +01:00
Georgios Kalpakas 257a3f35dc docs($exceptionHandler): add a note about cases when exceptions are not delegated to the
$exceptionHandler

Add a note in $exceptionHandler's documentation about cases when exceptions are not delegated to
the $exceptionHandler, because they are executed outside of the Angular context. Most notable such
cases being the DOM event listeners registered using jqLite's/jQuery's on/bind methods.

Closes #7909
Closes #9318
2014-10-09 14:19:16 -07:00
Georgios Kalpakas 2230fb4c10 test(ngRequired): add some tests for ngRequired
Closes #9316
2014-10-09 14:17:35 -07:00
Shahar Talmi 01f50e1a7b fix(formController): remove scope reference when form is destroyed
Closes #9315
2014-10-09 14:13:27 -07:00
Georgios Kalpakas 9f2ad53084 docs(ngMock.$log): fix typos and links
Closes #9313
2014-10-09 14:09:31 -07:00
Hari Menon c4e21efcb7 docs(tutorial): correct the summary to match the step's content
Closes #9257
2014-10-09 14:08:09 -07:00
Igor Minar 5030707e76 refactor($compile): use createMap shortcut 2014-10-09 13:57:00 -07:00
J. Michael Palermo IV 3f6b380bde docs(ngCsp): Universal Windows Apps added
It is necessary for this directive to be enabled when developing Universal Windows Apps written in JavaScript using Angular

Closes #9420
2014-10-09 13:56:20 -07:00
Chris Inch 12ca1e38f9 docs(guide/compiler): add title to the page 2014-10-09 13:52:20 -07:00
skwakman 7b9fddfe77 docs($compile): further clarify terminal parameter
Clarifies that the terminal parameter will also exclude execution of any directives and expressions in the directive's own template.
2014-10-09 13:42:06 -07:00
Ciro Nunes a3f44ed1f0 docs(ngAria): correct wording and add resource 2014-10-09 13:00:45 -07:00
Jason Bedard b0307a33eb refactor($parse): remove dead code
Closes #9489
2014-10-09 12:59:10 -07:00
Artem Chivchalov 40d4bb5863 docs(ngRepeat): fix wrong paragraph order
These paragraphes are related to `track by`, not to `as alias`.

Closes #9226
2014-10-09 12:40:31 -07:00
Shahar Talmi 9c9959059e fix($browser): do not decode cookies that do not appear encoded
Closes #9211
Closes #9225
2014-10-09 12:34:50 -07:00
Lucas Galfaso 2691668876 docs(migration): Removed link to nonexisting reference
Removed a link to a reference that is absent

closes #9519
2014-10-09 12:28:00 -07:00
Justin Walsh ec88017944 docs($compile): add 'templateNamespace' to example
Closes #9522
2014-10-09 12:25:26 -07:00
Peter Coles da072d49a0 docs($event): clarify $event is jQuery.Event
The docs should state that an `$event` object is an instance of a jQuery.Event object. Whenever objects are passed around in a framework it's really helpful for the docs to state what’s inside the objects and how to expect them to be populated/work. I had to mess around in my console and with code to figure out what the `$event` object was.

Closes #9102
2014-10-09 12:19:40 -07:00
Warlock 4568bc037d docs: update angular.extend() documentation
How to preserve original objects similar to jQuery.extend().

Closes #9087
2014-10-09 12:11:16 -07:00
Igor Minar e07ebded23 docs($http): use .get and .post shortcut methods in examples 2014-10-09 12:00:34 -07:00
Guilherme de Souza 1f650bae4b docs(\$http): add POST request example
Closes #9046
2014-10-09 12:00:33 -07:00
Georgios Kalpakas d1eec47cb8 refactor($location): remove redundant spaces 2014-10-09 11:59:45 -07:00
Georgios Kalpakas a4db4e6187 docs($location): fix description for rewriteLinks 2014-10-09 11:59:45 -07:00
bolasblack aa1c23a2bf docs(versions): remove the trailing slash in URLs when switch versions
Because `https://docs.angularjs.org/api/` can handler the trailing slash,
but `https://code.angularjs.org/1.2.24/docs/api` can not.

Fix #9043
Closes #9045
2014-10-09 11:52:45 -07:00
thorn0 58e8c02c14 docs(angular.injector): correct return type 2014-10-09 11:49:16 -07:00
Michał Gołębiowski 64241a57e2 chore($sniffer): Remove $sniffer.msie & $sniffer.msieDocumentMode
Since msie is now set to document.documentMode, it's not necessary to keep
the documentMode in a separate property.

Also, msie is a variable global to Angular source so there's no need to
replicate it in $sniffer.

Closes gh-9496
2014-10-09 10:56:15 -07:00
Shahar Talmi 2435e2b8f8 fix(select): manage select controller options correctly
This fixes a regression that was introduced in 2bcd02d. Basically, the problem was that render() removed the wrong option from the select controller since it assumed that the option that was removed has the same label as the excessive option in existingOptions, but this is only correct if the option was popped from the end of the array. We now remember for each label whether it was added or removed (or removed at some point and then added at a different point) and report to the select controller only about options that were actually removed or added, ignoring any options that just moved.

Closes #9418
2014-10-09 09:40:56 -07:00
Caitlin Potter 944408edf8 chore(injectorSpec.js): make jshint happy
...oops ._.
2014-10-09 08:40:25 -04:00
Caitlin Potter 372fa6993b fix($injector): ensure $get method invoked with provider context
0d3b69a5f2 broke this by calling $get with an undefined
context, which in strict mode would be undefined. This fixes this by ensuring that the
provider is used as the context, as it was originally.

Closes #9511
Closes #9512
2014-10-09 08:04:18 -04:00
Jakub Zych 7b102323e9 style(filters) use consistent quote style and strict equality
before change quotes where mixed and one if contained equality operator instead of identity

Closes #9349
2014-10-09 07:10:43 -04:00
bullgare c7a9009e14 fix($location): use clone of passed search() object
Fixes bug when $location.search() is not returning search part of current url.

Previously, the location's internal search object could be set by passing an object to the search()
method. Subsequent changes to the passed search object would be exposed when requesting the search
object, but those changes would not appear in the composed url.

Now, the object is cloned, so the result of location.search() should match the contents of
location.absUrl(), provided the object returned from location.search() is not changed.

Closes #9445
2014-10-09 05:32:42 -04:00
Peter Bacon Darwin e15d2fd472 refact($anchorScroll): use Array.some for better performance 2014-10-09 07:24:20 +01:00
Jeff Cross daf37375d3 docs(select): fix formatting of and placement of selectAs/trackAs explanation 2014-10-08 16:39:23 -07:00
Brian Ford e6ece7d993 docs(changelog): more release notes for 1.3.0-rc.5 2014-10-08 15:51:30 -07:00
Shahar Talmi 0563a0a636 refactor(formController): remove redundant methods from nullFormCtrl 2014-10-08 15:35:55 -07:00
Tobias Bosch f4ff11b01e feat($route): ability to cancel $routeChangeStart event
Calling `preventDefault()` on a `$routeChangeStart` event will
prevent the route change and also call `preventDefault` on the `$locationChangeStart` event, which prevents the location change as well.

BREAKING CHANGE:

Order of events has changed.
Previously: `$locationChangeStart` -> `$locationChangeSuccess`
  -> `$routeChangeStart` -> `$routeChangeSuccess`

Now: `$locationChangeStart` -> `$routeChangeStart`
  -> `$locationChangeSuccess` ->  -> `$routeChangeSuccess`

Fixes #5581
Closes #5714
Closes #9502
2014-10-08 15:35:04 -07:00
Caitlin Potter 0d3b69a5f2 fix($injector): throw when factory $get method does not return a value
BREAKING CHANGE:

Previously, not returning a value would fail silently, and an application trying to inject the
value owuld inject an undefined value, quite possibly leading to a TypeError. Now, the application
will fail entirely, and a reason will be given.

Closes #4575
Closes #9210
2014-10-08 16:49:38 -04:00
Matias Niemelä 39d0b36826 fix($animate): ensure hidden elements with ngShow/ngHide stay hidden during animations
Prior to this fix if an element that contained ng-show or ng-hide was in its hidden state
then any other animation run on the same element would cause the animation to appear despite
the element itself already being hidden. This patch ensures that NO animations are visible
even if the element is set as hidden.

Closes #9103
Closes #9493
2014-10-08 13:48:25 -07:00
Matias Niemelä 035ffb82c4 chore($animate): enable temporary classes to be applied during an animation
Closes #9493
2014-10-08 13:48:12 -07:00
Igor Minar d5445c601f fix($anchorScroll): don't scroll to top when initializing and location hash is empty
Closes #8848
Closes #9393
2014-10-08 13:40:46 -07:00
Matias Niemelä df1a00b11a fix($animate): permit class-based animations for leave operations if ngAnimateChildren is enabled
Prior to this fix, $animate.leave placed a disabled animation on the element
which prevented ngAnimateChildren from properly working. This patch now
addresses that issue.

Closes #8092
Closes #9491
2014-10-08 13:37:54 -07:00
Brian Ford d9ff4e42ce docs(changelog): release notes for 1.3.0-rc.5 2014-10-08 13:37:01 -07:00
Sean Griffin b3e09be589 feat($location): allow automatic rewriting of links to be disabled
Currently, when the location provider is set to html5 mode, all links
on the page are hijacked and automatically rewritten. While this may be
desirable behavior in some cases (such as using ngRoute), not all cases
where html5 mode are enabled imply the desire for this behavior.

One example would be an application using the
[ui-router](https://github.com/angular-ui/ui-router) library, with some
pages that exist outside of angular. Links that are meant to go through
the router use the `ui-sref` directive, so the rewrite behavior is
unnecessary.

Closes #5487
2014-10-08 13:11:52 -07:00
Caitlin Potter 0c2378de79 refactor(ngAnimate): remove unneeded comparison
It was supposed to be removed in 22358cf9c7, but was not.
2014-10-08 16:05:13 -04:00
Jeff Cross 30996f82af fix(select): throw for selectAs and trackBy
trackBy and selectAs have never worked together, and are fundamentally
incompatible since model changes cannot deterministically be
reflected back to the view. This change throws an error to help
developers better understand this scenario.
2014-10-08 12:46:26 -07:00
Tobias Bosch aad60953ce refactor(select): reduce duplication and reorder functions 2014-10-08 12:27:15 -07:00
Jeff Cross ab354cf04e fix(select): make ngOptions support selectAs and trackBy together
This commit implements two functions, "isSelected()" and "getViewValue()"
to properly compute an option's selected state and the model controller's
viewValue respectively. These functions give proper precedence to "track by"
and "select as" parts of the ngOptions comprehension expression, which were
previously inconsistent and incompatible.

Fixes #6564
2014-10-08 12:27:15 -07:00
Caitlin Potter 208114c2b2 chore(AngularPublic): remove $$hasClass from angular exports
It was previously used for ngAnimate, but is no longer needed
2014-10-08 14:56:50 -04:00
Caitlin Potter 22358cf9c7 perf($animate): access DOM less in resolveElementClasses
Previously we were reading DOM attributes frequently, now we can do it just once.
2014-10-08 14:56:49 -04:00
Caitlin Potter 003c44ecee perf($animate): don't join classes before it's necessary in resolveElementClasses
In ngAnimate, we can't do this because the behaviour is exposed via the API. But
in core, we can avoid a bit of work.
2014-10-08 14:56:49 -04:00
Caitlin Potter 9e4701a5ab chore(ngAnimate): add TODO messages indicating desire to remove hack 2014-10-08 14:56:49 -04:00
Caitlin Potter cae01f4941 refactor($compile): use labaled variables to represent nodeType values
This also does some cleanup in $animate
2014-10-08 14:56:49 -04:00
Caitlin Potter 667183a8c7 fix(ngAnimate): defer DOM operations for changing classes to postDigest
When ngAnimate is used, it will defer changes to classes until postDigest. Previously,
AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM
operations.

Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a
digest, class manipulation is deferred. This helps reduce jank in browsers such as
IE11.

BREAKING CHANGE:

The $animate class API will always defer changes until the end of the next digest. This allows ngAnimate
to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than
many. This prevents jank in browsers such as IE, and is generally a good thing.

If you're finding that your classes are not being immediately applied, be sure to invoke $digest().

Closes #8234
Closes #9263
2014-10-08 14:56:49 -04:00
Caitlin Potter 35049be9d9 test(matchers.js): make toHaveClass matcher work better for SVG+jQuery 2014-10-08 14:56:49 -04:00
Izhaki 323862ff63 docs($compile): note template is ignored with element transclusion 2014-10-08 11:27:45 -07:00
Michał Gołębiowski e63f670ff2 docs(content): update Angular 1.2 mentions to Angular 1.3
Angular 1.3 docs now describe the process of using this version instead of
the older 1.2 that is the latest stable version.

Also, update jQuery 1.10.x mentions to 2.1.x.
2014-10-08 10:59:54 -07:00
Jesse Palmer 6b786dcb57 docs(ngIf): update out-of-date link 2014-10-08 10:42:41 -07:00
Michał Gołębiowski 1beebee968 chore($sniffer): Remove $sniffer.hashchange
The hashchange event is not supported only in ancient browsers like Android<2.2
and IE<8. Angular never really supported IE7 and in 1.3 where support for IE8
is dropped it makes even less sense to check for hashchange support.
2014-10-08 17:36:44 +02:00
Caitlin Potter 74a214c043 chore(ngScenario): make jshint happy
Someone accidentally removed an important keyword which prevented a variable from being added to the global object

Closes #9484
2014-10-07 22:54:44 -04:00
Matias Niemelä c93924ed27 fix($animate): ensure that class-based animations only consider the most recent DOM operations
Prior to this fix $animate would maintain a count of each time a class was
added and removed within $animate. With this fix, $animate instead only cares
about the most recent addClass or removeClass operation and will only perform
that operation (depending on what was last called).

```
// before
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +2
removeClass => +1
// this will cause an addClass animation

// now
addClass    => add
removeClass => remove
addClass    => add
addClass    => add
removeClass => remove
// this will cause a removeClass animation
```

Closes #8946
Closes #9458
2014-10-07 16:21:56 -07:00
Igor Minar a84480affb refactor: use document.documentMode to determine msie version
Closes #9398
2014-10-07 16:09:50 -07:00
Michał Gołębiowski 6fd36deed9 feat($location): add support for History API state handling
Adds $location state method allowing to get/set a History API state via
pushState & replaceState methods.

Note that:
- Angular treats states undefined and null as the same; trying to change
one to the other without touching the URL won't do anything. This is necessary
to prevent infinite digest loops when setting the URL to itself in IE<10 in
the HTML5 hash fallback mode.
- The state() method is not compatible with browsers not supporting
the HTML5 History API, e.g. IE 9 or Android < 4.0.

Closes #9027
2014-10-07 15:48:10 -07:00
Tobias Bosch 8ee1ba4b94 fix($browser): Cache location.href only during page reload phase
Adds caching for url changes while a reload is happening,
as browsers do not allow to read out the new location the browser
is navigating to.

Removes unnecessary caching from $browser, as IE7-IE9 all
have the new hash value in `location.href` after changing it.
There was a wrong assumption in the previous version of this code
introduced by dca23173e2 and d70711481e.

Adds more tests for #6976
Fixes #9235
Closes #9455
2014-10-07 11:20:33 -07:00
Ben Harold ab240196bf docs($injector): fix syntax error
There was a missing parenthesis in $injector test example

Closes #9469
2014-10-07 13:39:09 -04:00
Matias Niemelä 613d0a3212 fix($animate): abort class-based animations if the element is removed during digest
Prior to this fix, if the element is removed before the digest kicks off then it leads
to an error when a class based animation is run. This fix ensures that the animation will
not run at all if the element does not have a parent element.

Closes #8796
2014-10-07 11:03:16 +03:00
Matias Niemelä cb85cbcec1 fix($animate): clear the GCS cache even when no animation is detected
$animate will cache subsequent calls to GCS in the event that the element
with the same CSS classes and the same parentNode is being animated. Once the
animation is started then $animate waits for one rAF before flushing the GCS
lookup cache. Prior to this fix, if GCS was unable to detect any transitions
or keyframes on the element then it would simply close the animation, but it
would not trigger the rAF code to flush the cache. This issue caused a bug
which made it difficult to detect why certain animations are not allowed to
fire if the element didn't contain any CSS-based animations beforehand.

Closes #8813
2014-10-07 09:32:29 +03:00
Lucas Galfaso a75546afdf fix($compile): Handle the removal of an interpolated attribute
Handle the removal of an interpolated attribute before the
attribute interpolating directive is linked

Closes #9236
Closes #9240
2014-10-06 22:22:49 -07:00
Lucas Galfaso e843ae7a4c chore(IE8): remove all special code for IE8
Remove all code that was IE8 specific

Closes #8837
2014-10-06 17:04:09 -07:00
Rouven Weßling 40d8da80ce refactor($http) Use onload/onerror/onabort instead of onreadystatechange
Closes #9329
2014-10-06 17:01:42 -07:00
Rouven Weßling f52203ce71 refactor($http) Simplify code by removing workarounds for older versions of Internet Explorer
This removes a workaround for IE 8 and and error handling for IE6.

Closes #9300
2014-10-06 16:33:19 -07:00
Casey Garland d9457aa288 docs(guide/index): fix broken link 2014-10-06 16:01:49 -07:00
Jesse Palmer 46db47bb37 chore(publish.sh): fix url in script console output 2014-10-06 15:52:40 -07:00
thorn0 0e4390c923 docs($injector): injectors aren't functions
Closes #9453
2014-10-06 18:19:23 -04:00
thorn0 c6d76d1e2e docs($injector): clean up docs for $injector#has
Fixup return type and param info.

Closes #9452
2014-10-06 16:52:39 -04:00
tommyangelo da366f7e92 docs(ngBindHtml): explain that angular-sanitize.js is needed to depend on ngSanitize
Added comment. You need to include angular-sanitize.js otherwise you cant use ngSanitize!

Closes #9400
2014-10-06 16:47:32 -04:00
Agam Rafaeli 3ad774b01c docs(guide/introduction): guice has moved to github
Closes #9416
2014-10-06 16:31:11 -04:00
Jesse Palmer 7911c3cfe7 docs(ngIf): wrap ngIf in code tags
Closes #9435
2014-10-06 16:10:12 -04:00
erikrahm 2cb0b309cb docs(misc/faq): grammatical error fixes
Merci beaucoup

Closes #9451
Closes #9450
2014-10-06 16:05:41 -04:00
thorn0 8ef69d2d7a docs($injector): $injector isn't a function
Closes #9448
2014-10-06 20:21:12 +01:00
Tim Kendrick 687981913c chore(docs): remove unused gruntUtils import from docs config
As of commit 11c5bb7, the gruntUtils import is no longer needed in the
gitData docs config service.

Closes #9446
2014-10-06 20:19:15 +01:00
Bijan Boustani 806ef998be docs(guide/introduction): fix grammar style
Changed "you would currently have to write" to "you would otherwise have to write".

Seems to make more sense this way since "currently" presupposes that someone new
to Angular would be coming from a different paradigm, which they may or may not be.

Closes #9428
2014-10-06 20:10:08 +01:00
Brian Ford a21d49c900 chore(npm): publish artifacts to npm
Closes #2877
2014-10-06 11:39:03 -07:00
Peter Bacon Darwin 43d4fffdbe chore(docs): update to dgeni 0.4.1 and dgeni-packages 0.10.1
Adds a new processor to identify dangling links
2014-10-06 16:55:52 +01:00
Pete Bacon Darwin 409ad62042 docs(CHANGELOG): remove reverted commit from 1.2.26
See https://github.com/angular/angular.js/pull/9079#issuecomment-57954483
2014-10-06 16:38:01 +01:00
Tobias Bosch 7cb01a80be fix($browser): don’t use history api when only the hash changes
Fixes a failing test on IE9 caused as a side effect
of 404b95fe30 being merged
before 0656484d3e.

The test should have been independent on the browser running it
and it is now.

Closes #9423
Closes #9424
2014-10-03 21:47:05 -07:00
Caitlin Potter feba0174db fix($compile): remove comment nodes from templates before asserting single root node
The compiler will no longer throw if a directive template contains comment nodes in addition to a
single root node. If a template contains less than 2 nodes, the nodes are unaltered.

BREAKING CHANGE:

If a template contains directives within comment nodes, and there is more than a single node in the
template, those comment nodes are removed. The impact of this breaking change is expected to be
quite low.

Closes #9212
Closes #9215
2014-10-03 21:41:13 -04:00
Igor Minar 7b6c1d08ac fix($http): honor application/json response header and parse json primitives
When server responds with Content-Type header set to application/json we now properly parse the response as JSON

Closes #2973
2014-10-03 16:25:11 -07:00
Tobias Bosch 858360b680 fix($browser): don’t use history api when only the hash changes
Fix jshint error
2014-10-03 16:23:25 -07:00
Shahar Talmi f7174169f4 fix(select): use $viewValue instead of $modelValue
Closes #8929
2014-10-03 16:12:52 -07:00
Tobias Bosch 0656484d3e fix($browser): don’t use history api when only the hash changes
IE10/11 have the following problem: When changing the url hash
via `history.pushState()` and then reverting the hash via direct
changes to `location.href` (or via a link) does not fire a
`hashchange` nor `popstate` event.

This commit changes the default behavior as follows:
Uses `location.href`/`location.replace` if the new url differs from
the previous url only in the hash fragment or the browser
does not support history API.
Use `history.pushState`/ `history.replaceState` otherwise.

Fixes #9143
Closes #9406
2014-10-03 16:04:51 -07:00
Tobias Bosch f3539f3cb5 fix($compile): use the correct namespace for transcluded svg elements
This fixes the case when a directive that uses `templateUrl`
is used somewhere in the children
of a transcluding directive like `ng-repeat`.

Fixes #9344
Related to #8808
Closes #9415
2014-10-03 15:58:06 -07:00
Chris Chua 404b95fe30 fix($browser): handle async href on url change in <=IE9
Closes #9235
2014-10-03 15:33:09 -07:00
Marcy Sutton d277641eec docs(guide/accessibility): Update documentation 2014-10-03 14:05:10 -07:00
Dominic Watson e7cf04bad3 docs(angular.element): css() method does not retrieve computed styles
The jQuery css() getter functionality utilises getComputedStyle() whereas
jqLite only retrieves what is declared inline on an element.

Closes #7599
2014-10-03 11:57:56 +01:00
Peter Bacon Darwin 607f016a0b fix(orderBy): sort by identity if no predicate is given
Closes #5847
Closes #4579
Closes #9403
2014-10-03 09:11:18 +01:00
Jeff Cross f2942447c1 chore(release): create script to undo a release for given number 2014-10-02 15:08:20 -07:00
Pawel Kozlowski b8c5b87119 fix($location): allow 0 in path() and hash() 2014-10-02 21:09:25 +01:00
jimmywarting 074a146d8b perf(ngBind): set textContent rather than using element.text()
"Speeds up chrome with ~10% firefox by ~5%"

We don't really see this result in benchmarks (https://www.dropbox.com/s/76wxqbvduade52s/big_table_benchmark_b1ee5396_vs_d580a954.zip?dl=0)
However, it's basically harmless.

Side effects:

Use strict equality check for `undefined` to replace with empty string. Most target browsers will output `undefined` rather than the empty
string if we don't do this. Previously, ngBindTemplate did not perform this check. However the change has been made to make behaviour
consistent across all target browsers (chrome does output the empty string).

Closes #9369
Closes #9396
2014-10-02 14:38:40 -04:00
Artem Tyurin 86c7d1221c fix(form): fix submit prevention
Do not prevent submit when action
attribute equals to an empty string.

Closes #3370
Closes #3776
2014-10-02 10:28:16 -07:00
Jeff Cross 8da08a1ebd docs(CHANGELOG.md): update 1.2.26 release name 2014-10-02 09:45:36 -07:00
Kent C. Dodds f7b2d85a2c test($compile): add test for alternative syntax to get controllers from ancestors
Because the regex that tests the `require` value will match more than just `^^?`,
it is important to test other common ways to specify a controller requirement
to ensure that a breaking change isn't introduced inadvertently. This adds a test
for `?^^`.

Closes #9389
Closes #9390
2014-10-02 11:51:43 -04:00
Peter Bacon Darwin 391d8c04da docs($compile): improve transclusion documentation
Closes #9352
2014-10-02 15:03:30 +01:00
Peter Bacon Darwin 11c76369aa docs(guide/accessibility): add sortOrder to get it in the right position in the guide 2014-10-02 13:13:32 +01:00
Jeff Cross dc5130c611 chore(docs): rearrange docs app search elements so close button is not first tab index 2014-10-01 23:05:36 -07:00
Jeff Cross 84912134d5 docs(changelog.md): update changelog for 1.3.0-rc.4 and 1.2.26 2014-10-01 21:24:01 -07:00
Peter Bacon Darwin 59cb9e8a77 chore(docs): show error 404 without partial failing
We can move the test back into the main describe as it no longer causes an
error message to be logged
2014-10-01 21:09:48 -07:00
Tobias Bosch 10644432ca fix(input): register builtin parsers/formatters before anyone else
Previously, builtin parsers/formatters for e.g. `input[date]`
or `input[number]` were added in the post linking phase to `ngModelController`,
which in most cases was after a custom formatter/parser was registered.

This commit registers builtin parsers/formatters already
in the pre linking phase. With that builtin
parsers run first, and builtin formatters run last.

Closes #9218
Closes #9358
2014-10-01 17:37:40 -07:00
Tobias Bosch a0bfdd0d60 fix(input): correctly handle invalid model values for input[date/time/…]
Similar to `input[number]` Angular will throw if the model value
for a `input[date]` is not a `Date` object.
For `Invalid Date`s (dates whose `getTime()` is `NaN`) `input[date]`
will render an empty string.

Closes #8949
Closes #9375
2014-10-01 16:12:05 -07:00
Igor Minar 3624e3800f fix(ngView): use animation promises ensure that only one leave animation occurs at a time
the tracking depended on a local flag variable, which was susceptible to corruption due to
race conditions.

using promises ensures that the previousLeaveAnimation is nulled out only if it hasn't been
canceled yet.

Closes #9355
Closes #7606
Closes #9374
2014-10-01 15:19:29 -07:00
Jason Bedard b1ee5386d5 perf(ngForm,ngModel): move initial addClass to the compile phase
Closes #8268
2014-09-30 21:45:41 -07:00
ltrillaud ab80cd9066 fix(compile): sanitize srcset attribute
Applies similar sanitization as is applie to img[src] to img[srcset],
while adapting to the different semantics and syntax of srcset.
2014-09-30 16:32:58 -07:00
Maxi Ferreira 8199f4dbde docs(guide/forms): improve example
When explaining ng-model-options, there's no print of `user.data` to show
the difference between the default behaviour and updateOn: 'blur'
2014-09-30 14:46:22 -07:00
Brian Feister 313d7956e4 docs(minerr/unpr): note that ctrls cant depend on other ctrls 2014-09-30 14:36:08 -07:00
Tobias Bosch b9479ee73b chore(ngCsp): add e2e tests
Also changes `connect:devserver` and `connect:testserver` to conditionally serve files with csp headers when the path contains `.csp` somewhere.

Closes #9136
Closes #9059
2014-09-30 14:10:19 -07:00
active-low 769a00dc86 docs(guide/concepts): improve readability 2014-09-30 12:56:45 -07:00
Adam Humphrey 6593c2371e docs(readme): fix formatting 2014-09-30 12:35:44 -07:00
thorn0 8b54524c07 docs($compile): fix a broken link 2014-09-30 12:33:01 -07:00
Justin Walsh 66bb5aa41c docs(guide/compiler): change span to block element in draggable example
The draggable example does not work as expected in Chrome (37.0.2062.124 m).
The span disappears when dragged beyond what appears to be a small area.
Changing the span to a block element (with a width of 65px) resolves this issue.
An alternative solution would be to change the span to a div.
2014-09-30 12:29:18 -07:00
thorn0 b186709003 docs($compile): add header to example 2014-09-30 11:40:48 -07:00
Caitlin Potter a27d827c22 fix($compile): get $$observe listeners array as own property
Prevent accidentally treating a builtin function from Object.prototype as the binding object, and thus
preventing the compiler from throwing when using attribute binding names which match a property of the
Object prototype.

Closes #9343
Closes #9345
2014-09-30 13:05:09 -04:00
Caitlin Potter a1648a76c0 docs(CHANGELOG.md): put <base> in codeblock
Prevent the tag from being processed (and not rendered). Thanks @davidlehn.

Closes #9331
2014-09-29 17:16:11 -04:00
Brian Ford 2bcd02dc1a fix(select): make ctrl.hasOption method consistent
Prior to this fix, options added to a select by ngOptions would not cause
`selectCtrl.hasOption` to return `true`

Closes #8761
2014-09-29 13:58:03 -07:00
Peter Bacon Darwin b0033a44bd chore(npm-shrinkwrap): update to dgeni-packages 0.10.0 2014-09-29 21:56:22 +01:00
Julie Ralph 76b755f3cb chore(e2e): bump protractor to version 1.3.1 2014-09-29 10:15:49 -07:00
Lucas Galfaso 6303c3dcf6 fix($compile): Resolve leak with asynchronous compilation
Stop an asynchronous compilation when this is performed on an
already destroyed scope

Closes #9199
Closes #9079
Closes #8504
Closes #9197
2014-09-29 12:47:21 +01:00
Lucas Galfaso cd2cfafcab refactor($scope): prevent multiple calls to listener on $destroy
Prevent isolated scopes from having listeners that get called
multiple times when on `$destroy`
2014-09-29 12:41:36 +01:00
Richard Littauer 86d33c5f9d docs(CONTRIBUTING.md): Added a not about type
It's important that we let people use the GitHub editing interface without being 100% strict about how to name the commit changes. Otherwise, it is basically a barrier to entry and highly discouraging for new people who may just be trying to fix a spelling error. Since it is possible for contributors to edit the commit message before merging it into master, for people who are new to the commit styling system, we should be lenient about minor infractions like forgetting to put docs: in front of a message. 

CF: https://github.com/angular-ui/bootstrap/pull/2635#issuecomment-57117579
2014-09-29 02:50:49 -07:00
Georgios Kalpakas eb935e6be0 test($http): fix typo in spec name
'applyAapply' -> 'applyAsync'.

Closes #9323
2014-09-28 20:33:05 -04:00
Jason Bedard b119251827 perf($rootScope): moving internal queues out of the Scope instances
Closes #9071
2014-09-27 08:19:15 -07:00
Jason Bedard 5572b40b15 refactor($parse): change 'this' to a $parse keyword instead of scope field
BREAKING CHANGE:
- $scope['this'] no longer exits on the $scope object
- $parse-ed expressions no longer allow chaining 'this' such as this['this'] or $parent['this']
- 'this' in $parse-ed expressions can no longer be overriden, if a variable named 'this' is put on the scope it must be accessed using this['this']

Closes #9105
2014-09-27 08:13:14 -07:00
Brian Iversen 4a6c7cf8ce docs(guide): update compiler guide with minor grammatical fixes
Minor changes to grammar. Changed sentence "But the declarative language
is also limited, since it does not allow you to teach the browser new syntax."
to now read "However, the declarative language is also limited, as it does not
allow you to teach the browser new syntax."
However is a less informal start to a sentence, and replacing "since"
correctly references extent/degree rather than comparison of time.
2014-09-26 17:16:23 -07:00
Victor Queiroz 27d12340d9 docs(guide): update directive guide to not imply ngView is part of core 2014-09-26 17:04:40 -07:00
Peter Bacon Darwin fb0c77f0b6 fix($compile): connect transclude scopes to their containing scope to prevent memory leaks
Transcluded scopes are now connected to the scope in which they are created
via their `$parent` property. This means that they will be automatically destroyed
when their "containing" scope is destroyed, without having to resort to listening
for a `$destroy` event on various DOM elements or other scopes.

Previously, transclude scope not only inherited prototypically from the scope from
which they were transcluded but they were also still owned by that "outer" scope.
This meant that there were scenarios where the "real" container scope/element was
destroyed but the transclude scope was not, leading to memory leaks.

The original strategy for dealing with this was to attach a `$destroy` event handler
to the DOM elements in the transcluded content, so that if the elements were removed
from the DOM then their associated transcluded scope would be destroyed.

This didn't work for transclude contents that didn't contain any elements - most
importantly in the case of the transclude content containing an element transclude
directive at its root, since the compiler swaps out this element for a comment
before a destroy handler could be attached.

BREAKING CHANGE:

`$transclude` functions no longer attach `$destroy` event handlers to the
transcluded content, and so the associated transclude scope will not automatically
be destroyed if you remove a transcluded element from the DOM using direct DOM
manipulation such as the jquery `remove()` method.

If you want to explicitly remove DOM elements inside your directive that have
been compiled, and so potentially contain child (and transcluded) scopes, then
it is your responsibility to get hold of the scope and destroy it at the same time.

The suggested approach is to create a new child scope of your own around any DOM
elements that you wish to manipulate in this way and destroy those scopes if you
remove their contents - any child scopes will then be destroyed and cleaned up
automatically.

Note that all the built-in directives that manipulate the DOM (ngIf, ngRepeat,
ngSwitch, etc) already follow this best practice, so if you only use these for
manipulating the DOM then you do not have to worry about this change.

Closes #9095
Closes #9281
2014-09-26 21:38:17 +01:00
Peter Bacon Darwin 6417a3e9eb feat(Scope): allow the parent of a new scope to be specified on creation
This enables us to place transclude scopes more accurately in the scope hierarchy.
2014-09-26 21:38:02 +01:00
Caitlin Potter 07e3abc7dd feat($compile): optionally get controllers from ancestors only
Implement option to strengthen require '^' operator, by adding another '^'.

When a second '^' is used, the controller will only search parent nodes for the
matching controller, and will throw or return null if not found, depending on
whether or not the requirement is optional.

Closes #4518
Closes #4540
Closes #8240
Closes #8511
2014-09-26 16:32:26 -04:00
Peter Bacon Darwin b9df121655 chore(docs): fix links to github
Closes https://github.com/angular/code.angularjs.org/issues/13
2014-09-26 20:51:55 +01:00
Brian Ford b5bb4a986a docs(guide/accessibility): explain ngAria 2014-09-26 12:02:02 -07:00
Michał Gołębiowski 8202c4dcea chore(Angular): drop support for Opera < 15
Closes #8589
2014-09-26 11:32:11 -07:00
Leonardo Zizzamia 2c8b464852 perf(benchmark): add ngBindOnce benchmarks to largetable-bp 2014-09-26 10:04:29 -07:00
Sandeep Panda a192c41ddc docs(guide/index): add book AngularJS: Novice to Ninja
I wrote a book on AngularJS (AngularJS: Novice to Ninja).

Closes #9293
2014-09-26 12:27:52 -04:00
Georgios Kalpakas a8fe2cc345 test(input): test that number validates with unspecified viewValue
Adds an additional test verifying that a number which is not required will validate successfully
when ngModelCtrl.$validate() is called. Before 92f05e5 landed, this would have failed because of
a parse error.

Closes #9193
2014-09-25 09:53:45 -04:00
Peter Bacon Darwin e522c25fd4 chore(docs): remove unused code 2014-09-25 05:43:20 +01:00
Peter Bacon Darwin 5dbc2d65f3 chore(docs): improve logo rendering performance 2014-09-25 05:32:12 +01:00
Peter Bacon Darwin 27300072d1 chore(protractor): annotate $animate to allow tests to run under strict-di 2014-09-25 05:32:12 +01:00
Peter Bacon Darwin 7ffc247d0f chore(docs): minify javascript 2014-09-25 05:32:12 +01:00
Peter Bacon Darwin 8ab673d430 chore(docs): ensure DI annotations are in place 2014-09-25 05:31:14 +01:00
Caitlin Potter b9e899c8b2 test(ngModel): rename test to better reflect what is being tested
I meant to do this in before 92f05e5a59 landed, sorry u_u
2014-09-24 18:04:37 -04:00
Caitlin Potter 92f05e5a59 fix(ngModel): do not parse undefined viewValue when validating
Previously, if a viewValue had not yet been set on the element, it could incorrectly produce a
parse error.

This change prevents the parsers from running if a view value has not yet been committed.

Closes #9106
Closes #9260
2014-09-24 18:00:20 -04:00
Peter Bacon Darwin e81ae1464d chore(docs): show error 404 without partial failing
We can move the test back into the main describe as it no longer causes an
error message to be logged
2014-09-24 07:32:04 +01:00
Jeff Cross de38899f74 docs(changelog): add release notes for 1.3.0-rc.3 2014-09-23 18:47:24 -07:00
Caitlin Potter 729c238e19 feat(input): support dynamic element validation
Interpolates the form and form control attribute name, so that dynamic form controls (such as those
rendered in an ngRepeat) will always have their expected interpolated name.

The control will be present in its parent form controller with the interpolated property name, and
this name can change when the interpolated value changes.

Closes #4791
Closes #1404
2014-09-23 16:03:53 -04:00
Jeff Cross dc3de7fb7a feat($location): add ability to opt-out of <base/> tag requirement in html5Mode
This feature allows disabling Angular's requirement of using a <base/> tag
when using location in html5Mode, for applications that do not require
using $location in html5Mode in IE9. To accomplish this, the $locationProvider.html5Mode 
method has been changed to accept a definition object which can optionally set a 
requireBase property to false, removing the requirement of a <base> tag being present
when html5Mode is enabled.

BREAKING CHANGE: The $location.html5Mode API has changed to allow enabling html5Mode by
    passing an object (as well as still supporting passing a boolean). Symmetrically, the
    method now returns an object instead of a boolean value.

    To migrate, follow the code example below:

    Before:

    var mode = $locationProvider.html5Mode();

    After:

    var mode = $locationProvider.html5Mode().enabled;

Fixes #8934
2014-09-23 11:34:24 -07:00
Peter Bacon Darwin ace40d5526 chore(docs): refactor the docs app search for better bootup time
This commit refactors how the search index is built. The docsSearch service
is now defined by a provider, which returns a different implementation of
the service depending upon whether the current browser supports WebWorkers
or now.

* **WebWorker supported**: The index is then built and stored in a new worker.
The service posts and receives messages to and from this worker to make
queries on the search index.

* **WebWorker no supported**: The index is built locally but with a 500ms
delay so that the initial page can render before the browser is blocked as
the index is built.

Also the way that the current app is identified has been modified so we can
slim down the js data files (pages-data.js) to again improve startup time.

Closes #9204
Closes #9203
2014-09-23 18:58:45 +01:00
Shahar Talmi fd8997551f feat(formController): add $setUntouched to propagate untouched state
Closes #9050
2014-09-23 13:48:39 -04:00
Brian Ford d8c8b2ebb7 chore(bower): add ngAria module to script 2014-09-22 15:27:00 -07:00
Andrew Delikat f5bb34ab4a docs(tutorial/step_05): fix typo 2014-09-22 14:52:20 -07:00
Shahar Talmi 4b83f6ca2c fix(ngModel): support milliseconds in time and datetime
Closes #8874
2014-09-22 14:50:08 -07:00
Rouven Weßling a591e8b8d3 perf(map): use Array.prototype.map
Replace helper functions with the native ES5 method
2014-09-22 14:09:48 -07:00
William Chen 6b05105c08 docs(triaging): fix formatting 2014-09-22 13:14:49 -07:00
Bocharsky Victor 728832ec85 docs(guide/$location): fix broken link 2014-09-22 13:12:27 -07:00
Christopher Rains f1a75a445c docs(tutorial/step_02): fix formatting 2014-09-22 13:07:19 -07:00
James Ferguson c59bee5d21 docs(readme): improve readability 2014-09-22 11:40:30 -07:00
Maarten Stolte 17ecf84b90 docs(ngAria): fix wording 2014-09-22 11:35:10 -07:00
Ariel Mashraki df8d9507aa docs(route): remove irrelevant note
Closes #9196
Closes #9200
2014-09-22 13:27:43 -04:00
krusty 6e7fbe77c9 docs(guide/directive): remove note about default restrict value
The text said a directive wouldn't work out of the box as an element, but the note immediatelly
below says that by default the directives restrict to elements or attributes.

11f5aee made the removed comments invalid.

Closes #9205
2014-09-21 20:59:20 -04:00
Jeff Cross 3686f45398 chore($http): disable flaky JSONP test
See #9185
2014-09-19 17:19:57 -07:00
Brian Ford ad28baaa6c refactor(ngAria): bind to ngModel rather than form types 2014-09-19 15:31:48 -07:00
Peter Bacon Darwin 8f9c4daca5 docs(limitTo): restore the missing * to make comment a jsdoc block 2014-09-19 22:53:48 +01:00
Peter Bacon Darwin f0c94ea292 docs(limitTo): exclude the e2e test that fails on safari
Safari and doesn't like the minus key to be sent to it via Protractor.
Commenting out rather than using xit so that it passes the build!
2014-09-19 22:45:14 +01:00
Peter Bacon Darwin 729129b461 docs(limitTo): exclude the e2e test that fails on safari
Safari and doesn't like the minus key to be sent to it via Protractor.
Commenting out rather than using xit so that it passes the build!
2014-09-19 22:42:48 +01:00
Peter Bacon Darwin bf2c55ea29 docs($aria): add basic missing docs for the $aria service
The individual service methods should be documented too.

cc: @arbus
2014-09-19 22:40:05 +01:00
Peter Bacon Darwin deafb5e545 docs(limitTo): exclude the e2e test that fails on safari
Safari and doesn't like the minus key to be sent to it via Protractor.
2014-09-19 22:35:51 +01:00
Ciro Nunes 0702aef7ee docs(guide/unit-testing): clarify the use of underscore notation
Closes #9024
2014-09-19 22:24:48 +01:00
Ciro Nunes f0ee335311 test(injector): allow service names with a single underscore
Closes #9024
2014-09-19 22:24:48 +01:00
Sekib Omazic 02169d4957 docs(angular.extend) actually only copies own enumerable properties
Closes #9007
2014-09-19 21:55:31 +01:00
Zahid Mahir 25d0eff3e6 docs(tutorial/step-3): correct slight grammar issue
Closes #8996
2014-09-19 21:36:08 +01:00
jimmywarting bd41bd594c docs(limitTo): fix input type in examples
Closes #8989
2014-09-19 21:24:04 +01:00
Georgios Kalpakas 373d7c95d9 docs(ngResource): fix error in one of the code examples
Closes #8948
Closes #9069
2014-09-19 19:36:43 +01:00
Sercan Eraslan 4c5c762378 docs(navigation): side navigation footer overlap problem fix
Closes #8923
2014-09-19 19:26:06 +01:00
Subra d1434c999a feat(ngAria): add an ngAria module to make a11y easier
Conditionally adds various aria attributes to the built in directives.
This module currently hooks into ng-show/hide, input, textarea and
button as a basic level of support for a11y.

Closes #5486 and #1600
2014-09-18 16:17:14 -07:00
Luke Schoen 8b8f6f5124 docs(guide/directive): fix grammar 2014-09-18 16:12:00 -07:00
Matt Kim 25082b3439 docs(misc/faq): fix typo 2014-09-18 16:09:56 -07:00
Greg Fedirko 27b3ea4d32 docs(guide/$location): improve readability 2014-09-18 16:08:27 -07:00
DeK ffc32b4e42 docs(guide/migration): fix typo 2014-09-18 16:02:26 -07:00
Luke Schoen 80b0909927 docs(tutorial): improve readability 2014-09-18 16:00:25 -07:00
Christopher Rains efbb365533 docs(tutorial): fix formatting
- proper case "jQuery" vs "JQuery"
- wrap ng-view in markdown code `ng-view`
2014-09-18 15:55:51 -07:00
Brian 38e0ab9bd8 docs(guide/filter): fix label in example 2014-09-18 15:53:56 -07:00
jeffavis 3c53b28cc2 docs(guide/bootstrap): fix missing ngController in example 2014-09-18 15:51:07 -07:00
Rahul Doshi 0ba864184b docs(guide): add angular-localization module to internationalization section
Closes #9158
2014-09-18 17:59:54 -04:00
Sebastian Müller 4f9dc44f88 refactor(ngMessages): remove unused $scope
Closes #9150
2014-09-18 16:04:47 -04:00
Georgios Kalpakas f3884df0a9 docs(ngController): Fix priority value mentioned in the docs
The `@priority 500` part was missing from the ngDoc comment, thus the docs mentioned a priority of 0
(instead of the correct 500).

Closes #9070
2014-09-18 11:43:17 -04:00
Peter Bacon Darwin f7a4a70c28 chore(npm-shrinkwrap): update to dgeni-packages v0.10.0-rc.6
Closes https://github.com/angular/dgeni-packages/pull/70
2014-09-17 19:11:24 +01:00
Jose Martinez 8428a0adef docs(error/$controller/noscp): fix example
Fix the "correct" example to have the proper syntax for creating the locals
object and provide a more explicit explanation as to how the scope object
should be provided.
2014-09-17 10:56:21 -07:00
Brian Ford 14a92a5982 docs(changelog): release notes for 1.2.25 2014-09-16 14:52:25 -07:00
Brian Ford 798ed3be21 docs(changelog): release notes for 1.3.0-rc.2 2014-09-16 14:31:04 -07:00
Brian Ford 4627410245 fix(select): update option labels when model changes
Closes #9025
2014-09-16 12:36:05 -07:00
Igor Minar 7c6026437a docs(guide/filters): add a note about $stateful flag and stateful filters 2014-09-16 14:12:59 +02:00
Igor Minar 76741a9393 refactor($parse): merge ternary and ternaryFn methods
splitting the code into two chunks doesn't buy us anything and only makes the code harder to follow
2014-09-16 14:12:59 +02:00
Igor Minar 8900390add refactor($parse): name anonymous fns for easier debugging and profiling 2014-09-16 14:12:59 +02:00
Jason Bedard fca6be7127 perf($parse): execute watched expressions only when the inputs change
With this change, expressions like "firstName + ' ' + lastName | uppercase"
will be analyzed and only the inputs for the expression will be watched
(in this case "firstName" and "lastName"). Only when at least one of the inputs
change, the expression will be evaluated.

This change speeds up simple expressions like `firstName | noop` by ~15%
and more complex expressions like `startDate | date` by ~2500%.

BREAKING CHANGE: all filters are assumed to be stateless functions

Previously it was a good practice to make all filters stateless, but now
it's a requirement in order for the model change-observation to pick up
all changes.

If an existing filter is statefull, it can be flagged as such but keep in
mind that this will result in a significant performance-penalty (or rather
lost opportunity to benefit from a major perf improvement) that will
affect the $digest duration.

To flag a filter as stateful do the following:

myApp.filter('myFilter', function() {
  function myFilter(input) { ... };
  myFilter.$stateful = true;
  return myFilter;
});

Closes #9006
Closes #9082
2014-09-16 14:12:58 +02:00
Igor Minar ec9c0d76fe chore(largetable-bp): fix typo in main.html 2014-09-16 14:12:58 +02:00
Stephen Bunch fd2d6c02f9 feat(ngInclude): add template url parameter to events
The 'src` (i.e. the url of the template to load) is now provided to the
`$includeContentRequested`, `$includeContentLoaded` and `$includeContentError`
events.

Closes #8453
Closes #8454
2014-09-16 12:25:33 +01:00
Georgii cfdd16157e docs(ngModelOptions): mention that it's inherited
Closes #9096
Closes #7212
2014-09-15 20:27:31 +01:00
Peter Bacon Darwin 06280a14b4 docs(ngView): remove obsolete comment from code sample
Closes #9086
2014-09-15 17:09:37 +01:00
Peter Bacon Darwin 8173382c4b chore(docs): remove excess indentation from code blocks
dgeni-packages 0.10.0-rc.5 has a fix for this problem, so this commit updates
to that version.
Adds a new e2e test to prove this is fixed.

Closes #8963
2014-09-15 14:57:18 +01:00
Peter Bacon Darwin 55244390c8 test(docs): fix url matching on api e2e tests 2014-09-15 14:57:18 +01:00
Peter Bacon Darwin fb7e05cc38 chore(docs): ensure all docs e2e tests are run 2014-09-15 14:57:18 +01:00
Melissa Ip ea94e63e35 docs(ngShowHide): use backticks to denote CSS classes and directive names
add backticks around directive names to improve documentation consistency, as it's used in some
parts of the docs already.

Closes #9081
2014-09-14 20:27:39 -04:00
Caitlin Potter e7ac08a061 fix($compile): update '@'-bindings in controller when bindToController is true
'@'-bindings were previously updating the scope when they ought to have been
updating the controller (requested via `bindToController: true` + controllerAs).

It's a one-line fix + test case.

Closes #9052
Closes #9077
2014-09-14 12:12:15 -04:00
Michael Benford 7ffe524171 test(jqLite): Refactor test for isDefaultPrevent
Refactor the spec for isDefaultPrevent method so it fails if the
existing expectations aren't executed.
2014-09-13 15:11:54 -05:00
Michael Benford 30354c58fe fix(jqLite): fix event.stopImmediatePropagation() so it works as expected
jqLite doesn't override the default implementation of event.stopImmediatePropagation()
and so it doesn't work as expected, i.e, it doesn't prevent the rest of the event
handlers from being executed.

Closes #4833
2014-09-13 15:11:49 -05:00
Peter Bacon Darwin 19871d28cf test(docs): add extra docs e2e tests 2014-09-12 23:05:37 +01:00
Peter Bacon Darwin 63761fdac1 test(docs): improve docs e2e tests 2014-09-12 23:05:37 +01:00
Peter Bacon Darwin 3d367eb7b9 chore(docs): update to dgeni-0.4.0
* update package with new services and computeId config
* generateIndexPagesProcessor was not using log
* use StringMap not ES6-shim Map in errorNamespaceMap
* remove unused dependencies from generateErrorDocsProcessor
* ensure generatePagesDataProcessor adds its doc to the collection
* debugDumpProcessor was moved to dgeni-packages
2014-09-12 23:05:37 +01:00
Caitlin Potter d13b4bd1f5 fix($parse): ensure CSP assignable expressions have assign()
Fixes regression where the `assign()` method was not added to chains of identifiers in CSP mode,
introduced originally in b3b476d.

Also fixes the $parse test suite to ensure that CSP code paths are taken when they're expected to be
taken.

Closes #9048
2014-09-12 14:47:58 -04:00
Igor Minar c1f2c3ea83 refactor($parse): remove commented out code 2014-09-12 16:08:24 +02:00
Igor Minar 6af2ff2c7d refactor($parse): clean up object literal fn
No measurable impact on performance
2014-09-12 16:06:12 +02:00
Jason Bedard 67919c8087 perf($parse): removing binaryFn and valueFn wrappers from filter expressions
Improves parsed-expressions/filters benchmark by 15%.
2014-09-12 15:17:26 +02:00
Georgii 5cf1d89692 refactor(ngEventDirs): remove a useless call
The event names are already lower-case.
2014-09-11 12:57:16 -07:00
Georgios Kalpakas 58adaa6634 docs(CHANGELOG.md): fix typos for ng-switch-changed workaround
Fix the JavaScript errors in the work-around proposed in 0f806d9 in order to emulate the behaviour
of the removed `change` attribute of ngSwitch.

Closes #9034
2014-09-11 15:38:49 -04:00
Justin Walsh 0eadee5c24 docs(guide/forms): correct grammar 2014-09-11 12:10:24 -07:00
Caitlin Potter 6a96a8200a fix(ngLocale): Regenerate Locale Files
Fixes number formatting and symbols for many locales.
Adds support for additional locales.

Closes #8931
Closes #8583
Closes #7799
2014-09-10 20:15:22 -04:00
Michael Gallagher 871f321f50 chore(ngLocale): Include numberformatsymbolext.js in Closure Slurper Script
Adds missing number format and symbol rules to Closure slurper script.

Closes #6179
Closes #9013
2014-09-10 20:15:22 -04:00
SirTophamHatt bd8a912774 docs(guide/providers): note that services can create functions
The conclusion table incorrectly states that services can not create functions.
New table row added to separate "can create functions" and "can create primitives".
2014-09-10 16:04:46 -07:00
Caitlin Potter a3962f0df3 fix(ngResource): make badcfg error message more helpful
The error message should help identify the problem. To do so, more details need to be provided.

Closes #9005
Closes #9010
2014-09-10 18:31:08 -04:00
Lucas Galfaso eb4afd45f7 fix(i18n): fix typo at i18n generation code
Fix typo at i18n generation code. This would remove the
property `macFrac` that has no meaning from all the
generated locales
2014-09-10 15:29:56 -07:00
Reuben Doetsch 1c8a7459c9 feat(limitTo): support numeric input to limitTo
Closes #8926
2014-09-10 15:19:30 -07:00
Peter Bacon Darwin 9cd272ac60 docs(tutorial/steps-11&12): add warning about bower conflict error
See: https://github.com/angular/angular-phonecat/issues/163#issuecomment-55181854
2014-09-10 22:52:39 +01:00
Brian Ford 1a1ef62903 fix(ngModel): do not reset bound date objects
Previously, if you bound a `Date` object to `<input type="time">`,
whenever you changed the time, the day, month, and year fields of
the new resulting bound `Date` object would be reset. Now fields
not modified by bound time input elements are copied to the new
resulting object.

Same for input types of `month`, `week`, etc.

Closes #6666
2014-09-10 14:19:28 -07:00
Tobias Bosch 3e51b84bc1 fix(input): always pass in the model value to ctrl.$isEmpty
Fixes #5164
Closes #9017
2014-09-10 11:45:36 -07:00
Michael Silver a0d6e64889 docs(tutorial): update step 7 to reference angular-phonecat
This changes the example JSON to be the actual bower.json for angular-phonecat,
with name set to angular-phonecat.
2014-09-10 11:44:08 -07:00
standup75 1d36cff22e docs(ngResource): document steps to skip default json serialization/deserialization 2014-09-10 11:39:57 -07:00
Jason Bedard 56f09f0b44 perf($compile): move $$isolateBinding creation to directive factory instead of on each link 2014-09-10 11:29:17 -07:00
Tobias Bosch 9314719d1e fix(ngModel): don’t clear the model when an external validator failed
Calling `ctrl.$setValidity()` with a an error key that
does not belong to a validator in `ctrl.$validator` should
not result in setting the model to `undefined` on the next
input change. This bug was introduced in 1.3.0-beta.12.

Closes #8357
Fixes #8080
2014-09-10 11:16:42 -07:00
Peter Bacon Darwin 14183833f9 docs(angular.getTestability): unpublish the function as it is not public 2014-09-10 18:53:15 +01:00
Peter Bacon Darwin d307e77ff3 docs(angular.testability): add jsdoc marker to ensure it is included in docs 2014-09-10 15:02:38 +01:00
Peter Bacon Darwin f0d3722e07 docs(api/index): fix strange uses of the word namespace 2014-09-10 14:43:05 +01:00
Jeff Cross fb39e322ea docs(CHANGELOG.md): add upcoming breaking change 2014-09-09 16:21:52 -07:00
Jeff Cross d1318f7dc7 docs(CHANGELOG.md): fix wording and remove reverted change 2014-09-09 16:21:44 -07:00
Jeff Cross c54990ca6e docs(CHANGELOG.md): add changes for 1.3.0-rc.1 and 1.2.24 2014-09-09 15:45:51 -07:00
Shahar Talmi 3c538c1d21 feat(ngModelOptions): add allowInvalid option
This option allows to write invalid values to the model instead of having them become undefined.
Use this together with calling `ctrl.$setValidity` directly for displaying errors
from serverside validation.

Closes #8290
Closes #8313
2014-09-09 13:48:17 -07:00
Tobias Bosch 64c3b745fb fix(ngModel): update model value with async validators correctly
If the view value changed in the first digest and there are async validators,
the view value was never applied to the model after the validators were
resolved. Only important for tests.
2014-09-09 13:46:28 -07:00
Tobias Bosch f94d551529 fix(ngModel): render immediately also with async validators 2014-09-09 13:46:28 -07:00
Tobias Bosch 9ad7d745ab refactor(ngModel): remove $$invalidModelValue and refactor methods
- define `ngModelGet` and `ngModelSet` to already use
  the getter/setter semantics, so the rest of the code does
  not need to care about it.
- remove `ctrl.$$invalidModelValue` to simplify the internal logic
2014-09-09 13:46:24 -07:00
Igor Minar 90cd1e0a1b docs: add perf todo notes from #8515 2014-09-09 22:36:35 +02:00
Jason Bedard b3b476db7d perf($parse): remove getterFn wrapper for internal use
Closes #8901
2014-09-09 22:15:23 +02:00
Jason Bedard 456dcb020b test($parse): adding benchmark for execution of $parse()ed expressions
Part of #8901
2014-09-09 22:15:23 +02:00
Tobias Bosch 7235329ff8 docs(ngModel): update breaking change from 1.3.0-beta.11 to 1.3.0-beta.12
Closes #8357
2014-09-09 12:38:43 -07:00
Jeff Cross 06fa2868de revert: "fix($compile): render nested transclusion at the root of a template"
This reverts commit 6d1e7cdc51.

This commit was causing breakages because of its assumption that transcluded
content would be handled predictably, i.e. with ngTransclude, whereas many
use cases involve manipulating transcluded content in linking functions.
2014-09-09 11:05:34 -07:00
Chirayu Krishnappa bd8ad0fbe8 fix($parse): disallow passing Function to Array.sort
Fix the following exploit:

    hasOwnProperty.constructor.prototype.valueOf = valueOf.call;
    ["a", "alert(1)"].sort(hasOwnProperty.constructor);

The exploit:
• 1. Array.sort takes a comparison function and passes it 2 parameters to compare.
  2. It then calls .valueOf() if the result is not a primitive.
• The Function object conveniently accepts two string arguments so we can use this
  to construct a function.  However, this doesn't do much unless we can execute it.
• We set the valueOf function on Function.prototype to Function.prototype.call.
  This causes the function that we constructed to be executed when sort calls
  .valueOf() on the result of the comparison.

The fix is in two parts.
• Disallow passing unsafe objects to function calls as parameters.
• Do not traverse the Function object when setting a path.
2014-09-09 10:39:39 -07:00
Caitlin Potter 6639ca9d6b fix(ngInclude): correctly add svg-namespaced template content
It is now possible for ngInclude to correctly load SVG content in non-blink browsers, which do not
sort out the namespace when parsing HTML.

Closes #7538
Closes #8981
Closes #8997
2014-09-09 12:45:15 -04:00
Caitlin Potter 719f42e949 chore(.jshintrc): add jqLiteParseHTML to globals 2014-09-09 11:43:49 -04:00
Caitlin Potter 73916108f8 chore(.jshintrc): add jqLiteBuildFragment to globals 2014-09-09 11:43:49 -04:00
Igor Minar ed63733000 fix(ngRepeat): preserve original position of elements that are being animated away
During the recent refactoring a typo was made that broke code that detects if we are
already removed from the DOM (animation has completed).

Closes #8918
Closes #8994
2014-09-09 16:19:47 +02:00
Igor Minar f33a938545 chore(testabilityPatch): fix the dump fn so that it works with karma's debug.html 2014-09-09 16:19:47 +02:00
Igor Minar 01ef12884b test(animateSpec): remove unused variables 2014-09-09 16:19:46 +02:00
Igor Minar 732d72d991 test(ngRepeat): move an existing test into the right describe block 2014-09-09 16:19:46 +02:00
Peter Bacon Darwin 66103c8277 chore(npm-shrinkwrap): safely update karma to 0.12.23 2014-09-09 10:21:11 +01:00
Peter Bacon Darwin fee8f1c07b chore(npm-shrinkwrap): fix karma dependencies
Updating to karma 0.12.13 (in commit 408508ad29)
caused `iit` and `ddescribe` to crash and disconnect the browser stopping the
test run.

It appears that the problem is with one of the dependencies of karma rather
than karma itself. At least one of the karma dependencies updated in line
with karma's dependencies' semver specifications but subtly changed their
behaviour to break karma.  Possibly this is related to chokidar, glob,
minimatch or fsevents.
2014-09-09 10:14:15 +01:00
Tobias Bosch 6046e14bd2 refactor(ngModelController,formController): centralize and simplify logic
The previous logic for async validation in
`ngModelController` and `formController` was not maintainable:
- control logic is in multiple parts, e.g. `ctrl.$setValidity`
  waits for end of promises and continuous the control flow
  for async validation
- logic for updating the flags `ctrl.$error`, `ctrl.$pending`, `ctrl.$valid`
  is super complicated, especially in `formController`

This refactoring makes the following changes:
- simplify async validation: centralize control logic
  into one method in `ngModelController`:
  * remove counters `invalidCount` and `pendingCount`
  * use a flag `currentValidationRunId` to separate
    async validator runs from each other
  * use `$q.all` to determine when all async validators are done
- centralize way how `ctrl.$modelValue` and `ctrl.$invalidModelValue`
  is updated
- simplify `ngModelController/formCtrl.$setValidity` and merge
  `$$setPending/$$clearControlValidity/$$clearValidity/$$clearPending`
  into one method, that is used by `ngModelController` AND
  `formController`
  * remove diff calculation, always calculate the correct state anew,
    only cache the css classes that have been set to not
    trigger too many css animations.
  * remove fields from `ctrl.$error` that are valid and add private `ctrl.$$success`:
    allows to correctly separate states for valid, invalid, skipped and pending,
    especially transitively across parent forms.
- fix bug in `ngModelController`:
  * only read out `input.validity.badInput`, but not
    `input.validity.typeMismatch`,
    to determine parser error: We still want our `email`
    validator to run event when the model is validated.
- fix bugs in tests that were found as the logic is now consistent between
  `ngModelController` and `formController`

BREAKING CHANGE:
- `ctrl.$error` does no more contain entries for validators that were
  successful.
- `ctrl.$setValidity` now differentiates between `true`, `false`,
  `undefined` and `null`, instead of previously only truthy vs falsy.

Closes #8941
2014-09-08 15:10:02 -07:00
Tobias Bosch 2a5af502c5 docs($location): clarify guide regarding link handling
The trick with setting `<base href=".">` has not worked since Angular 1.2.0.
It is also misleading that it talks about `$routeProvider.otherwise`
which is not important in this case.

Related to #8869
Closes #8908
2014-09-08 10:40:20 -07:00
Jason Bedard 9bedeb3353 perf(extend): remove use of forEach to remove calls/closures/passing arguments
Closes #8898
2014-09-08 17:15:02 +02:00
Jason Bedard df9e60c8e7 feat(angular.forEach): add the array/object as the 3rd param like the native array forEach
Closes #7902
2014-09-08 17:06:16 +02:00
Igor Minar 41cec4d680 refactor(select): remove code duplication 2014-09-08 16:58:47 +02:00
Peter Bacon Darwin 0f3ea45d73 docs($filter): remove duplicate documentation of register method 2014-09-08 12:05:11 +01:00
Peter Bacon Darwin cddd48fe20 docs(form): move param tag outside of main description 2014-09-08 12:05:11 +01:00
Peter Bacon Darwin be3b62cd09 chore(bower): refactor bower usage
The gulp bower task in the docs app was never actually running since it couldn't
find the bower.json file and was silently failing. Updating to a newer bower
highlighted this issue.

This commit moves the docs app specific bower components into the docs folder.
There are only jquery and closure compiler related components in the project
folder now.

It also improves the gulp bower task to provide better feedback of progress
and errors.
2014-09-08 12:05:11 +01:00
Peter Bacon Darwin 40308e5935 chore(package.json): tidy up dependencies
Sorted dependencies into alphabetic order. If we can keep them like this
it will be much easier to keep track of version changes.

Updated bower and gulp to newer versions.
2014-09-08 12:05:11 +01:00
Jason Bedard f6aa1c5561 perf(jQuery): only trigger $destroy if a handler exists
Speeds up largetable destruction by 30% (500ms) when jQuery 2.1.1 is present.

Closes #8859
2014-09-07 23:56:11 +02:00
Jason Bedard 43c67ccd16 perf($parse): removing references to Parser/Lexer from parsed expressions
This allows the parser and lexer objects to get GC-ed once the expression
is parsed.

Part of #8901
2014-09-07 23:02:31 +02:00
Jason Bedard 1cfd49ddf0 refactor($parse): simplifying some while(true) loops
Part of #8901
2014-09-07 22:55:33 +02:00
Jason Bedard 907b8c1675 perf($parse): calculate array lengths once at start of loop
Part of #8901
2014-09-07 22:53:16 +02:00
Jason Bedard 432aa9e4e4 refactor($parse): adding function names for easier debugging
Part of #8901
2014-09-07 22:52:00 +02:00
Jason Bedard b95dabb881 refactor($parse): simplifying multi-statement execution
Part of #8901
2014-09-07 22:42:05 +02:00
Pawel Kozlowski 0f3adece3b refactor($http): simplify buildUrl function
Closes #8955
2014-09-05 20:21:00 -04:00
Shahar Talmi e322cd9b3b fix(ngModelOptions): do not trigger digest on setViewValue if debouncing
Note that this change means that anyone watching `$viewValue` will have to
wait for a new digest before they are aware that it has been updated.

Closes #8814
Closes #8850
Closes #8911
2014-09-05 20:15:34 +01:00
Caitlin Potter b3b672130d fix(ngAnimate): support removing classes from SVG elements when using jQuery
Fixes a regression in ngAnimate introduced in 2f4437b3, whereby SVG elements would not be able to
have classes removed by ngAnimate methods when jQuery was loaded (without also including libraries
which patch jQuery to support SVG elements, such as jquery-svgdom.js).

This fix exports jqLiteHasClass as a private method `$$hasClass` on the `angular` global object,
which enables ngAnimate to use this SVG-safe method for testing if the class is available.

Closes #8872
Closes #8893
2014-09-05 13:51:17 -04:00
Julie Ralph 8b5d33dab8 chore(tests): update Protractor to v1.2.0 2014-09-05 10:49:18 -07:00
Vitali Tsevan cbdaabfb59 fix(orderBy): allow arrayLike objects to be ordered
Closes #8944
2014-09-05 11:56:09 +01:00
Rouven Weßling 3471fedfbc refactor(indexOf) Remove a now unused copy of the indexOf function
This was missed in 300bffc4fe

Closes #8939
2014-09-05 10:23:52 +01:00
Jeff Cross c3a58a9f34 fix($location): don't call toString on null values 2014-09-04 17:16:11 -07:00
thorn0 99d95f1639 fix($location): remove an unused parameter of $location.url 2014-09-04 15:09:18 -07:00
John Reilly 48e66cff40 docs($location): update search description to include number param 2014-09-04 14:49:52 -07:00
Pawel Kozlowski adb5c6d6cc fix($location): allow numeric location setter arguments
Fixes #7054
2014-09-04 09:55:03 -07:00
Peter Bacon Darwin b01a03c1b9 docs(guide): add sortOrder to each page
Finally we can control the order of the guide pages
2014-09-04 16:49:25 +01:00
Peter Bacon Darwin 43e0dc2dfe chore(docs): enable page ordering by @sortOrder tag 2014-09-04 16:49:25 +01:00
Matias Niemelä 976da56d50 test(ngModel): add missing tests for ngMin/ngMax for date inputs 2014-09-04 11:46:05 -04:00
Matias Niemelä 088545c185 fix(ngModel): properly parse min/max date values as strings for date inputs
Due to the nature of how date objects are rendered when JSON.stringify
is called, the resulting string contains two sets of quotes surrounding
it. This commit fixes that issue.

Closes #6755
2014-09-04 11:45:59 -04:00
Matias Niemelä b350283503 fix(ngModel): revalidate the model when min/max expression values change for date inputs
Closes #6755
2014-09-04 11:45:53 -04:00
Matias Niemelä 25541c1f87 fix(ngModel): consider ngMin/ngMax values when validating number input types
With this fix ngModel will treat ngMin as a min error and ngMax as a max error.
This also means that when either of these two values is changed then ngModel will
revaliate itself.
2014-09-04 11:45:46 -04:00
Matias Niemelä 7b273a2c97 fix(ngModel): revalidate the model when min/max expression values change for number inputs
As of this fix if the max or min value is changed via scope or by another ngModel
then it will trigger the model containing the min/max attributes to revalidate itself.

Closes #2404
2014-09-04 11:45:36 -04:00
Peter Bacon Darwin 3952408cf1 chore(docs): improve searching by member
The keywords processor now also extracts the members (i.e. method, properties
and events) into its own search term property. These are then used in the lunr
search index with higher weighting that normal keywords to push services that
contain the query term as a member higher up the search results.

Closes #7661
2014-09-04 14:23:04 +01:00
Peter Bacon Darwin 02bada130e refact(ngSwitch): don't create extra function in for loop
Closes #8927
2014-09-04 13:17:21 +01:00
The Big Red Geek 712299c2a2 fix(ngSwitch): ensure correct iterator is passed to async function
Closes #8833
2014-09-04 12:49:14 +01:00
Peter Bacon Darwin 6d1e7cdc51 fix($compile): render nested transclusion at the root of a template
Closes #8914
Closes #8925
2014-09-04 12:30:09 +01:00
Peter Bacon Darwin 86c6be82e5 docs($http): clarify overriding of default transformations
Closes #8590
2014-09-04 12:28:18 +01:00
Smitha Milli ae952fbf0b fix(numberFilter): format numbers that round to zero as nonnegative
Previously when a negative number was rounded to 0 by the number filter
it would be formated as a negative number.  This means something like
{{ -0.01 | number: 1 }} would output -0.0.  Now it will ouput 0.0
instead.

Closes #8489
2014-09-03 14:59:53 -07:00
thorn0 73157b0a0b docs(docs.css): improve comma spacing in TOC on mobile 2014-09-03 13:57:49 -07:00
Juampy 0ee0ce18c1 docs($sce:unsafe): fix link to $sce docs
The second link to Strict Contextual Escaping (SCE) points to a 404.

Closes #8514
2014-09-03 16:31:06 -04:00
thorn0 7f87988e41 docs(README): fix 'Contribution guidelines' link
The current link leads to a page 'Building and Testing AngularJS'.
This same link is also included in the 'Building AngularJS' section
of the README where it's more relevant.
2014-09-03 13:24:56 -07:00
TLChan 9a09f1d96d docs(tutorial/step_05): improve formatting of code identifier
Closes #8557
2014-09-03 16:24:06 -04:00
Zach Pomerantz e96be5bfb8 docs(interpolate): fix link text 2014-09-03 13:17:46 -07:00
Vic Metcalfe 095627ad17 docs(ngBlur): explain blur events 2014-09-03 13:04:50 -07:00
thammin 1b4a2c8fee docs(ngSwitch): fix priority 2014-09-03 12:00:35 -07:00
Caitlin Potter b474c36e41 docs(CHANGELOG.md): add breaking change for a9fcb0d0 (v1.2.13)
Closes #8909
2014-09-03 13:13:25 -04:00
Jeff Cross 007e320835 chore(shrink-wrap): update shrinkwrap to latest benchpress 2014-09-03 09:22:13 -07:00
Tim Whitbeck f211419be6 docs(ngModelController): fix $asyncValidators example
Also fixes a typo (◜௰◝)

Closes #8906
2014-09-03 12:21:07 -04:00
Igor Minar 5dd9f138c7 chore(orderby-bp): fix the benchmark code and add jquery support 2014-09-03 16:37:46 +02:00
Peter Bacon Darwin 821da26e18 test($location): fix use of browserTrigger
You must now pass `keys` to the function in a config object.
This bug in the test became apparent because in newer browsers, arrays
have a function called `keys()` and this was causing browserTrigger to
fail. Previously it was quietly passing this test despite being wrong.
2014-09-03 14:56:49 +01:00
Rouven Weßling 300bffc4fe refactor(indexOf) use Array.prototype.indexOf exclusively
Replace helper functions with the native ES5 method

Closes #8847
2014-09-03 13:37:03 +01:00
thorn0 5b2a386b1f docs(jsdoc): remove @kind function for providers
This gets rid of the bizarre "Usage: fooProvider();" which does not really communicate anything useful.

Closes #8809
2014-09-03 08:32:15 -04:00
Shahar Talmi 953ee22f76 fix(ngForm): don't clear validity of whole form when removing control
Calling `$$clearControlValidity` on the parent of a nested form caused the parent form
to look like there are no more errors on the nested form even if it still had some
inputs with errors. there is no need to call this method recursively since `$setValidity`
will propagate the new validity state well enough.

Closes #8863
2014-09-03 13:30:33 +01:00
Shahar Talmi c3064f728c refactor(ngModel): get rid of revalidate
Since the validation was refactored we can now work out inside
`$commitViewValue()` whether to ignore validation by looking at whether
the input has native validators.

Closes #8856
2014-09-03 13:20:16 +01:00
The Big Red Geek 0f806d9659 refactor(ngSwitch): remove undocumented change attribute from ngSwitch
BREAKING CHANGE:

Ever since 0df93fd, tagged in v1.0.0rc1, the ngSwitch directive has had an undocumented `change`
attribute, used for evaluating a scope expression when the switch value changes.

While it's unlikely, applications which may be using this feature should work around the removal
by adding a custom directive which will perform the eval instead. Directive controllers are
re-instantiated when being transcluded, so by putting the attribute on each item that you want
to be notified of a change to, you can more or less emulate the old behaviour.

Example:

```js
angular.module("switchChangeWorkaround", []).
  directive("onSwitchChanged", function() {
    return {
      linke: function($scope, $attrs) {
        $scope.$parent.$eval($attrs.change);
      }
    };
  });
```

```html
<div ng-switch="switcher">
  <div ng-switch-when="a" on-switch-changed="doSomethingInParentScope()"></div>
  <div ng-switch-when="b" on-switch-changed="doSomethingInParentScope()"></div>
</div>
```

Closes #8858
Closes #8822
2014-09-03 07:38:11 -04:00
Peter Bacon Darwin ac535549c9 chore(package.json): update to dgeni-packages v0.9.8
Closes #8860
2014-09-03 11:38:44 +01:00
Leonardo Zizzamia d9cdb105fc test(orderBy): implement benchmark for ngRepeat with orderBy 2014-09-02 15:21:36 -07:00
Brian Ford 44cf2e1904 style(ngModel): fix indentation 2014-09-02 14:51:16 -07:00
Nicolai Skogheim ce25ac83b4 docs(ngRepeat): update step_02.ngdoc with challenge
Add a simple task for the user to better understand ng-repeat.

Close #8757
2014-09-02 16:46:01 -04:00
Shahar Talmi d2d8117edd docs($rootScope): document scope properties 2014-09-02 13:35:17 -07:00
Tiago Ribeiro 63fb60de86 docs(changelog): fix inline formatting 2014-09-02 13:01:41 -07:00
Nima Mehanian 29714a34ab docs(guide/providers): fix grammar and punctuation 2014-09-02 12:43:28 -07:00
Brian Ford d5686ffc48 style(ngModel): fix spacing 2014-09-02 12:10:23 -07:00
Shahar Talmi 203ea10f9e fix(ngEventDirs): check scope.$$phase only on $rootScope
Closes #8891, #8849
2014-09-02 10:42:01 -07:00
Shahar Talmi bf59d7274f fix(input): check scope.$$phase only on $rootScope 2014-09-02 10:41:32 -07:00
Tobias Bosch 995a8d39af docs(errors): fix base href in $location:nobase error page 2014-09-02 10:21:41 -07:00
Tobias Bosch fc706d13d8 fix($location): set baseHref in mock browser to /
Set the default value for the base tag in the mock browser to `/`,
as we now always require a base tag to be present for html5 mode.

Fixes #8866
Closes #8889
2014-09-02 09:54:46 -07:00
Peter Bacon Darwin 9525d0ad1d docs($compile): clarify linking when there are templateUrl directives
Closes #8877
Closes #8631
2014-09-02 15:37:29 +01:00
Caitlin Potter e0d49a3109 refactor(ngRepeat): specify explicit false for cloneNode deepClone parameter
This should provide a slight compat improvement for old versions of Opera, which did not treat the
`false` as the default value.

There is no test for this fix as Opera 11 is not a browser which runs on the CI servers.

Closes #8883
Closes #8885
2014-09-02 03:04:00 -04:00
Caitlin Potter c5b32f14d5 docs(CHANGELOG.md): add breaking change from 5f3f25a1
5f3f25a1 included a breaking change which was not documented, which is that the return value of directive
constructors is ignored. The reason they are ignored is to ensure that the correct object is bound to when
binding properties to the controller. It may be possible to come up with a better solution which informs
the developer that what they are doing is wrong, rather than just breaking instead.

Closes #8876
Closes #8882
2014-09-01 18:15:57 -04:00
Igor Minar 2e0982c1ec docs(errors): fix link in the $location:nobase error page 2014-08-31 11:03:59 -07:00
Igor Minar b2902446eb chore(travis): move docse2e tests into the unit tests vm
we spend more time making getting the build ready than running the docs e2e tests.

by piggy-backing on unit tests we'll finish the build faster
2014-08-29 21:54:32 -07:00
Matias Niemelä 202aed7770 docs(changelog): release notes for 1.3.0-RC.0 sonic-boltification 2014-08-29 21:22:46 -04:00
Tobias Bosch 271572c20e fix(docs): only check for SEVERE logs in tests 2014-08-29 17:57:23 -07:00
Igor Minar 550ba01b32 fix(docs): don't throw exception on the 404 page
Closes #8518
2014-08-29 16:13:11 -07:00
Tobias Bosch 22948807e3 fix($location): always resolve relative links in html5mode to <base> url
BREAKING CHANGE (since 1.2.0 and 1.3.0-beta.1):

Angular now requires a `<base>` tag when html5 mode of `$location` is enabled. Reasoning:
Using html5 mode without a `<base href="...">` tag makes relative links for images, links, ...
relative to the current url if the browser supports
the history API. However, if the browser does not support the history API Angular falls back to using the `#`,
and then all those relative links would be broken.

The `<base>` tag is also needed when a deep url is loaded from the server, e.g. `http://server/some/page/url`.
In that case, Angular needs to decide which part of the url is the base of the application, and which part
is path inside of the application.

To summarize: Now all relative links are always relative to the `<base>` tag.

Exception (also a breaking change):
Link tags whose `href` attribute starts with a `#` will only change the hash of the url, but nothing else
(e.g. `<a href="#someAnchor">`). This is to make it easy to scroll to anchors inside a document.

Related to #6162
Closes #8492

BREAKING CHANGE (since 1.2.17 and 1.3.0-beta.10):

In html5 mode without a `<base>` tag on older browser that don't support the history API
relative paths were adding up. E.g. clicking on `<a href="page1">` and then on `<a href="page2">`
would produce `$location.path()==='/page1/page2'. The code that introduced this behavior was removed
and Angular now also requires a `<base>` tag to be present when using html5 mode.

Closes #8172, #8233
2014-08-29 15:19:51 -07:00
Tobias Bosch b9007df590 refactor(locationSpec): make helper functions take an object
Makes tests more readable
2014-08-29 15:05:50 -07:00
Smitha Milli 0604bb7b7a fix(ngRepeat): improve errors for duplicate items
-Log the value that had the duplicate key, as well as the key
The error that is thrown when items have duplicate track by keys can be
confusing because only the duplicate key is logged.  If the user didn't
provide that key themselves, they may not know what it is or what item
it corresponds to.
2014-08-29 13:46:37 -07:00
Matias Niemelä 92576743ee fix($animate): wait two until two digests are over until enabling animations
Even when no remote templates are to be downloaded, wait until the end of the
post digest queue before enabling animations since all $animate-triggered
animation events perform a post digest before running animations.

Closes #8844
2014-08-29 16:17:32 -04:00
Matias Niemelä c9b0bfecc9 fix(ngSwitch): avoid removing DOM nodes twice within watch operation
Closes #8662
2014-08-29 15:58:13 -04:00
Igor Minar 2ae10f67fc fix(numberFilter): pass through null and undefined values
When these special values are passed through one-time binding will work correctly.

BREAKING CHANGE: previously the number filter would convert null and undefined values into empty string, after this change
these values will be passed through.

Only cases when the number filter is chained with another filter that doesn't expect null/undefined will be affected. This
should be very rare.

This change will not change the visual output of the filter because the interpolation will convert the null/undefined to
an empty string.

Closes #8605
Closes #8842
2014-08-29 12:33:43 -07:00
Igor Minar c2aaddbe4b fix(currencyFilter): pass through null and undefined values
When these special values are passed through one-time binding will work correctly.

BREAKING CHANGE: previously the currency filter would convert null and undefined values into empty string, after this change
these values will be passed through.

Only cases when the currency filter is chained with another filter that doesn't expect null/undefined will be affected. This
should be very rare.

This change will not change the visual output of the filter because the interpolation will convert the null/undefined to
an empty string.

Closes #8605
2014-08-29 12:32:51 -07:00
Wesley Cho 6f7018d52f perf(select): execute render after $digest cycle
This is an optimization to defer execution of the render function in the
select directive after the $digest cycle completes inside the
$watchCollection expressions.  This does a check to see if the render
function is already registered in the $$postDigestQueue before it passes
it into $$postDigest, guaranteeing that the DOM manipulation happens
only in one execution after the model settles.

Closes #8825
2014-08-29 12:24:49 -07:00
Michael Barton 4f9ac078d5 docs($rootScope): remove duplicate $digest()
Closes #8840
2014-08-29 14:38:08 -04:00
zahragh 9057ed21ac docs(FormController): document $submitted property
Closes #8732
2014-08-29 14:35:22 -04:00
danrbergman c09f619318 docs($q): fixed spelling, removed extra characters
Closes #8779
2014-08-29 14:00:50 -04:00
Matias Niemelä 1eda18365a fix(ngModel): always format the viewValue as a string for text, url and email types
NgModel will format all scope-based values to string when setting the viewValue for
the associated input element. The formatting, however, only applies to input elements
that contain a text, email, url or blank input type. In the event of a null or undefined
scope or model value, the viewValue will be set to null or undefined instead of being
converted to an empty string.
2014-08-29 13:29:47 -04:00
Caitlin Potter 77ce5b89f9 fix(input): validate minlength/maxlength for non-string values
Use the viewValue rather than modelValue when validating. The viewValue should always be a string, and
should reflect what the user has entered, or the formatted model value.

BREAKING CHANGE:

Always uses the viewValue when validating minlength and maxlength.

Closes #7967
Closes #8811
2014-08-29 13:20:03 -04:00
Caitlin Potter c5f1ca3d91 chore(compare-master-to-stable): make checks for bugfixes better
Prevent the script from alerting you if a docs fix has something like "Fixes typo in foo", which is
not how bugfixes are worded.

Closes #8801
2014-08-29 11:59:07 -04:00
Sekib Omazic 7a36d49533 docs($filter): Date filter am/pm case
Use uppercase for AM/PM in date filter

fixes #8763
2014-08-29 13:04:05 +02:00
rodyhaddad cd21602d5b fix(ngBindHtml): throw error if interpolation is used in expression
Closes #8824
2014-08-29 01:24:46 -04:00
Caitlin Potter 5f3f25a1a6 feat($compile): bind isolate scope properties to controller
It is now possible to ask the $compiler's isolate scope property machinery to bind isolate
scope properties to a controller rather than scope itself. This feature requires the use of
controllerAs, so that the controller-bound properties may still be referenced from binding
expressions in views.

The current syntax is to prefix the scope name with a '@', like so:

    scope: {
        "myData": "=someData",
        "myString": "@someInterpolation",
        "myExpr": "&someExpr"
    },
    controllerAs: "someCtrl",
    bindtoController: true

The putting of properties within the context of the controller will only occur if
controllerAs is used for an isolate scope with the `bindToController` property of the
directive definition object set to `true`.

Closes #7635
Closes #7645
2014-08-28 20:46:52 -07:00
Tobias Bosch cb73a37c7c fix($compile): use the correct namespace for transcluded svg elements
This fixes the case when a directive that uses `templateUrl`
is used inside of a transcluding directive like `ng-repeat`.

Fixes #8808
Closes #8816
2014-08-28 17:34:11 -07:00
Guilbert 49455a75dc docs(filterFilter): add note on negation 2014-08-28 14:55:53 -07:00
Julie 85880a6490 feat(testability): add $$testability service
The $$testability service is a collection of methods for use when debugging
or by automated testing tools. It is available globally through the function
`angular.getTestability`.
For reference, see the Angular.Dart version at
https://github.com/angular/angular.dart/pull/1191
2014-08-28 14:25:50 -07:00
Colin Casey 46343c603d feat(filterFilter): pass index to function predicate
Closes #654
2014-08-28 12:34:42 -07:00
Erin Altenhof-Long 3b5d75c021 feat(ngRoute): alias string as redirectTo property in .otherwise()
Allow `.otherwise()` to interpret a string parameter
as the `redirectTo` property

Closes #7794
2014-08-28 11:58:31 -07:00
Tobias Bosch 719c747cd8 fix(ngEventDirs): execute blur and focus expression using scope.$evalAsync
BREAKING CHANGE:
The `blur` and `focus` event fire synchronously, also during DOM operations
that remove elements. This lead to errors as the Angular model was not
in a consistent state. See this [fiddle](http://jsfiddle.net/fq1dq5yb/) for a demo.

This change executes the expression of those events using
`scope.$evalAsync` if an `$apply` is in progress, otherwise
keeps the old behavior.

Fixes #4979
Fixes #5945
Closes #8803
Closes #6910
Closes #5402
2014-08-28 11:49:31 -07:00
Tim Kindberg 2137542e09 docs(ngModelOptions): fix example 2014-08-28 11:36:22 -07:00
Shahar Talmi ab878a6c03 fix(ngModel): allow non-assignable binding when getterSetter is used
Closes #8704
2014-08-28 11:25:03 -07:00
Igor Minar 474a0337bd chore(benchmarks): disable debugInfo in largetable benchmark 2014-08-28 09:31:02 -07:00
Matias Niemelä 97a1b399b7 test($animate): add tests for noop enaled and cancel methods 2014-08-28 11:31:21 -04:00
Brian Ford c6bde52006 docs(debugInfo): add docs for $compileProvider.debugInfoEnabled() 2014-08-27 20:45:59 -07:00
Vojta Jina 563be7e879 refactor(ngBind): name link and compile functions
For easier debugging.
2014-08-27 20:45:59 -07:00
Vojta Jina e0489abd8d perf($compile): add debug classes in compile phase
In a93f03d and d37f103 we changed the compiler and ngBind to add debugging CSS classes (i.e. ng-scope, ng-binding) in linking function. This simplified the code and made sense under the original assumptions that the debug info will be disabled by default. That is however not the case - debug info is enabled by default.

When debug info is enabled, this change improves the largetable-bp
benchmark by ~580ms, that is 30% faster.
Measuring the “create” phase, 25 loops, meantime ~1920ms -> ~1340ms.

This change does not affect performance when debug info is disabled.
2014-08-27 20:45:59 -07:00
Vojta Jina 2218e6f8cd refactor($compile): rename element -> $element
To follow our convention (at least in this file): if it’s
a jqLite/jQuery wrapper than the variable name starts with `$`.
2014-08-27 20:45:59 -07:00
Vojta Jina cec9ecf951 refactor($compile): $$addScopeInfo always expects jq wrapper
`$$addScopeInfo` used to accept either DOM Node or jqLite/jQuery
wrapper. This commit simplifies the method to always require
jqLite/jQuery wrapper and thus remove the `element.data` condition which
was wrong. If `element` was a raw comment element, the `data` property
was a string (the value of the comment) and an exception was thrown.
2014-08-27 20:45:59 -07:00
Vojta Jina 36a547b852 refactor: remove doReload arg used only for testing
We run unit tests in “strict” mode and thus can’t monkey-patch `window.location` nor `window.location.reload`. In order to avoid full page reload, we could pass location as argument, or another level of indirection, something like this:
```js
var ourGlobalFunkyLocation = window.location;
function reloadWithDebugInfo() {
  window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
  ourGlobalFunkyLocation.reload();
}

// in the test
ourGlobalFunkyLocation = {
  reload: function() {}
};
reloadWithDebugInfo();
ourGlobalFunkyLocation = window.location;
```

I don’t think any of these make sense, just so that we can test setting `window.name`. If the `reloadWithDebugInfo` function was more complicated, I would do it.

I don’t think it’s worthy to confuse production code with extra logic which purpose was only to make testing possible.
2014-08-27 20:45:59 -07:00
Vojta Jina b3ec730c42 refactor($compile): $$addBindingInfo accepts single expression or an array
Instead of knowing about `.expressions` property, it just accepts a single expression or an array of expressions.
2014-08-27 20:45:58 -07:00
Peter Bacon Darwin 2ab0d5d370 test(e2e): fix by.binding() locators
After upgrading, Protractor requires exact string that is used in the binding.
2014-08-27 20:45:58 -07:00
Vojta Jina ac68ee49c1 chore(deps): update protractor to 1.1.1 2014-08-27 20:45:58 -07:00
Peter Bacon Darwin be8ef25a5a chore(clean-shrinkwrap): chokidar is fixed since 0.8.2 2014-08-27 20:45:58 -07:00
Peter Bacon Darwin 41c1b8858f feat: add angular.reloadWithDebugInfo() 2014-08-27 20:45:58 -07:00
Vojta Jina fce8915f39 test(ngClass): dealoc elements 2014-08-27 20:45:58 -07:00
Vojta Jina d4dd5dfa18 test(input): dealoc elements 2014-08-27 20:45:58 -07:00
Peter Bacon Darwin a1e5cd5fe3 feat($compile): allow disabling scope info
The compiler adds scope information (`ng-scope` CSS class and `$scope` data property) to elements
when the are bound to the scope. This is mostly to aid debugging tools such as Batarang. In
production this should be unnecesary and adds a performance penalty.

In the bench/apps/largetable-bp this change caused an improvement of ~100ms (7%).

This can be now disabled by calling `$compileProvider.debugInfoEnabled(false)`
in a module `config` block:
```
someModule.config(['$compileProvider', function($compileProvider) {
  $compileProvider.debugInfoEnabled(false);
}]);
```

In the bench/apps/largetable-bp benchmark this change, with debug info disabled,
improved by ~120ms, that is ~10%.
Measuring the "create" phase, 25 loops, mean time ~1200ms -> ~1080ms.
2014-08-27 20:45:58 -07:00
Peter Bacon Darwin 3660fd0912 feat($compile/ngBind): allow disabling binding info
The compiler and ngBind directives add binding information (`ng-binding`
CSS class and `$binding` data property) to elements when they are bound to
the scope. This is only to aid testing and debugging for tools such as
Protractor and Batarang. In production this is unnecessary and add a
performance penalty.

This can be now disabled by calling `$compileProvider.debugInfoEnabled(false)`
in a module `config` block:
```
someModule.config(['$compileProvider', function($compileProvider) {
  $compileProvider.debugInfoEnabled(false);
}]);
```

In the bench/apps/largetable-bp benchmark this change, with debug info disabled,
improved by ~140ms, that is 10%.
Measuring the "create" phase, 25 loops, mean time ~1340ms -> ~1200ms.

We were storing the whole `interpolationFn` in the `$binding` data on
elements but this function was bringing a lot of closure variables with it
and so was consuming unwanted amounts of memory.

Now we are only storing the parsed interpolation expressions from the
binding (i.e. the values of `interpolationFn.expressions`).

BREAKING CHANGE:
The value of `$binding` data property on an element is always an array now
and the expressions do not include the curly braces `{{ ... }}`.
2014-08-27 20:45:58 -07:00
Matias Niemelä 4bca4c44b9 fix($animate): ensure guarded animations consider AJAX requests upon bootstrap
Prior to this fix when an Angular application is bootstrapped it would only
place an animation guard to prevent animations from running when the application
starts for the first two digest cycles. However, if any controllers or directives,
that are executed upon boostrap, trigger any remote code to be downloaded (via $http)
then the guard does not put that into consideration. This fix now properly addresses
that circumstance and removes the guard once all outbound HTTP requests are complete
when an Angular application is bootstrapped.

Closes #8275
Closes #5262
2014-08-27 23:19:29 -04:00
Matias Niemelä a70e2833ea feat($templateRequest): introduce the $templateRequest service
This handy service is designed to download and cache template contents
and to throw an error when a template request fails.

BREAKING CHANGE

Angular will now throw a $compile minErr each a template fails to download
for ngView, directives and ngMessage template requests. This changes the former
behavior of silently ignoring failed HTTP requests--or when the template itself
is empty. Please ensure that all directive, ngView and ngMessage code now properly
addresses this scenario. NgInclude is uneffected from this change.
2014-08-27 23:19:19 -04:00
Tobias Bosch 3be00df495 fix($browser): detect changes to the browser url that happened in sync
Closes #6976.
2014-08-27 16:36:53 -07:00
Zach Pomerantz 2efe1c2e7b docs(compile): translcuded -> transcluded
Oops.

Closes #8799
2014-08-27 17:14:44 -04:00
Igor Minar d8a02f9987 chore(build): uprade closure-compiler to v20140814
no significant change in code size
2014-08-27 13:57:36 -07:00
Igor Minar a4520a745d fix(Angular): remove duplicate nodeName_ references
I forgot to remove the variable declaration in previous nodeName_ commit.
2014-08-27 13:56:13 -07:00
Richard Harrington fe697527b4 docs(shallowCopy): add missing word 'are' and period.
Closes #8794
2014-08-27 08:38:35 -04:00
Caitlin Potter ea6fc6e69c feat($http): implement mechanism for coalescing calls to $apply in $http
When multiple responses are received within a short window from each other, it can be wasteful to
perform full dirty-checking cycles for each individual response. In order to prevent this, it is
now possible to coalesce calls to $apply for responses which occur close together.

This behaviour is opt-in, and the default is disabled, in order to avoid breaking tests or
applications.

In order to activate coalesced apply in tests or in an application, simply perform the following
steps during configuration.

   angular.module('myFancyApp', []).
     config(function($httpProvider) {
       $httpProvider.useApplyAsync(true);
     });

OR:

   angular.mock.module(function($httpProvider) {
     $httpProvider.useApplyAsync(true);
   });

Closes #8736
Closes #7634
Closes #5297
2014-08-26 21:42:47 -04:00
Caitlin Potter e94d454b84 feat($rootScope): implement $applyAsync to support combining calls to $apply into a single digest.
It is now possible to queue up multiple expressions to be evaluated in a single digest using
$applyAsync. The asynchronous expressions will be evaluated either 1) the next time $apply or
$rootScope.$digest is called, or 2) after after the queue flushing scheduled for the next turn
occurs (roughly ~10ms depending on browser and application).
2014-08-26 21:33:44 -04:00
Matias Niemelä 2ae4f40be1 feat(ngModel): provide validation API functions for sync and async validations
This commit introduces a 2nd validation queue called `$asyncValidators`. Each time a value
is processed by the validation pipeline, if all synchronous `$validators` succeed, the value
is then passed through the `$asyncValidators` validation queue. These validators should return
a promise. Rejection of a validation promise indicates a failed validation.
2014-08-26 18:31:01 -04:00
Matias Niemelä db044c408a fix(ngModel): treat undefined parse responses as parse errors
With this commit, ngModel will now handle parsing first and then validation
afterwards once the parsing is successful. If any parser along the way returns
`undefined` then ngModel will break the chain of parsing and register a
a parser error represented by the type of input that is being collected
(e.g. number, date, datetime, url, etc...). If a parser fails for a standard
text input field then an error of `parse` will be placed on `model.$error`.

BREAKING CHANGE

Any parser code from before that returned an `undefined` value
(or nothing at all) will now cause a parser failure. When this occurs
none of the validators present in `$validators` will run until the parser
error is gone.
2014-08-26 18:30:53 -04:00
Igor Minar 0e44ac2de0 refactor(hashKey): don't generate memory garbage
we now store both the object type and the id as the hashkey and return it for all objects.

for primitives we still have to do string concatination because we can't use expandos on them to
store the hashkey
2014-08-26 15:00:35 -07:00
Igor Minar 5a1a0c9622 perf(nodeName_): simplify the code and reduce the number of DOM calls 2014-08-26 15:00:35 -07:00
Igor Minar 4ebbd7e210 refactor(nodeName_): remove IE8 specific branch 2014-08-26 15:00:34 -07:00
Tobias Bosch 5f90340abb fix(input): allow to use seconds in input[time] and input[datetime-local]
The HTML5 spec allows to use seconds for `input[time]` and `input[datetime-local]`,
even though they are not displayed by all browsers.

Related to #8447.
2014-08-26 14:21:05 -07:00
Tobias Bosch cc6fc199f5 feat(input): allow to define the timezone for parsing dates
Angular used to always use the browser timezone when parsing
`input[date]`, `input[time]`, … The timezone can now be changed
to `UTC` via `ngModelOptions`.

Closes #8447.
2014-08-26 14:21:02 -07:00
Tobias Bosch 29f0b568de fix(input): use year 1970 instead of 1900 for input[time]
BREAKING CHANGE:

According to the HTML5 spec `input[time]` should create dates
based on the year 1970 (used to be based on the year 1900).

Related to #8447.
2014-08-26 14:20:55 -07:00
Tobias Bosch 4739b1d9da feat(filter): allow to define the timezone for formatting dates
Angular used to always use the browser timezone for
`dateFilter`. An additional parameter was added to allow to use
`UTC` timezone instead.

Related to #8447.
2014-08-26 14:20:49 -07:00
Tobias Bosch feed7d6944 chore(tests): use jquery again in e2e tests
jQuery was not included in e2e tests, but we did not notice it
as Angular fell back to jqlite…
2014-08-26 14:19:25 -07:00
Caitlin Potter 9da8d63ef4 docs($q): correct @ngdoc annotations for methods of $q
Closes #8782
Closes #8784
2014-08-26 17:11:37 -04:00
Jeff Cross 0462b688f9 chore($q): replace plain TypeError with minErr+TypeError in cyclical resolve check 2014-08-26 12:33:51 -07:00
Jeff Cross 1b331f3729 chore($q): convert thrown Error to $minErr when calling $q constructor without resolver 2014-08-26 12:09:26 -07:00
Jeff Cross a6bd4bc866 feat(minErr): allow specifying ErrorConstructor in minErr constructor
In some cases, the type of Error thrown by minErr is meaningful, such as in $q where a TypeError
is sometimes required. This fix allows providing an error constructor as the second argument to
minErr, which will be used to construct the error that gets returned by the factory function.
2014-08-26 12:09:26 -07:00
Matias Niemelä 23da614043 fix($animate): use $timeout to handle the delay within staggering animations
When transition-delay and animation-delay were used to drive the staggering
animation the result was unpredictable at times due to the browser not being
able to register the generated delay styles in time. This caused a hard to
track down bug that didn't have a solid solution when styles were being used.

This fix ensures that stagger delays are handled by the $timeout service.

Closes #7228
Closes #7547
Closes #8297
Closes #8547

BREAKING CHANGE

If any stagger code consisted of having BOTH transition staggers and delay staggers
together then that will not work the same way. Angular will now instead choose
the highest stagger delay value and set the timeout to wait for that before
applying the active CSS class.
2014-08-26 11:45:00 -04:00
Matias Niemelä bf0f5502b1 feat($animate): use promises instead of callbacks for animations
The $animate service (both the service inside of ng and ngAnimate) now
makes use of promises instead of callback functions.

BREAKING CHANGE

Both the API for the cancallation method and the done callback for
$animate animations is different. Instead of using a callback function
for each of the $animate animation methods, a promise is used instead.

```js
//before
$animate.enter(element, container, null, callbackFn);

//after
$animate.enter(element, container).then(callbackFn);
```

The animation can now be cancelled via `$animate.cancel(promise)`.

```js
//before
var cancelFn = $animate.enter(element, container);
cancelFn(); //cancels the animation

//after
var promise = $animate.enter(element, container);
$animate.cancel(promise); //cancels the animation
```
2014-08-26 11:44:25 -04:00
Matias Niemelä 2f4437b3a1 feat($animate): coalesce concurrent class-based animations within a digest loop
All class-based animation methods (addClass, removeClass and setClass) on $animate
are now processed after the next digest occurs. This fix prevents any sequencing
errors from occuring from excessive calls to $animate.addClass, $animate.remoteClass
or $animate.setClass.

BREAKING CHANGE

$animate.addClass, $animate.removeClass and $animate.setClass will no longer start the animation
right after being called in the directive code. The animation will only commence once a digest
has passed. This means that all animation-related testing code requires an extra digest to kick
off the animation.

```js
//before this fix
$animate.addClass(element, 'super');
expect(element).toHaveClass('super');

//now
$animate.addClass(element, 'super');
$rootScope.$digest();
expect(element).toHaveClass('super');
```

$animate will also tally the amount of times classes are added and removed and only animate
the left over classes once the digest kicks in. This means that for any directive code that
adds and removes the same CSS class on the same element then this may result in no animation
being triggered at all.

```js
$animate.addClass(element, 'klass');
$animate.removeClass(element, 'klass');

$rootScope.$digest();

//nothing happens...
```
2014-08-26 11:43:18 -04:00
Matias Niemelä d0b41890bf chore(ngAnimate): fix if statement whitespacing 2014-08-26 10:29:47 -04:00
grsmvg 7ef2921cae docs(form): add dollar sign back to setSubmitted()
Dollar sign was missing for setSubmitted() due to fc73256464, just
adding it back in ヽ(^。^)ノ

Closes #8772
2014-08-26 03:58:54 -04:00
Richard Harrington 5e15b11509 refactor($injector): remove unused strictDi argument from createInternalInjector
createInternalInjector does not specify the formal parameter `strictDi`, and instead uses the binding
from the parent function's formal parameters, making this parameter unnecessary.

Closes #8771
2014-08-26 01:37:44 -04:00
dennishall1 42f28751e0 docs(dateFilter): add example of string literals in format string
Also changes the wording to include the word "escaped" and "escape", which may help users find the
information they're looking for via searching. (ノ◕ヮ◕)ノ*:・゚✧

Closes #8770
2014-08-25 23:16:21 -04:00
Akhlesh b728030be0 docs(guide/directive): update since 'EA' is now the default restrict value
11f5aeeee9 changed the compiler to use 'EA' as a 'restrict'
value if not specified in the directive object, and the directive guide needed some slight
changes to address this.

Closes #8769
2014-08-25 22:53:08 -04:00
vdyckn 2e3a7fd3e9 docs(guide/directive) example79 ptor missing attr
Closes #8257
2014-08-25 12:28:33 -07:00
Jason Bedard fdf9989f7c perf($compile): only iterate over elements with link functions
Closes #8741
2014-08-25 11:02:48 -07:00
Richard Harrington addfc567fd refactor($injector): remove unused invoke queue variable
Closes #8755
2014-08-24 19:14:20 +02:00
Smith a9371a1875 docs(guide/di): correct spelling behinds > behind
Closes #8749
2014-08-23 16:37:07 -04:00
Pawel Kozlowski 8ac90357a6 fix($parse): properly handle dots at the end of identifiers
Fixes #4613
Fixes #4912
Closes #8559
2014-08-23 11:38:24 +02:00
Peter Bacon Darwin 525a8f851e docs($compile): fix grammar and specify version for deprecation 2014-08-23 07:07:38 +01:00
Brian Ford fc8d6d75ab docs(changelog): release notes for 1.2.23 superficial-malady 2014-08-22 15:57:26 -07:00
Brian Ford b93601e691 docs(changelog): release notes for 1.3.0-beta.19 rafter-ascension 2014-08-22 15:57:26 -07:00
Igor Minar 1a2caad922 chore(mocks): remove helper fn angular.mocks.clearData
we don't need this any more because Karma reloads the iframe after each test run

Related to #8532
Closes #8618
2014-08-22 15:30:34 -07:00
Tobias Bosch ffbd276d6d fix($compile): use the correct namespace for transcluded svg elements
Via transclusion, svg elements can occur outside an `<svg>` container in an
Angular template but are put into an `<svg>` container through compilation
and linking.

E.g.
Given that `svg-container` is a transcluding directive with
the following template:
```
<svg ng-transclude></svg>
```

The following markup creates a `<circle>` inside of an `<svg>` element
during runtime:
```
<svg-container>
  <circle></circle>
</svg-container>
```

However, this produces non working `<circle>` elements, as svg elements
need to be created inside of an `<svg>` element.

This change detects for most cases the correct namespace of transcluded content
and recreates that content in the correct `<svg>` container
when needed during compilation. For special cases it adds an addition argument
to `$transclude` that allows to specify the future parent node of elements
that will be cloned and attached using the `cloneAttachFn`.

Related to #8494
Closes #8716
2014-08-22 14:02:13 -07:00
Tobias Bosch 75c4cbf81f refactor($compile): rename directive.type to directive.templateNamespace
Also corrects the tests for MathML that use `directive.templateNamespace`.

BREAKING CHANGE (within 1.3.0-beta): `directive.type` was renamed to `directive.templateNamespace`

The property name `type` was too general.
2014-08-22 14:00:58 -07:00
Shahar Talmi 642af96c48 refactor(Angular): make NaN check in date equality cleaner
Closes #8718
2014-08-22 13:52:06 -07:00
Igor Minar 252e8b5733 revert: feat($compile): bind isolate scope properties to controller
This reverts commit 787c5a76dc.

This change causes a regression at Google. We'll take a better look at it
next week.

Reopens #7645
2014-08-22 11:48:29 -07:00
Igor Minar 0c4997f7d8 style: name anonymous fn that causes initial digest for better debugging/profiling 2014-08-22 11:46:45 -07:00
Caitlin Potter d713ad1b66 fix(ngRepeat): allow aliasAs identifiers which contain but do not match reserved words
Currently if a reserved word occurs anywhere within the aliasAs identifier, we throw. This CL fixes
this behaviour by allowing these identifiers, since they are technically perfectly valid.

Closes #8729
2014-08-22 09:50:22 -04:00
Jeff Cross 066c049957 fix(input): use lowercase method to account for undefined type 2014-08-22 00:35:35 -07:00
danrbergman 9352bdfdaf docs(guide/module): update tag in description
the reference to 'myApp' module changed in the example from <html> to a <div>. Updating description
to reflect the new <div> tag.

Closes #8720
2014-08-21 23:33:21 -04:00
danrbergman b8b8411b15 docs(guide/module): make the use of ng-app explicit in example
Helpful for people new to Angular to see the ng-app declaration in context with the expression
example. This will help illustrate the "Important thing to notice" point which follows: "The
reference to myApp module in <html ng-app="myApp">. This is what bootstraps the app using your
module."

Closes #8673
2014-08-21 22:28:15 -04:00
Sekib Omazic 693e846add fix(Angular): make Date comparison in equals() NaN-aware
Make angular.equals() Date comparison NaN-aware to prevent infinite digest errors when a dealy watched
date has an invalid value.

Closes #8650
Closes #8715
2014-08-21 21:17:21 -04:00
Jeff Cross fdeaa74c6c chore(shrinkwrap): add angular-benchpress to shrinkwrap 2014-08-21 16:49:01 -07:00
Caitlin Potter 09de7b5db4 feat($compile): use allOrNothing interpolation for ngAttr*
allOrNothing interpolation is now used for ng-attr-*, under all circumstances. This prevents
uninitialized attributes from being added to the DOM with invalid values which cause errors
to be shown.

BREAKING CHANGE:

Now, ng-attr-* will never add the attribute to the DOM if any of the interpolated expressions
evaluate to `undefined`.

To work around this, initialize values which are intended to be the empty string with the
empty string:

For example, given the following markup:

    <div ng-attr-style="border-radius: {{value}}{{units}}"></div>

If $scope.value is `4`, and $scope.units is undefined, the resulting markup is unchanged:

    <div ng-attr-style="border-radius: {{value}}{{units}}"></div>

However, if $scope.units is `""`, then the resulting markup is updated:

    <div ng-attr-style="border-radius: {{value}}{{units}}" style="border-radius: 4"></div>

Closes #8376
Closes #8399
2014-08-21 19:31:50 -04:00
Caitlin Potter a7fb357fa1 fix(input): by default, do not trim input[type=password] values
Do not trim input[type=password] values

BREAKING CHANGE:

Previously, input[type=password] would trim values by default, and would require an explicit ng-trim="false"
to disable the trimming behaviour. After this CL, ng-trim no longer effects input[type=password], and will
never trim the password value.

Closes #8250
Closes #8230
2014-08-21 19:11:57 -04:00
Caitlin Potter 09b298705f fix(ngRepeat): make allowed aliasAs expressions more strict
Ensure that aliasAs expressions are valid simple identifiers. These are still assigned to $scope in the same way
that they were previously, however now you won't accidentally create a property named "filtered.collection".

This change additionally restricts identifiers to prevent the use of certain ECMAScript reserved words ("null",
"undefined", "this" --- should probably add "super", "try", "catch" and "finally" there too), as well as certain
properties used by $scope or ngRepeat, including $parent, $index, $even, $odd, $first, $middle, or $last.

Closes #8438
Closes #8440
2014-08-21 18:58:54 -04:00
Caitlin Potter b674003f41 chore(protractor): enable testing ng-app-included examples
/cc @petebacondarwin / @juliemr please review :>

Blocks #8673
Closes #8677
2014-08-21 18:54:44 -04:00
Caitlin Potter 787c5a76dc feat($compile): bind isolate scope properties to controller
It is now possible to ask the $compiler's isolate scope property machinery to bind isolate
scope properties to a controller rather than scope itself. This feature requires the use of
controllerAs, so that the controller-bound properties may still be referenced from binding
expressions in views.

The current syntax is to prefix the scope name with a '@', like so:

    scope: {
        "myData": "=someData",
        "myString": "@someInterpolation",
        "myExpr": "&someExpr"
    },
    controllerAs: "someCtrl",
    bindtoController: true

The putting of properties within the context of the controller will only occur if
controllerAs is used for an isolate scope with the `bindToController` property of the
directive definition object set to `true`.

Closes #7635
Closes #7645
2014-08-21 18:41:19 -04:00
Casey Flynn dfbe69c45a docs($interval): fix typo in example
It's not "nis", it's "is"! 〜( ̄▽ ̄)〜

Closes #8711
2014-08-21 15:29:02 -04:00
Lucas Galfaso 1339c11e36 refactor($q): make $q Promises A+ v1.1 compilant
The Promises A+ 1.1 spec introduces new constraints that would cause $q to fail,
particularly specs 2.3.1 and 2.3.3.

Newly satisfied requirements:

 * "then" functions that return the same fulfilled/rejected promise
	will fail with a TypeError
 * Support for edge cases where "then" is a value other than function

Full 1.1 spec: https://github.com/promises-aplus/promises-spec/tree/1.1.0

This commit also modifies the adapter to use "resolve" method instead of "fulfill"
2014-08-21 10:52:08 -07:00
Caitlin Potter a603e202cc fix(copy): clear array destinations correctly for non-array sources
Closes #8610
Closes #8702
2014-08-20 21:49:54 -04:00
Jeff Cross 0872388a1b fix(minErr): encode btstrpd error input to strip angle brackets
The $sanitize service was returning an empty string to the error page
because the input was usually a single html tag (sometimes it could be
`document`). This fix replaces angle brackets with html entities.

Closes #8683
2014-08-20 17:26:50 -07:00
Caitlin Potter 36230194be fix(forEach): match behaviour of Array.prototype.forEach (ignore missing properties)
Array.prototype.forEach will not invoke the callback function if the properety is not present in the
object. Because of this, we have the illusion of not iterating over non-added properties in a sparse
array.

From ECMAScript:

9. Repeat while k < len
     a. Let Pk be ToString(k).
     b. Let kPresent be HasProperty(O, Pk).
     c. ReturnIfAbrupt(kPresent).
     d. If kPresent is true, then
            i. Let kValue be Get(O, Pk)
            ... (steps for invoking the function and aborting if it throws)

Closes #8510
Closes #8522
Closes #8525
2014-08-20 19:27:49 -04:00
Henrik Nyh 14b3db369e docs(ngDisabled): clarify "don't do this" example
It's not clear until you read the whole thing that it's an explanation
of what *not* to do and why, so if you scan the page from the top, you
may use this bad solution.
2014-08-20 15:44:23 -07:00
Brian Ford a9d227120d fix(linky): handle quotes around email addresses
Closes #8520
2014-08-20 13:37:45 -07:00
mishoo78 05791c0133 docs(ngMock): note that inject/module helpers only defined for jasmine / mocha
Closes #8694
2014-08-20 13:43:14 -04:00
Ole Weitz 00d5fde49c docs($cacheFactory): prevent example breaking on key update
The example for $cacheFactory breaks when a user tries to update a value for a key.
Setting a new value for an existing key results in duplicate key entries in the key array, thus
breaking the ng-repeat directive. With this fix the key is only added if it isn't contained in the
cache.

Closes #8214
2014-08-20 10:48:29 -04:00
Izhaki 39f6e229c2 docs($compile): fix documentation for ?^ controller search
Fixed typo: 'parents parents' to 'parents'

Closes #8690
2014-08-20 09:31:17 -04:00
Igor Minar 8863b9d04c perf($parse): don't bind filters to a context
This change gives us ~10% boost in Chrome, less or nothing in other browsers.

BREAKING CHANGE:  `this` in filters is now undefined and no longer the scope

It's a bad practice for filters to have hidden dependencies, so pulling stuff from scope directly
is not a good idea. Scope being the filter context was never documented as public api, so we don't
expect that any significant code depends on this behavior.

If an existing filter has a dependency on the scope instance, the scope reference can
be passed into the filter as a filter argument (this is highly discouraged for new code):

Before: `{{ user.name | customFilter }}`
After: `{{ user.name | customFilter:this }}`
2014-08-19 20:56:57 -07:00
Caitlin Potter d18b281976 fix($location): rewrite relative URI correctly if path==='/' in legacy html5Mode
Currently, legacy browsers get to use a clever scheme for resolving relative URIs in html5Mode,
and resolve the URI relative to $location.path().

Currently, $location.path() can be '/' under certain circumstances, which means that when we
split $location.path() on '/' and later join by '/' after adding another path component,
we end up with '//pathComponent'. $$rewrite fails to deal with this correctly, and effectively
the $location is never changed from the root path.

This CL corrects this by ensuring that the duplicate '/' situation does not occur when resolving
relative URIs.

Closes #8684
2014-08-19 21:31:02 -04:00
Jason Bedard f02f7d9c15 fix($compile): update the jQuery .context when an element is replaced by replace:true directive
.context is a deprecated jQuery api still being used by at least live() queries, so
we need to keep it in up to date during replacement.

Because of the if check, we can be sure that we replace the context only when jQuery is being
used and the context property is set to the element being replaced.

Closes #8253
Closes #7900
2014-08-19 17:24:34 -07:00
Lucas Galfaso 7eae29e5ab perf($rootScope): do not use Function::call when not needed
When a `$watchGroup` delegates the call to a `$watch`, there is no
need to keep the context of `this`
2014-08-20 00:57:31 +01:00
Lucas Galfaso 94b5c9f00e perf($interpolate): do not keep empty separators
Do not keep empty separators and keep references to where
each expression goes
2014-08-20 00:57:31 +01:00
Caitlin Potter 5b77e30c1a fix($location): don't call indexOf() of undefined href attribute
Closes #7721
Closes #8681
2014-08-19 19:16:02 -04:00
Brian Ford b7e82a33ee fix($sanitize): sanitize javascript urls with comments
Closes #8274
2014-08-19 14:10:54 -07:00
Marty Kane 6fdaa3d5a6 docs(guide/di): correct a few awkward sentences
Closes #8678
2014-08-19 16:50:48 -04:00
Izhaki d250dd43a3 docs($compile): correct documentation for directive controller ^ notation
`^` searches the element and its parents, not exclusively the element's parents. This confuses
a lot of people :(

Closes #8622
2014-08-19 14:30:11 -04:00
Shahar Talmi b8e54ef572 docs(*): use @description instead of @returns for properties
Dgeni-packages was not actually rendering the `@returns` text.

Closes #8639
2014-08-19 14:24:48 -04:00
Igor Minar e3a2ecf0db revert: refactor($compile): automatically append end comment nodes to all element-transclusion templates
This reverts commit 0d608d041f.

The commits caused more breaking changes at Google than initially expected and since its
benefit is small, so it's not worth keeping.
2014-08-19 10:57:50 -07:00
Baptiste Fontaine 63249a0aaf docs(ngBind): irrelevant text removed from ngBindHtml’s example
The ngBindHtml’s example had a copied line from ngBindTemplate’s that’s irrelevant here.

Closes #8668
2014-08-19 12:38:31 -04:00
Igor Minar 28b54bbfbf test(jqLite): add test for #wrap() when mutliple elements are being wrapped 2014-08-18 21:50:54 -07:00
chrisrhoden 77d3e75446 fix(jqLite): clone wrapNode in jqlite/wrap
Change jqLite's implementation of wrap() to clone the wrapNode before
wrapping the target element in it.
Match jQuery's wrap() behavior and prevent accidentally attaching
target element to the DOM as a side effect.

Closes #3860
Closes #4194
2014-08-18 21:50:44 -07:00
Igor Minar 1bdca93d70 fix(jqLite): revert the #ready() optimization until jQuery does the same
The change unfortunatelly makes us incompatible with jQuery which always falls back to onLoad.

Not falling back to onLoad is a possible breaking change because if Angular was added to the document during DOMContentLoaded
document.readyState at this point is 'interactive' which we'd need to add to our check, but more importantly if more scripts
are added during DOMContentLoaded these won't be loaded before we bootstrap, which can cause angular modules not to be found
during bootstrap.

This load ordering issues is really just a cornercase that should be handled via manual bootstrap, but until jQuery has the same
behavior we shouldn't do something else.
2014-08-18 21:20:12 -07:00
Igor Minar bf1a57ad48 fix(Scope): don't clear the phase when an exception is thrown from asyncQueue or watch
If we clear it here, then any other watch or async task could start a new digest.
2014-08-18 21:20:12 -07:00
Igor Minar ece6ef479c perf($parse): optimize filter implementation
- generate less garbage
- optimize argument collection
- use call instead of apply for no arg case (2x boost)
2014-08-18 21:20:12 -07:00
Igor Minar f7fde04160 style($parse): small readability improvements 2014-08-18 21:20:12 -07:00
Igor Minar 472019fb32 chore($parse): name anonymous functions for better debugging 2014-08-18 21:20:11 -07:00
Igor Minar a17578ad3d perf($parse): speed up fn invocation for no args case 2014-08-18 21:20:11 -07:00
Igor Minar cc16340e88 refactor($parse): small readability improvements 2014-08-18 21:20:11 -07:00
Igor Minar fecfc5b09f perf($parse): speed up fn invocation by optimizing arg collection
8-15% improvement for depending on the number of args
2014-08-18 21:20:11 -07:00
Igor Minar 6f5fc557ad refactor(jqLite): simplify jqLiteAddNodes when multiple nodes are being added
This branch is not as hot as the single node branch and the slice that we need for old webkit/phantom makes for loop preferable.
2014-08-18 21:20:11 -07:00
Igor Minar 0d608d041f refactor($compile): automatically append end comment nodes to all element-transclusion templates
Previously we would do it manually in all of our structural directives.

BREAKING CHANGE: element-transcluded directives now have an extra comment automatically appended to their cloned DOM

This comment is usually needed to keep track the end boundary in the event child directives modify the root node(s).
If not used for this purpose it can be safely ignored.
2014-08-18 21:20:11 -07:00
Igor Minar b5714ce1df refactor(ngRepeat): simplify previousNode boundary calculation
the previousNode was almost always correct except when we added a new block in which case incorrectly
assigned the cloned collection to the variable instead of the end comment node.
2014-08-18 21:20:11 -07:00
Igor Minar 27d4a4f0ca chore(ngRepeat): improve inline comments 2014-08-18 21:20:10 -07:00
Igor Minar 5cec4612c4 chore(ngRepeat): fix typo in a comment 2014-08-18 21:20:10 -07:00
Igor Minar 08eb05583b perf(ngRepeat): simplify code and remove duplicate array.length access
minimal perf gain (~2ms)
2014-08-18 21:20:10 -07:00
Igor Minar 2ef25887ef perF($compile): don't create jq wrapper for linkNode needlesly
when compileNode and linkNode are the same, we can reuse the existing jqLite wrapper.
2014-08-18 21:20:10 -07:00
Igor Minar f8f7a1df34 perf(jqLite): simplify jqLiteDealoc
while querySelectorAll is much more expensive than getElementsByTagName on elements with
both many and few children, cloning the live node list returned by getElementsByTagName
makes it as expensive as querySelectorAll (we need to clone because we need the node list
not to change while we iterate over it).

the childNodes and childNodes.length check is as expensive as querySelectorAll on a node
without any children, so it only makes the whole lookup 2x as slow, so I'm removing it.
2014-08-18 21:20:10 -07:00
Igor Minar b5f7970be5 perf($compile): don't register $destroy callbacks on element-transcluded nodes
This is a major perf win in the large table benchmark (~100ms or 9).

This cleanup is needed only for regular transclusion because only then the DOM hierarchy doesn't match scope hierarchy
(transcluded scope is a child of the parent scope and not a child of the isolate scope)

We should consider refactoring this further for the case of regular transclusion
and consider using scope events instead.
2014-08-18 21:20:10 -07:00
Igor Minar d05f27e274 perf(jqLite): optimize event handler 2014-08-18 21:20:09 -07:00
Igor Minar b0571517c5 refactor(isArray): use Array.isArray exclusively
IE9 supports Array.isArray so we don't need a polyfill any more.
2014-08-18 21:20:09 -07:00
Pawel Kozlowski c093c43b1f docs(orderBy): clarify expression usage in a predicate
Closes #8592
2014-08-18 13:32:09 -07:00
Tom Kadwill e1c85d1f98 docs(tutorial/index): improve wording
Removed repetition of 'machine' and 'local machine'.
I think this change makes the sentence more concise
2014-08-18 13:23:09 -07:00
Ciro Nunes 5feb9ab0f8 docs($compile): change restrict's defaults to EA
restrict defaults are EA let's update the docs
2014-08-18 13:12:11 -07:00
Jeff Cross 22bece7311 test(benchmark): add jQuery no-op script to large table benchmark 2014-08-18 11:00:23 -07:00
Jeff Sheets 65ec0ab70a docs($http): correct link to "salt (cryptography)" wikipedia article
Closes #8654
2014-08-18 13:34:07 -04:00
Caitlin Potter 6133c63214 docs(misc/contribute): fix syntax highlighting of URLS
Closes #8168
Closes #8169
2014-08-17 21:13:30 -04:00
Caitlin Potter 187b1b8ef4 perf(jqLite): only take str.split() path when needed
bda673f8e7 changed code to only use `str.split()` when necessary,
but the result was that `str.split()` would always be taken unless ' ' was the first character
in the string, negating the effectiveness of the perf fix.

Closes #8648
2014-08-17 17:49:42 -04:00
Igor Minar b24e381427 style(shallowCopy): use common for loop style 2014-08-16 22:32:35 -07:00
Igor Minar e3f26b5a6b style(jqLite): use the common for loop code style 2014-08-16 22:29:00 -07:00
Igor Minar c1cb341c87 refactor($compile): simplify controllersBoundTransclude check
no measurable perf difference, but the code more simple and minifies better
2014-08-16 22:10:04 -07:00
Igor Minar 0605e612e1 chore(angular.suffix): fix typo 2014-08-16 22:09:56 -07:00
Igor Minar 645625cf34 perf($compile): refactor publicLinkFn to simplify the code and use 'for in' loop 2014-08-16 22:09:48 -07:00
Igor Minar e822e9061c perf(Scope): optimize $watchCollection when used for watching objects
Since we control the oldValue, we don't need to worry about proto-inhereted properties which means we can use
'for in' and skip hasOwnProperty checks.

http://jsperf.com/for-in-vs-object-keys2
2014-08-16 22:09:38 -07:00
Igor Minar 301463a2e2 perf(Scope): don't use forEach in
doesn't make any significant impact on our current benchmarks because we don't have benchmarks with
many scope events, but this is a straightforward change worth doing
2014-08-16 22:09:29 -07:00
Igor Minar 7d96ab0d13 perf(Scope): watchCollection optimization
tiny ~4ms improvement and code that minifies better
2014-08-16 22:09:21 -07:00
Igor Minar 0a738ce176 perf(ngBind): bypass jquery/jqlite when setting text 2014-08-16 22:08:59 -07:00
Igor Minar d208ba2544 perf(isObject): use strict comparison
this is a micro-optimization based on http://jsperf.com/isobject4

no significant improvement in macro-benchmarks, but since it makes the code better it makes
sense making this change.
2014-08-16 22:06:14 -07:00
Igor Minar de3f238764 chore(test): rename getBlockElements to getBlockNodes in .jshintrc for tests 2014-08-16 22:00:10 -07:00
Igor Minar d302ea0cfa perf($parse): use no-proto maps as caches and avoid hasOwnProperty checks 2014-08-16 21:59:38 -07:00
Igor Minar a09fa35641 perf(Scope): exit $broadcast early if nobody is listening for the given event 2014-08-16 21:52:10 -07:00
Igor Minar 36e35b2cb1 perf(ngRepeat): optimize marking of nodes that are being removed via an animation 2014-08-16 21:52:04 -07:00
Igor Minar 13d113c522 perf(ngRepeat): use no-proto objects for blockMaps 2014-08-16 21:51:56 -07:00
Igor Minar 215d9545dc style(ngRepeat): ws and indentation fixes 2014-08-16 21:51:49 -07:00
Igor Minar bdd853cb83 perf(ngRepeat): move work to compile fn
this has impact only on nested repeaters where the number of columns is significant
2014-08-16 21:51:40 -07:00
Igor Minar e58d65a520 perf(ngRepeat): move updateScope fn to factory and reuse it for all repeaters 2014-08-16 21:51:33 -07:00
Igor Minar fbd48845e0 perf(ngRepeat): clone boundary comment nodes
http://jsperf.com/clone-vs-createcomment

most of the improvement comes from not reconcatinating the strings
2014-08-16 21:51:27 -07:00
Igor Minar abb17cce8b perf(jqLite): optimize off()
'for in' is much faster than Object.keys() and since the events object is ours, we know
that we don't need to worry about prototypically inherited properties so we can skip
expensive hasOwnProperty check.

http://jsperf.com/for-in-vs-object-keys2
2014-08-16 21:51:17 -07:00
Igor Minar 3e0a2e1f33 perf($compile): clone the nodeList during linking only if necessary 2014-08-16 21:51:06 -07:00
Igor Minar 1e8698b33e perf(jqLite): refactor jqLiteExpandoStore to minimize access to expensive element.ng339 expando property 2014-08-16 21:50:27 -07:00
Igor Minar 503dcb0281 style(jqLite): rename onFn to jqLiteOn 2014-08-16 21:31:41 -07:00
Igor Minar bf2e238418 refactor(jqLite): clean up jqLiteRemoveData fn 2014-08-16 21:31:35 -07:00
Igor Minar 8b77161702 refactor(Scope): remove useless compileToFn helper fn 2014-08-16 21:31:20 -07:00
Igor Minar 50e16a67bb refactor(Scope): rename $$childScopeClass to ChildClass to simplify debugging/profiling 2014-08-16 21:31:17 -07:00
Igor Minar b9b1aa7797 refactor($parse): simplify addInterceptor fn 2014-08-16 21:30:49 -07:00
Igor Minar a1341223c0 perf($parse): trim expression only if string 2014-08-16 21:30:44 -07:00
Igor Minar 99d70af11c style($parse): rename variables in generated code so that code is more readable 2014-08-16 21:30:38 -07:00
Igor Minar 6acea1152f fix($parse): remove unused variable declaration in generated getters 2014-08-16 21:30:32 -07:00
Igor Minar 33ab57948c style(ngRepeat): fix indentation 2014-08-16 21:30:27 -07:00
Igor Minar 31ed0af74b perf($compile): delay object initialization in nodeLinkFn 2014-08-16 21:30:20 -07:00
Igor Minar 13112710e6 refactor: remove unused variables 2014-08-16 21:30:07 -07:00
Igor Minar 54fa16e45d perf: speed up shallowCopy and special case Attributes cloning
`for in` is much faster than `Object.keys()` but `for in` includes properties from the prototype.

http://jsperf.com/for-in-vs-object-keys2

All the uses of shallowCopy don't deal with objects with heavy prototypes, except for Attributes instances
in $compile.

For this reason it's better to special-case Attributes constructor and make it do it's own shallow copy.
This cleans up the Attribute/$compile code as well.
2014-08-16 21:29:51 -07:00
Igor Minar fb00210cb6 refactor(shallowCopy): microoptimization 2014-08-16 21:01:13 -07:00
Igor Minar fafbd49490 perf(jqLite): microoptimization in chaining fn
note: no siginificant difference observed in macrobenchmarks, so this is just to make
me feel better :)
2014-08-16 21:01:13 -07:00
Igor Minar bda673f8e7 perf(jqLite): don't use String#split in on() unless we need it 2014-08-16 21:01:13 -07:00
Igor Minar b678f314f1 refactor(jqLite): don't look up the entry needlessly 2014-08-16 21:01:13 -07:00
Igor Minar 550965f111 style(jqLite): remove MiskoCode(tm) 2014-08-16 21:01:13 -07:00
Igor Minar 443b521e22 perf(jqLite): don't check isString many times in constructor
Note: no significant perf gain in Chrome
2014-08-16 21:01:12 -07:00
Igor Minar e6a9f9e130 refactor: simplify trim fn now that IE9 has String#trim 2014-08-16 21:01:12 -07:00
Igor Minar 441ab5235c refactor: rename getBlockElements to more correct getBlockNodes 2014-08-16 21:01:11 -07:00
Igor Minar 6b7b40af74 style(ngBind): name anonymous link fn to ease debugging/profiling 2014-08-16 15:38:50 -07:00
Igor Minar edc586f911 refactor(ngBindHtml): improve readability of the code 2014-08-16 15:36:32 -07:00
Igor Minar c7393093ff refactor(ngRepeat): name anonymous transclude callback for better debugging 2014-08-16 15:32:43 -07:00
Igor Minar b493c62f6b perf(jqLite): optimize jqLiteAcceptsData method
This doesn't show up too high in profiles, but this code is cleaner anyway
2014-08-16 15:32:32 -07:00
Igor Minar 35134a0e23 perf($compile): optimize nodeLinkFn
Functions with try/catch block can't be optimized, so we can
move the try/catch block into a tiny fn and make it possible for the
complex nodeLinkFn to get optimized.
2014-08-16 15:32:24 -07:00
Igor Minar 8d933bf995 perf(jqLite): optimize append() and after() 2014-08-16 15:31:10 -07:00
Igor Minar 6251751ad7 perf(jqLite): don't register DOM listener for $destroy event
This even is fired purely within jqLite/jQuery so it doesn't make sense to register DOM listener here.

6% improvement in large table benchmark for both creation and destruction
2014-08-16 15:05:22 -07:00
Igor Minar 8f10dca300 refactor(jqLite): remove legacy code to support IE8 and older 2014-08-16 15:05:22 -07:00
Igor Minar 566f1015d2 perf(jqLite): optimize event listener registration 2014-08-16 14:31:29 -07:00
Igor Minar 274e9c4ddf perf($compile): optimize publicLinkFn 2014-08-16 14:31:29 -07:00
Igor Minar e9cd6dc055 perf(jqLite): improve createEventHandler method by switching from forEach to for loop 2014-08-16 14:31:29 -07:00
Igor Minar 960a841051 perf(jqLite): don't use forEach in #off
off() is called on each element removal, so we want to make it as fast as possible
2014-08-16 14:31:28 -07:00
Igor Minar 01b10d7a24 refactor(jqLite): remove code duplication 2014-08-16 14:31:28 -07:00
Igor Minar 2a5dbbdc52 refactor(jqLite): don't recreate mouse event map 2014-08-16 14:31:28 -07:00
Igor Minar 6c4d601ff6 refactor(jqLite): drop Node.contains polyfill
Node.contains is supported on IE5+ and all the other browsers we care about.
2014-08-16 14:31:24 -07:00
Igor Minar d1536e7c8b perf(jqLite): don't recreate the Node.contains polyfill 2014-08-16 14:22:56 -07:00
Ken Sheedlo a19131494c style($rootScope): add semicolon for jshint 2014-08-15 17:17:55 -07:00
Tobias Bosch a353ed834c refactor(perf): migration event delegation benchmark to benchpress 2014-08-15 16:03:59 -07:00
rodyhaddad bf0e83732a fix($watchGroup): call listener once when the watchExpressions array is empty 2014-08-15 15:53:51 -07:00
Igor Minar 0554c1aae4 chore(Scope): remove deregisterNotifier feature for $watch
We no longer have a need for this feature that was added to primarily support
$watchGroup (see previous commit).

BREAKING CHANGE: deregisterNotifier callback for $watch is no longer available

This api was available only in the last few 1.3 beta versions and is not
very useful for applications, so we don't expect that anyone will be affected
by this change.
2014-08-15 15:53:51 -07:00
Igor Minar 3f0e642eef perf(Scope): use remove the need for the extra watch in $watchGroup
Instead of using a counter and an extra watch, just schedule the reaction function via .

This gives us the same/similar ordering and coalecsing of updates as counter without the extra
overhead. Also the code is easier to read.

Since interpolation uses watchGroup, this change additionally improves performance of interpolation.

In large table benchmark digest cost went down by 15-20% for interpolation.

Closes #8396
2014-08-15 15:53:51 -07:00
J. Bruni 1a05daf5dc feat(jqLite): implement the detach method
Closes #5461
2014-08-14 21:19:44 +02:00
Michał Gołębiowski b9389b26ba fix(jQuery): cooperate with other libraries monkey-patching jQuery.cleanData
Some libraries (like jQuery UI) patch jQuery.cleanData as well. This commit
makes Angular work correctly even if such external patching was done after
the Angular one.

Fixes #8471
2014-08-14 21:09:13 +02:00
Jeff Cross 6bdaa4bc21 feat(benchpress): configure benchpress grunt task 2014-08-13 23:28:13 -07:00
Jeff Cross bfd311174d docs(benchpress): add readme with instructions on using benchpress 2014-08-13 23:28:13 -07:00
Jeff Cross 1229334fbd perf(benchpress): add benchpress node module and port over large table test 2014-08-13 23:28:13 -07:00
Jack Wearden 77a1acc7fc feat(ngRoute): add method for changing url params
Add a $route#updateParams method for changing the current route
parameters without having to build a URL and call $location#path.
Useful for apps with a structure involving programmatically moving
between pages on the current route, but with different :param
values.

Properties in the object passed to $route.updateParams() will be
added to the location as queryParams if not contained within the
route's path definition.
2014-08-13 14:11:58 -07:00
Namolovan Nicolae 56bd0378bf docs(guide/e2e-testing): correct link to protractor's getting started
angular/protractor@fcd973b#diff-f3b56000093113bd3bfb6c9c05e7e945 splits the overview doc into
multiple files, and removes overview.md from the repository entirely, making the current link a 404.

This CL points the link to the new getting-started document rather than the overview, and avoids
linking to a missing document.

Closes #8595
2014-08-13 13:20:27 -04:00
Peter Bacon Darwin 76e57a764f chore(doc-gen): move e2e tests into docs folder
These tests didn't really fit in the test folder as the docs app is mostly
a separate entity from the AngularJS codebase.
2014-08-13 11:24:19 +01:00
Caitlin Potter f30e2d093b docs(CHANGELOG.md): fix typo, it's 1.2.22 not 1.2.2!
Whoops!
2014-08-12 16:51:40 -04:00
Caitlin Potter b33716f42a docs(CHANGELOG.md): add changelog for v1.3.0-beta.18 and v1.2.22
Closes #8581
2014-08-12 13:16:32 -04:00
1732 changed files with 352730 additions and 75843 deletions
-4
View File
@@ -1,4 +0,0 @@
{
"directory": "bower_components",
"json": "bower.json"
}
+509
View File
@@ -0,0 +1,509 @@
# Configuration file for https://circleci.com/gh/angular/angular.js
# Note: YAML anchors allow an object to be re-used, reducing duplication.
# The ampersand declares an alias for an object, then later the `<<: *name`
# syntax dereferences it.
# See http://blog.daemonl.com/2016/02/yaml.html
# To validate changes, use an online parser, eg.
# http://yaml-online-parser.appspot.com/
# CircleCI configuration version
# Version 2.1 allows for extra config reuse features
# https://circleci.com/docs/2.0/reusing-config/#getting-started-with-config-reuse
version: 2.1
# Workspace persisted by the `setup` job to share build artifacts with other jobs.
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
var_workspace_location: &workspace_location ~/
# Executor Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors
# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version.
# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.)
executors:
default-executor:
parameters:
resource_class:
type: string
default: medium
docker:
- image: circleci/node:14.16.1@sha256:b094e85848b43209ca83d9bb114d406fe62c75cb73b18c9d8eb1a9c6462c97d4
resource_class: << parameters.resource_class >>
working_directory: ~/ng
cloud-sdk:
description: The docker container to use when running gcp-gcs commands
docker:
- image: google/cloud-sdk:alpine@sha256:7d0cae28cb282b76f2d9babe278c63c910d54f0cceca7a65fdf6806e2b43882e
working_directory: ~/ng
# Filter Definitions
# Filter to run a job on all branches and any `v1.X.Y(-Z)` tags.
# Since the jobs need to run on tagged builds too, a `tags` section has to be explicitly specified.
# (The `branches` section could be omitted, since it defaults to all branches - just being explicit
# here).
# See also https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag.
var-filter-run-always: &run-always
filters:
branches:
only: /.*/
tags:
only: /v1\.\d+\.\d.*/
# Filter to run a job when code might need to be deployed - i.e. on builds for the `master` branch.
# (Further checks are needed to determine whether a deployment is actually needed, but these are not
# possible via filters.)
var-filter-run-on-master: &run-on-master
filters:
branches:
only:
- master
tags:
ignore: /.*/
# Filter to run a job when code/docs might need to be deployed - i.e. on tagged builds and on builds
# for master and `v1.*.x` branches.
# (Further checks are needed to determine whether a deployment is actually needed, but these are not
# possible via filters.)
var-filter-run-on-tags-and-master-and-version-branches: &run-on-tags-and-master-and-version-branches
filters:
branches:
only:
- master
- /v1\.\d+\.x/
tags:
only: /v1\.\d+\.\d.*/
# Filter to run a job when docs might need to be deployed - i.e. on builds for `v1.*.x` branches,
# which might correspond to the stable branch.
# (Further checks are needed to determine whether a deployment is actually needed, but these are not
# possible via filters.)
var-filter-run-on-version-branches: &run-on-version-branches
filters:
branches:
only:
- /v1\.\d+\.x/
tags:
ignore: /.*/
# Command Definitions
# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands
commands:
skip_on_pr_and_fork_builds:
description: Skip a job on pull request and fork builds
steps:
- run:
name: Skip this job if this is a pull request or fork build
# Note: Using `CIRCLE_*` env variables (instead of those defined in `env.sh` so that this
# step can be run before `init_environment`.
command: >
if [[ -n "$CIRCLE_PR_NUMBER" ]] ||
[[ "$CIRCLE_PROJECT_USERNAME" != "angular" ]] ||
[[ "$CIRCLE_PROJECT_REPONAME" != "angular.js" ]]; then
echo "Skipping this job, because this is either a pull request or a fork build."
circleci step halt
fi
skip_unless_stable_branch:
description: Skip a job unless this is the stable branch
steps:
- run:
name: Skip this job unless this is the stable branch
command: >
if [[ "$DIST_TAG" != "latest" ]]; then
echo "Skipping deployment, because this is not the stable branch."
circleci step halt
fi
skip_unless_tag_or_master_or_stable_branch:
description: Skip a job unless this is a tag or the master or stable branch
steps:
- run:
name: Skip this job unless this is a tag or the master or stable branch
command: >
if [[ "$CI_GIT_TAG" == "false" ]] &&
[[ "$CI_BRANCH" != "master" ]] &&
[[ "$DIST_TAG" != "latest" ]]; then
echo "Skipping this job, because this is neither a tag nor the master or stable branch."
circleci step halt
fi
custom_attach_workspace:
description: Attach workspace at a predefined location
steps:
- attach_workspace:
at: *workspace_location
# Java is needed for running the Closure Compiler (during the `minall` task).
install_java:
description: Install java
steps:
- run:
name: Install java
command: |
sudo apt-get update
# Install java runtime
sudo apt-get install default-jre
# Initializes the CI environment by setting up common environment variables.
init_environment:
description: Initializing environment (setting up variables)
steps:
- run:
name: Set up environment
environment:
CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >>
CIRCLE_GIT_REVISION: << pipeline.git.revision >>
command: ./.circleci/env.sh
- run:
# Configure git as the CircleCI `checkout` command does.
# This is needed because we only checkout on the setup job.
# Add GitHub to known hosts
name: Configure git
command: |
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
init_saucelabs_environment:
description: Sets up a domain that resolves to the local host.
steps:
- run:
name: Preparing environment for running tests on Saucelabs.
command: |
# For SauceLabs jobs, we set up a domain which resolves to the machine which launched
# the tunnel. We do this because devices are sometimes not able to properly resolve
# `localhost` or `127.0.0.1` through the SauceLabs tunnel. Using a domain that does not
# resolve to anything on SauceLabs VMs ensures that such requests are always resolved
# through the tunnel, and resolve to the actual tunnel host machine (i.e. the CircleCI VM).
# More context can be found in: https://github.com/angular/angular/pull/35171.
setPublicVar SAUCE_LOCALHOST_ALIAS_DOMAIN "angular-ci.local"
setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
- run:
# Sets up a local domain in the machine's host file that resolves to the local
# host. This domain is helpful in Saucelabs tests where devices are not able to
# properly resolve `localhost` or `127.0.0.1` through the sauce-connect tunnel.
name: Setting up alias domain for local host.
command: echo "127.0.0.1 $SAUCE_LOCALHOST_ALIAS_DOMAIN" | sudo tee -a /etc/hosts
start_saucelabs:
steps:
- run:
name: Starting Saucelabs tunnel service
command: ./lib/saucelabs/sauce-service.sh start-ready-wait
stop_saucelabs:
steps:
- run:
name: Stopping Saucelabs tunnel service
command: ./lib/saucelabs/sauce-service.sh stop
run_e2e_tests:
parameters:
specs:
type: string
steps:
- custom_attach_workspace
- init_environment
- init_saucelabs_environment
- start_saucelabs
- run:
command: yarn grunt test:circleci-protractor --specs="<< parameters.specs >>"
no_output_timeout: 30m
- stop_saucelabs
run_e2e_tests_jquery:
parameters:
specs:
type: string
steps:
- custom_attach_workspace
- init_environment
- init_saucelabs_environment
- start_saucelabs
- run:
environment:
USE_JQUERY: 1
command: yarn grunt test:circleci-protractor --specs="<< parameters.specs >>"
no_output_timeout: 30m
- stop_saucelabs
# Job definitions
# Jobs can include parameters that are passed in the workflow job invocation.
# https://circleci.com/docs/2.0/reusing-config/#authoring-parameterized-jobs
jobs:
setup:
executor: default-executor
steps:
- checkout
- init_environment
- install_java
- run:
name: Running Yarn install
command: yarn install --frozen-lockfile --non-interactive
# Yarn's requests sometimes take more than 10mins to complete.
no_output_timeout: 45m
- run: yarn grunt package
# Persist any changes at this point to be reused by further jobs.
# **NOTE**: To add new content to the workspace, always persist on the same root.
- persist_to_workspace:
root: *workspace_location
paths:
- ./ng
lint:
executor: default-executor
steps:
- custom_attach_workspace
- init_environment
- run: yarn grunt ci-checks
- run: yarn commitplease "$CI_COMMIT_RANGE"
- run: yarn grunt validate-angular-files
unit-test:
executor:
name: default-executor
steps:
- custom_attach_workspace
- init_environment
- install_java
- init_saucelabs_environment
- run: yarn grunt test:promises-aplus
- run:
command: yarn grunt test:jqlite --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
- run:
command: yarn grunt test:modules --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
- run:
command: yarn grunt test:docs --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
unit-test-jquery:
executor:
name: default-executor
steps:
- custom_attach_workspace
- init_environment
- init_saucelabs_environment
- run:
command: yarn grunt test:jquery --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
- run:
command: yarn grunt test:jquery-2.2 --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
- run:
command: yarn grunt test:jquery-2.1 --browsers="$BROWSERS" --reporters=spec
no_output_timeout: 10m
e2e-test-1:
executor:
name: default-executor
steps:
- run_e2e_tests:
specs: test/e2e/tests/**/*.js
e2e-test-2a:
executor:
name: default-executor
steps:
- run_e2e_tests:
specs: build/docs/ptore2e/example-ng*/**/default_test.js
e2e-test-2b:
executor:
name: default-executor
steps:
- run_e2e_tests:
specs: "build/docs/ptore2e/!(example-ng*)/**/default_test.js"
e2e-test-jquery-1:
executor:
name: default-executor
steps:
- run_e2e_tests_jquery:
specs: test/e2e/tests/**/*.js
e2e-test-jquery-2a:
executor:
name: default-executor
steps:
- run_e2e_tests_jquery:
specs: build/docs/ptore2e/example-ng*/**/jquery_test.js
e2e-test-jquery-2b:
executor:
name: default-executor
steps:
- run_e2e_tests_jquery:
specs: build/docs/ptore2e/!(example-ng*)/**/jquery_test.js
prepare-deployment:
executor:
name: default-executor
steps:
- skip_on_pr_and_fork_builds
- custom_attach_workspace
- init_environment
- run: yarn grunt prepareDeploy
# Write the deployment files to the workspace to be used by deploy-docs and deploy-code
- persist_to_workspace:
root: *workspace_location
paths:
- ./ng
# The `deploy-code-files` job should only run when all of these conditions are true for the build:
# - It is for the `angular/angular.js` repository (not a fork).
# - It is not for a pull request.
# - It is for a tag or the master branch or the stable branch(*).
#
# *: The stable branch is the one that has the value `latest` in `package.json > distTag`.
deploy-code-files:
executor:
name: cloud-sdk
steps:
- skip_on_pr_and_fork_builds
- custom_attach_workspace
- init_environment
- skip_unless_tag_or_master_or_stable_branch
- run: ls scripts/code.angularjs.org-firebase/deploy
- run:
name: Authenticate and configure Docker
command: |
echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=-
gcloud --quiet config set project ${GOOGLE_PROJECT_ID}
- run:
name: Sync files to code.angularjs.org
command: |
gsutil -m rsync -r scripts/code.angularjs.org-firebase/deploy gs://code-angularjs-org-338b8.appspot.com
# The `deploy-code-firebase` job should only run when all of these conditions are true for the build:
# - It is for the `angular/angular.js` repository (not a fork).
# - It is not for a pull request.
# - It is for the master branch.
# (This is enforced via job filters, so we don't need to a step to check it here.)
deploy-code-firebase:
executor:
name: default-executor
steps:
- skip_on_pr_and_fork_builds
- custom_attach_workspace
- init_environment
# Install dependencies for Firebase functions to prevent parsing errors during deployment.
# See https://github.com/angular/angular.js/pull/16453.
- run:
name: Install dependencies in `scripts/code.angularjs.org-firebase/functions/`.
working_directory: scripts/code.angularjs.org-firebase/functions
command: yarn install --frozen-lockfile --ignore-engines --non-interactive
- run:
name: Deploy to Firebase from `scripts/code.angularjs.org-firebase/`.
working_directory: scripts/code.angularjs.org-firebase
command: |
# Do not use `yarn firebase` as that causes the Firebase CLI to look for `firebase.json`
# in the root directory, even if run from inside `scripts/code.angularjs.org-firebase/`.
firebase=$(yarn bin)/firebase
$firebase use
$firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --token "$FIREBASE_TOKEN"
# The `deploy-docs` job should only run when all of these conditions are true for the build:
# - It is for the `angular/angular.js` repository (not a fork).
# - It is not for a pull request.
# - It is for the stable branch(*).
#
# *: The stable branch is the one that has the value `latest` in `package.json > distTag`.
deploy-docs:
executor:
name: default-executor
steps:
- skip_on_pr_and_fork_builds
- custom_attach_workspace
- init_environment
- skip_unless_stable_branch
# Install dependencies for Firebase functions to prevent parsing errors during deployment.
# See https://github.com/angular/angular.js/pull/16453.
- run:
name: Install dependencies in `scripts/docs.angularjs.org-firebase/functions/`.
working_directory: scripts/docs.angularjs.org-firebase/functions
command: yarn install --frozen-lockfile --ignore-engines --non-interactive
- run:
name: Deploy to Firebase from `scripts/docs.angularjs.org-firebase/`.
working_directory: scripts/docs.angularjs.org-firebase
command: |
# Do not use `yarn firebase` as that causes the Firebase CLI to look for `firebase.json`
# in the root directory, even if run from inside `scripts/docs.angularjs.org-firebase/`.
firebase=$(yarn bin)/firebase
$firebase use
$firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --token "$FIREBASE_TOKEN"
workflows:
version: 2
default_workflow:
jobs:
- setup:
<<: *run-always
- lint:
<<: *run-always
requires:
- setup
- unit-test:
<<: *run-always
requires:
- setup
- unit-test-jquery:
<<: *run-always
requires:
- setup
- e2e-test-1:
<<: *run-always
requires:
- setup
- e2e-test-2a:
<<: *run-always
requires:
- setup
- e2e-test-2b:
<<: *run-always
requires:
- setup
- e2e-test-jquery-1:
<<: *run-always
requires:
- setup
- e2e-test-jquery-2a:
<<: *run-always
requires:
- setup
- e2e-test-jquery-2b:
<<: *run-always
requires:
- setup
- prepare-deployment:
<<: *run-on-tags-and-master-and-version-branches
requires:
- setup
- lint
- unit-test
- unit-test-jquery
- e2e-test-1
- e2e-test-2a
- e2e-test-2b
- e2e-test-jquery-1
- e2e-test-jquery-2a
- e2e-test-jquery-2b
- deploy-code-files:
<<: *run-on-tags-and-master-and-version-branches
requires:
- prepare-deployment
- deploy-code-firebase:
<<: *run-on-master
requires:
- prepare-deployment
- deploy-docs:
<<: *run-on-version-branches
requires:
- prepare-deployment
+73
View File
@@ -0,0 +1,73 @@
####################################################################################################
# Helpers for defining environment variables for CircleCI.
#
# In CircleCI, each step runs in a new shell. The way to share ENV variables across steps is to
# export them from `$BASH_ENV`, which is automatically sourced at the beginning of every step (for
# the default `bash` shell).
#
# See also https://circleci.com/docs/2.0/env-vars/#using-bash_env-to-set-environment-variables.
####################################################################################################
# Set and print an environment variable.
#
# Use this function for setting environment variables that are public, i.e. it is OK for them to be
# visible to anyone through the CI logs.
#
# Usage: `setPublicVar <name> <value>`
function setPublicVar() {
setSecretVar $1 "$2";
echo "$1=$2";
}
# Set (without printing) an environment variable.
#
# Use this function for setting environment variables that are secret, i.e. should not be visible to
# everyone through the CI logs.
#
# Usage: `setSecretVar <name> <value>`
function setSecretVar() {
# WARNING: Secrets (e.g. passwords, access tokens) should NOT be printed.
# (Keep original shell options to restore at the end.)
local -r originalShellOptions=$(set +o);
set +x -eu -o pipefail;
echo "export $1=\"${2:-}\";" >> $BASH_ENV;
# Restore original shell options.
eval "$originalShellOptions";
}
# Create a function to set an environment variable, when called.
#
# Use this function for creating setter for public environment variables that require expensive or
# time-consuming computaions and may not be needed. When needed, you can call this function to set
# the environment variable (which will be available through `$BASH_ENV` from that point onwards).
#
# Arguments:
# - `<name>`: The name of the environment variable. The generated setter function will be
# `setPublicVar_<name>`.
# - `<code>`: The code to run to compute the value for the variable. Since this code should be
# executed lazily, it must be properly escaped. For example:
# ```sh
# # DO NOT do this:
# createPublicVarSetter MY_VAR "$(whoami)"; # `whoami` will be evaluated eagerly
#
# # DO this isntead:
# createPublicVarSetter MY_VAR "\$(whoami)"; # `whoami` will NOT be evaluated eagerly
# ```
#
# Usage: `createPublicVarSetter <name> <code>`
#
# Example:
# ```sh
# createPublicVarSetter MY_VAR 'echo "FOO"';
# echo $MY_VAR; # Not defined
#
# setPublicVar_MY_VAR;
# source $BASH_ENV;
# echo $MY_VAR; # FOO
# ```
function createPublicVarSetter() {
echo "setPublicVar_$1() { setPublicVar $1 \"$2\"; }" >> $BASH_ENV;
}
+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
# Variables
readonly projectDir=$(realpath "$(dirname ${BASH_SOURCE[0]})/..")
readonly envHelpersPath="$projectDir/.circleci/env-helpers.inc.sh";
# Load helpers and make them available everywhere (through `$BASH_ENV`).
source $envHelpersPath;
echo "source $envHelpersPath;" >> $BASH_ENV;
####################################################################################################
# Define PUBLIC environment variables for CircleCI.
####################################################################################################
# See https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables for more info.
####################################################################################################
setPublicVar CI "$CI"
setPublicVar PROJECT_ROOT "$projectDir";
# This is the branch being built; e.g. `pull/12345` for PR builds.
setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL";
setPublicVar CI_COMMIT "$CIRCLE_SHA1";
setPublicVar CI_GIT_BASE_REVISION "${CIRCLE_GIT_BASE_REVISION}";
setPublicVar CI_GIT_REVISION "${CIRCLE_GIT_REVISION}";
setPublicVar CI_GIT_TAG "${CIRCLE_TAG:-false}";
setPublicVar CI_COMMIT_RANGE "$CIRCLE_GIT_BASE_REVISION..$CIRCLE_GIT_REVISION";
setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}";
setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME";
setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME";
setPublicVar CI_PR_REPONAME "$CIRCLE_PR_REPONAME";
setPublicVar CI_PR_USERNAME "$CIRCLE_PR_USERNAME";
####################################################################################################
# Define SauceLabs environment variables for CircleCI.
####################################################################################################
setPublicVar BROWSER_PROVIDER "saucelabs"
# The currently latest-1 version of desktop Safari on Saucelabs (v12.0) is unstable and disconnects
# consistently. The latest version (v12.1) works fine.
# TODO: Add `SL_Safari-1` back, once it no longer corresponds to v12.0.
setPublicVar BROWSERS "SL_Chrome,SL_Chrome-1,\
SL_Firefox,SL_Firefox-1,\
SL_Safari,\
SL_iOS,SL_iOS-1,\
SL_IE_9,SL_IE_10,SL_IE_11,\
SL_EDGE,SL_EDGE-1"
setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log
setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock
setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock
setPublicVar SAUCE_TUNNEL_IDENTIFIER "angularjs-framework-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
# Amount of seconds we wait for sauceconnect to establish a tunnel instance. In order to not
# acquire CircleCI instances for too long if sauceconnect failed, we need a connect timeout.
setPublicVar SAUCE_READY_FILE_TIMEOUT 120
####################################################################################################
# Define additional environment variables
####################################################################################################
# NOTE: Make sure the tools used to compute this are available in all executors in `config.yml`.
setPublicVar DIST_TAG $( cat package.json | grep distTag | sed -E 's/^\s*"distTag"\s*:\s*"([^"]+)"\s*,\s*$/\1/' )
####################################################################################################
####################################################################################################
## Source `$BASH_ENV` to make the variables available immediately. ##
## *** NOTE: This must remain the last command in this script. *** ##
####################################################################################################
####################################################################################################
source $BASH_ENV;
+1 -4
View File
@@ -1,4 +1,4 @@
# http://editorconfig.org
# https://editorconfig.org
root = true
@@ -10,9 +10,6 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[src/ngLocale/**]
insert_final_newline = false
[dropdown-toggle.js]
trim_trailing_whitespace = false
insert_final_newline = false
+10
View File
@@ -0,0 +1,10 @@
build/**
docs/app/assets/js/angular-bootstrap/**
docs/config/templates/**
node_modules/**
lib/htmlparser/**
src/angular.bind.js
src/ngParseExt/ucd.js
i18n/closure/**
tmp/**
vendor/**
+117
View File
@@ -0,0 +1,117 @@
{
"rules": {
// Rules are divided into sections from http://eslint.org/docs/rules/
// Possible errors
"comma-dangle": ["error", "never"],
"no-cond-assign": ["error", "except-parens"],
"no-constant-condition": ["error", {"checkLoops": false}],
"no-control-regex": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-extra-semi": "error",
"no-func-assign": "error",
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-negated-in-lhs": "error",
"no-obj-calls": "error",
"no-regex-spaces": "error",
"no-sparse-arrays": "error",
"no-unreachable": "error",
"use-isnan": "error",
"no-unsafe-finally": "error",
"valid-typeof": "error",
"no-unexpected-multiline": "error",
// Best practices
"accessor-pairs": "error",
"array-callback-return": "error",
"eqeqeq": ["error", "allow-null"],
"no-alert": "error",
"no-caller": "error",
"no-case-declarations": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-fallthrough": "error",
"no-floating-decimal": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-multi-str": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-octal-escape": "error",
"no-octal": "error",
"no-proto": "error",
"no-redeclare": "error",
"no-return-assign": "error",
"no-script-url": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-escape": "error",
"no-void": "error",
"no-with": "error",
"radix": "error",
"wrap-iife": ["error", "inside"],
// Strict mode
"strict": ["error", "global"],
// Variables
"no-delete-var": "error",
"no-label-var": "error",
"no-restricted-globals": ["error", "event"],
"no-shadow-restricted-names": "error",
"no-undef-init": "error",
"no-undef": "error",
"no-unused-vars": ["error", { "vars": "local", "args": "none" }],
// Node.js
"handle-callback-err": "error",
// Stylistic issues
"array-bracket-spacing": ["error", "never"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"comma-style": ["error", "last"],
"eol-last": "error",
"keyword-spacing": "error",
"linebreak-style": ["error", "unix"],
"max-len": ["error", { "code": 200, "ignoreComments": true, "ignoreUrls": true }],
"new-cap": "error",
"new-parens": "error",
"no-array-constructor": "error",
"no-bitwise": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": ["error", { "max": 3, "maxEOF": 1 }],
"no-whitespace-before-property": "error",
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-unneeded-ternary": "error",
"quotes": ["error", "single"],
"semi-spacing": "error",
"semi": "error",
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"unicode-bom": ["error", "never"]
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"extends": "./.eslintrc-base.json",
"env": {
// Note: don't set `"browser": true`; code in "src/" should be compatible with
// non-browser environments like Node.js with a custom window implementation
// like jsdom. All browser globals should be taken from window.
"browser": false,
"node": false
},
"globals": {
"window": false,
"angular": false
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"extends": "./.eslintrc-base.json",
"env": {
"browser": false,
"node": true
},
"parserOptions": {
"ecmaVersion": 2017
},
"plugins": [
"promise"
]
}
+25
View File
@@ -0,0 +1,25 @@
{
// This config contains proposed rules that we'd like to have enabled but haven't
// converted the code to adhere yet. If a decision comes to not enable one of these
// rules, it should be removed from the file. Every rule that got enabled in the
// end should be moved from here to a respective section in .eslintrc.json
"rules": {
// Rules are divided into sections from http://eslint.org/docs/rules/
// Best practices
"complexity": ["error", 10],
"dot-notation": "error",
"dot-location": ["error", "property"],
// Stylistic issues
"block-spacing": ["error", "always"],
"comma-spacing": "error",
"id-denylist": ["error", "event"],
"indent": ["error", 2],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" }}]
}
}
+4
View File
@@ -0,0 +1,4 @@
{
"root": true,
"extends": "./.eslintrc-node.json"
}
+5
View File
@@ -0,0 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto
# JS files must always use LF for tools to work
*.js eol=lf
+42
View File
@@ -0,0 +1,42 @@
# AngularJS is in LTS mode
We are no longer accepting changes that are not critical bug fixes into this project.
See https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c for more detail.
<!--
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATION
-->
<!--
- For *SUPPORT QUESTIONS*, use one of the
[support channels](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question).
- Before submitting, please **SEARCH GITHUB** for a similar issue or PR. -->
**I'm submitting a ...**
<!-- (check one with "x") -->
- [ ] regression from 1.7.0
- [ ] security issue
- [ ] issue caused by a new browser version
- [ ] other <!--(Please do not submit support requests here - see above)-->
**Current behavior:**
<!-- Describe how the bug manifests / how the current features are insufficient. -->
**Expected / new behavior:**
<!-- Describe what the behavior would be without the bug / how the feature would improve AngularJS -->
**Minimal reproduction of the problem with instructions:**
<!--
If the current behavior is a bug or you can illustrate your feature request better with an example,
please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:yBpEi4).
-->
**AngularJS version:** 1.8.x
<!-- Check whether this is still an issue in the most recent stable or in the snapshot AngularJS
version (https://code.angularjs.org/snapshot/) -->
**Browser:** [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView | Opera XX ]
<!-- All browsers where this could be reproduced (and Operating System if relevant) -->
**Anything else:**
<!-- e.g. stacktraces, related issues, suggestions how to fix -->
+29
View File
@@ -0,0 +1,29 @@
# AngularJS is in LTS mode
We are no longer accepting changes that are not critical bug fixes into this project.
See https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c for more detail.
<!-- General PR submission guidelines https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#submit-pr -->
**Does this PR fix a regression since 1.7.0, a security flaw, or a problem caused by a new browser version?**
<!-- If the answer is no, then we will not merge this PR -->
**What is the current behavior? (You can also link to an open issue here)**
**What is the new behavior (if this is a feature change)?**
**Does this PR introduce a breaking change?**
**Please check if the PR fulfills these requirements**
- [ ] The commit message follows our [guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits)
- [ ] Fix/Feature: [Docs](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#documentation) have been added/updated
- [ ] Fix/Feature: Tests have been added; existing tests pass
**Other information**:
+10 -4
View File
@@ -1,4 +1,5 @@
/build/
/benchpress-build/
.DS_Store
gen_docs.disable
test.disable
@@ -8,14 +9,19 @@ performance/temp*.html
*~
*.swp
angular.js.tmproj
/node_modules/
/components/
/bower_components/
node_modules/
angular.xcodeproj
.firebase/
.idea
*.iml
.agignore
.lvimrc
libpeerconnection.log
npm-debug.log
/tmp/
/scripts/bower/bower-*
.vscode
*.log
*.stackdump
scripts/code.angularjs.org-firebase/deploy
scripts/docs.angularjs.org-firebase/deploy
scripts/docs.angularjs.org-firebase/functions/content
-6
View File
@@ -1,6 +0,0 @@
{
"disallowKeywords": ["with"],
"disallowTrailingWhitespace": true,
"requireRightStickedOperators": ["!"],
"requireLeftStickedOperators": [","]
}
-19
View File
@@ -1,19 +0,0 @@
// This is an incomplete TODO list of checks we want to start enforcing
//
// The goal is to enable these checks one by one by moving them to .jscs.json along with commits
// that correct the existing code base issues and make the new check pass.
{
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowImplicitTypeConversion": ["string"],
"disallowMultipleLineBreaks": true,
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
}
}
-2
View File
@@ -1,2 +0,0 @@
node_modules/**
lib/htmlparser/**
-5
View File
@@ -1,5 +0,0 @@
{
"extends": ".jshintrc-base",
"node": true,
"globals": {}
}
-19
View File
@@ -1,19 +0,0 @@
{
"bitwise": true,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"trailing": true,
"maxlen": 200,
"boss": true,
"eqnull": true,
"expr": true,
"globalstrict": true,
"laxbreak": true,
"loopfunc": true,
"sub": true,
"undef": true,
"indent": 2
}
+29
View File
@@ -0,0 +1,29 @@
Andres Ornelas <aornelas@google.com>
Caitlin Potter <caitpotter88@gmail.com>
Caitlin Potter <caitpotter88@gmail.com> <snowball@defpixel.com>
Di Peng <pengdi@google.com>
Di Peng <pengdi@google.com> <pengdi@go.wustl.edu>
Georgios Kalpakas <kalpakas.g@gmail.com>
Georgios Kalpakas <kalpakas.g@gmail.com> <g.kalpakas@hotmail.com>
Julie Ralph <ju.ralph@gmail.com>
Lucas Galfaso <lgalfaso@gmail.com>
Martin Staffa <mjstaffa@gmail.com>
Martin Staffa <mjstaffa@gmail.com> <mjstaffa@googlemail.com>
Matias Niemelä <matias@yearofmoo.com>
Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
Misko Hevery <misko@hevery.com>
Misko Hevery <misko@hevery.com> <misko@google.com>
Igor Minar <igor@angularjs.org>
Igor Minar <igor@angularjs.org> <iiminar@gmail.com>
Igor Minar <igor@angularjs.org> <iminar@google.com>
Igor Minar <igor@angularjs.org> <iminar@dhcp-172-19-37-154.mtv.corp.google.com>
Pawel Kozlowski <pkozlowski.opensource@gmail.com>
Peter Bacon Darwin <pete@bacondarwin.com>
Rodric Haddad <rody@rodyhaddad.com>
Shahar Talmi <shahar.talmi@gmail.com>
Shahar Talmi <shahar.talmi@gmail.com> <shahart@wix.com>
Shyam Seshadri <shyamseshadri@google.com>
Shyam Seshadri <shyamseshadri@google.com> <shyamseshadri@gmail.com>
Vojta Jina <vojta.jina@gmail.com>
Vojta Jina <vojta.jina@gmail.com> <vojta@gemin-i.org>
Vojta Jina <vojta.jina@gmail.com> <vojta@google.com>
+1
View File
@@ -0,0 +1 @@
14.16.1
-49
View File
@@ -1,49 +0,0 @@
language: node_js
node_js:
- '0.10'
branches:
except:
- /^g3_.*$/
env:
matrix:
- JOB=unit
- JOB=e2e TEST_TARGET=jqlite
- JOB=e2e TEST_TARGET=jquery
- JOB=e2e TEST_TARGET=doce2e
global:
- SAUCE_USERNAME=angular-ci
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
- LOGS_DIR=/tmp/angular-build/logs
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
install:
# - npm config set registry http://23.251.144.68
# Disable the spinner, it looks bad on Travis
- npm config set spin false
# Log HTTP requests
- npm config set loglevel http
- time ./scripts/travis/npm-bundle-deps.sh
- time npm install
before_script:
- mkdir -p $LOGS_DIR
- ./lib/sauce/sauce_connect_setup.sh
- npm install -g grunt-cli
- grunt package
- ./scripts/travis/wait_for_browser_provider.sh
script:
- ./scripts/travis/build.sh
after_script:
- ./scripts/travis/print_logs.sh
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/d2120f3f2bb39a4531b2
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
+11401 -49
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
# Contributor Code of Conduct
The AngularJS project follows the Code of Conduct defined in [the angular/code-of-conduct repository](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md). Please read it.
+147 -177
View File
@@ -1,116 +1,147 @@
#Contributing to AngularJS
# Contributing to AngularJS
We'd love for you to contribute to our source code and to make AngularJS even better than it is
today! Here are the guidelines we'd like you to follow:
- [Code of Conduct](#coc)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
- [Further Info](#info)
* [Code of Conduct](#coc)
* [Questions and Problems](#question)
* [Issues and Bugs](#issue)
* [Feature Requests](#feature)
* [Improving Documentation](#docs)
* [Issue Submission Guidelines](#submit)
* [Pull Request Submission Guidelines](#submit-pr)
* [Signing the CLA](#cla)
## <a name="coc"></a> Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc].
## <a name="question"></a> Got a Question or Problem?
Help us keep AngularJS open and inclusive. Please read and follow our [Code of Conduct][coc].
If you have questions about how to use AngularJS, please direct these to the [Google Group][groups]
discussion list or [StackOverflow][stackoverflow]. We are also available on [IRC][irc].
## <a name="requests"></a> Questions, Bugs, Features
## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
with a fix.
### <a name="question"></a> Got a Question or Problem?
***Localization Issue:*** *Angular.js uses the [Google Closure I18N library], to generate its own I18N files. This means that
any changes to these files would be lost the next time that we import the library. The recommended
approach is to submit a patch to the I18N project directly, instead of submitting it here.*
Do not open issues for general support questions as we want to keep GitHub issues for bug reports
and feature requests. You've got much better chances of getting your question answered on dedicated
support platforms, the best being [Stack Overflow][stackoverflow].
**Please see the Submission Guidelines below**.
Stack Overflow is a much better place to ask questions since:
## <a name="feature"></a> Want a Feature?
You can request a new feature by submitting an issue to our [GitHub Repository][github]. If you
would like to implement a new feature then consider what kind of change it is:
- there are thousands of people willing to help on Stack Overflow
- questions and answers stay available for public viewing so your question / answer might help
someone else
- Stack Overflow's voting system assures that the best answers are prominently visible.
* **Major Changes** that you wish to contribute to the project should be discussed first on our
[dev mailing list][angular-dev] or [IRC][irc] so that we can better coordinate our efforts, prevent
duplication of work, and help you to craft the change so that it is successfully accepted into the
project.
* **Small Changes** can be crafted and submitted to the [GitHub Repository][github] as a Pull Request.
To save your and our time, we will systematically close all issues that are requests for general
support and redirect people to the section you are reading right now.
Other channels for support are:
- the [Google Group][groups] discussion list
- the [AngularJS IRC][irc]
- the [AngularJS Gitter][gitter]
### <a name="issue"></a> Found an Issue or Bug?
If you find a bug in the source code, you can help us by submitting an issue to our
[GitHub Repository][github]. Even better, you can submit a Pull Request with a fix.
**Please see the [Submission Guidelines](#submit) below.**
**Special Note for Localization Issues:** AngularJS uses the [Google Closure I18N library] to
generate its own I18N files (the ngLocale module). This means that any changes to these files
would be lost the next time that we import the library.
Since the Closure library i18n data is itself auto-generated from the data of the
[Common Locale Data Repository (CLDR)] project, errors in the data should
be reported there. See also the [Closure guide to i18n changes].
### <a name="feature"></a> Missing a Feature?
You can request a new feature by submitting an issue to our [GitHub Repository][github-issues].
If you would like to implement a new feature then consider what kind of change it is:
* **Major Changes** that you wish to contribute to the project should be discussed first in an
[GitHub issue][github-issues] that clearly outlines the changes and benefits of the feature.
* **Small Changes** can directly be crafted and submitted to the [GitHub Repository][github]
as a Pull Request. See the section about [Pull Request Submission Guidelines](#submit-pr), and
for detailed information the [core development documentation][developers].
### <a name="docs"></a> Want a Doc Fix?
Should you have a suggestion for the documentation, you can open an issue and outline the problem
or improvement you have - however, creating the doc fix yourself is much better!
## <a name="docs"></a> Want a Doc Fix?
If you want to help improve the docs, it's a good idea to let others know what you're working on to
minimize duplication of effort. Before starting, check out the issue queue for
[Milestone:Docs Only](https://github.com/angular/angular.js/issues?milestone=24&state=open).
Comment on an issue to let others know what you're working on, or create a new issue if your work
doesn't fit within the scope of any of the existing doc fix projects.
minimize duplication of effort. Create a new issue (or comment on a related existing one) to let
others know what you're working on.
For large fixes, please build and test the documentation before submitting the PR to be sure you haven't
accidentally introduced any layout or formatting issues. You should also make sure that your commit message
is labeled "docs:" and follows the **Git Commit Guidelines** outlined below.
If you're making a small change (typo, phrasing) don't worry about filing an issue first. Use the
friendly blue "Improve this doc" button at the top right of the doc page to fork the repository
in-place and make a quick change on the fly. The commit message is preformatted to the right type
and scope, so you only have to add the description.
If you're just making a small change, don't worry about filing an issue first. Use the friendly blue "Improve this doc" button at the top right of the doc page to fork the repository in-place and make a quick change on the fly.
For large fixes, please build and test the documentation before submitting the PR to be sure you
haven't accidentally introduced any layout or formatting issues. You should also make sure that your
commit message follows the **[Commit Message Guidelines][developers.commits]**.
## <a name="submit"></a> Submission Guidelines
### Submitting an Issue
## <a name="submit"></a> Issue Submission Guidelines
Before you submit your issue search the archive, maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues. Providing the following information will increase the
chances of your issue being dealt with quickly:
If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize
the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
* **Overview of the issue** - if an error is being thrown a non-minified stack trace helps
The "[new issue][github-new-issue]" form contains a number of prompts that you should fill out to
make it easier to understand and categorize the issue.
In general, providing the following information will increase the chances of your issue being dealt
with quickly:
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
* **Motivation for or Use Case** - explain why this is a bug for you
* **Angular Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers or only IE8?
* **Reproduce the error** - provide a live example (using [Plunker][plunker] or
[JSFiddle][jsfiddle]) or a unambiguous set of steps.
* **Related issues** - has a similar issue been reported before?
* **AngularJS Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers or only specific ones?
* **Reproduce the Error** - provide a live example (using [Plunker][plunker] or
[JSFiddle][jsfiddle]) or an unambiguous set of steps.
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
Here is a great example of a well defined issue: https://github.com/angular/angular.js/issues/5069
Here is a great example of a well defined issue: https://github.com/angular/angular.js/issues/5069.
**If you get help, help others. Good karma rulez!**
### Submitting a Pull Request
## <a name="submit-pr"></a> Pull Request Submission Guidelines
Before you submit your pull request consider the following guidelines:
* Search [GitHub](https://github.com/angular/angular.js/pulls) for an open or closed Pull Request
that relates to your submission. You don't want to duplicate effort.
* Please sign our [Contributor License Agreement (CLA)](#cla) before sending pull
requests. We cannot accept code without this.
* Make your changes in a new git branch
```shell
git checkout -b my-fix-branch master
```
* Create your patch, **including appropriate test cases**.
* Follow our [Coding Rules](#rules).
* Run the full Angular test suite, as described in the [developer documentation][dev-doc],
and ensure that all tests pass.
* Commit your changes using a descriptive commit message that follows our
[commit message conventions](#commit-message-format) and passes our commit message presubmit hook
`validate-commit-msg.js`. Adherence to the [commit message conventions](#commit-message-format)
is required because release notes are automatically generated from these messages.
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Build your changes locally to ensure all the tests pass
* Create the [development environment][developers.setup]
* Make your changes in a new git branch:
```shell
grunt test
git checkout -b my-fix-branch master
```
* Create your patch commit, **including appropriate test cases**.
* Follow our [Coding Rules][developers.rules].
* If the changes affect public APIs, change or add relevant [documentation][developers.documentation].
* Run the AngularJS [unit][developers.tests-unit] and [E2E test][developers.tests-e2e] suites, and ensure that all tests
pass. It is generally sufficient to run the tests only on Chrome, as our continuous integration test will
run the tests on additional browsers.
* Run `yarn grunt eslint` to check that you have followed the automatically enforced coding rules
* Commit your changes using a descriptive commit message that follows our
[commit message conventions][developers.commits]. Adherence to the
[commit message conventions][developers.commits] is required, because release notes are
automatically generated from these messages.
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Before creating the Pull Request, package and run all tests a last time:
```shell
yarn grunt test
```
* Push your branch to GitHub:
@@ -119,17 +150,31 @@ Before you submit your pull request consider the following guidelines:
git push origin my-fix-branch
```
* In GitHub, send a pull request to `angular:master`.
* If we suggest changes then
* In GitHub, send a pull request to `angular.js:master`. This will trigger the check of the
[Contributor License Agreement](#cla) and the continuous integration tests.
* If you find that the continuous integration tests have failed, look into the logs to find out
if your changes caused test failures, the commit message was malformed etc. If you find that the
tests failed or times out for unrelated reasons, you can ping a team member so that the build can be
restarted.
* If we suggest changes, then:
* Make the required updates.
* Re-run the Angular test suite to ensure tests are still passing.
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
* Re-run the AngularJS test suite to ensure tests are still passing.
* Commit your changes to your branch (e.g. `my-fix-branch`).
* Push the changes to your GitHub repository (this will update your Pull Request).
You can also amend the initial commits and force push them to the branch.
```shell
git rebase master -i
git push -f
git push origin my-fix-branch -f
```
This is generally easier to follow, but separate commits are useful if the Pull Request contains
iterations that might be interesting to see side-by-side.
That's it! Thank you for your contribution!
#### After your pull request is merged
@@ -161,116 +206,41 @@ from the main (upstream) repository:
git pull --ff upstream master
```
## <a name="rules"></a> Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
## <a name="cla"></a> Signing the Contributor License Agreement (CLA)
* All features or bug fixes **must be tested** by one or more [specs][unit-testing].
* All public API methods **must be documented** with ngdoc, an extended version of jsdoc (we added
support for markdown and templating via @ngdoc tag). To see how we document our APIs, please check
out the existing ngdocs and see [this wiki page][ngDocs].
* With the exceptions listed below, we follow the rules contained in
[Google's JavaScript Style Guide][js-style-guide]:
* **Do not use namespaces**: Instead, wrap the entire angular code base in an anonymous closure and
export our API explicitly rather than implicitly.
* Wrap all code at **100 characters**.
* Instead of complex inheritance hierarchies, we **prefer simple objects**. We use prototypical
inheritance only when absolutely necessary.
* We **love functions and closures** and, whenever possible, prefer them over objects.
* To write concise code that can be better minified, we **use aliases internally** that map to the
external API. See our existing code to see what we mean.
* We **don't go crazy with type annotations** for private internal APIs unless it's an internal API
that is used throughout AngularJS. The best guidance is to do what makes the most sense.
## <a name="commit"></a> Git Commit Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the AngularJS change log**.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on github as well as in various git tools.
### Type
Must be one of the following:
* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
* **refactor**: A code change that neither fixes a bug or adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation
### Scope
The scope could be anything specifying place of the commit change. For example `$location`,
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
###Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes"
The body should include the motivation for the change and contrast this with previous behavior.
###Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
A detailed explanation can be found in this [document][commit-message-format].
## <a name="cla"></a> Signing the CLA
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
Upon submmitting a Pull Request, a friendly bot will ask you to sign our CLA if you haven't done
so before. Unfortunately, this is necessary for documentation changes, too.
It's a quick process, we promise!
* For individuals we have a [simple click-through form][individual-cla].
* For corporations we'll need you to
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
## <a name="info"></a> Further Information
You can find out more detailed information about contributing in the
[AngularJS documentation][contributing].
[Google Closure I18N library]: https://github.com/google/closure-library/tree/master/closure/goog/i18n
[angular-dev]: https://groups.google.com/forum/?fromgroups#!forum/angular-dev
[Closure guide to i18n changes]: https://github.com/google/closure-library/wiki/Internationalization-%28i18n%29-changes-in-Closure-Library
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[contribute]: http://docs.angularjs.org/misc/contribute
[contributing]: http://docs.angularjs.org/misc/contribute
[Common Locale Data Repository (CLDR)]: http://cldr.unicode.org
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
[dev-doc]: https://docs.angularjs.org/guide
[developers]: DEVELOPERS.md
[developers.commits]: DEVELOPERS.md#commits
[developers.documentation]: DEVELOPERS.md#documentation
[developers.rules]: DEVELOPERS.md#rules
[developers.setup]: DEVELOPERS.md#setup
[developers.tests-e2e]: DEVELOPERS.md#e2e-tests
[developers.tests-unit]: DEVELOPERS.md#unit-tests
[github-issues]: https://github.com/angular/angular.js/issues
[github-new-issue]: https://github.com/angular/angular.js/issues/new
[github]: https://github.com/angular/angular.js
[gitter]: https://gitter.im/angular/angular.js
[Google Closure I18N library]: https://github.com/google/closure-library/tree/master/closure/goog/i18n
[groups]: https://groups.google.com/forum/?fromgroups#!forum/angular
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
[irc]: http://webchat.freenode.net/?channels=angularjs&uio=d4
[js-style-guide]: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
[jsfiddle]: http://jsfiddle.net/
[list]: https://groups.google.com/forum/?fromgroups#!forum/angular
[ngDocs]: https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation
[karma-browserstack]: https://github.com/karma-runner/karma-browserstack-launcher
[karma-saucelabs]: https://github.com/karma-runner/karma-sauce-launcher
[plunker]: http://plnkr.co/edit
[stackoverflow]: http://stackoverflow.com/questions/tagged/angularjs
[unit-testing]: https://docs.angularjs.org/guide/unit-testing
[![Analytics](https://ga-beacon.appspot.com/UA-8594346-11/angular.js/CONTRIBUTING.md?pixel)](https://github.com/igrigorik/ga-beacon)
+488
View File
@@ -0,0 +1,488 @@
# Developing AngularJS
* [Development Setup](#setup)
* [Running Tests](#tests)
* [Coding Rules](#rules)
* [Commit Message Guidelines](#commits)
* [Writing Documentation](#documentation)
## <a name="setup"> Development Setup
This document describes how to set up your development environment to build and test AngularJS, and
explains the basic mechanics of using `git`, `node`, `yarn` and `grunt`.
### Installing Dependencies
Before you can build AngularJS, you must install and configure the following dependencies on your
machine:
* [Git](http://git-scm.com/): The [Github Guide to
Installing Git][git-setup] is a good source of information.
* [Node.js v8.x (LTS)](http://nodejs.org): We use Node to generate the documentation, run a
development web server, run tests, and generate distributable files. Depending on your system,
you can install Node either from source or as a pre-packaged bundle.
We recommend using [nvm](https://github.com/creationix/nvm) (or
[nvm-windows](https://github.com/coreybutler/nvm-windows))
to manage and install Node.js, which makes it easy to change the version of Node.js per project.
* [Yarn](https://yarnpkg.com): We use Yarn to install our Node.js module dependencies
(rather than using npm). See the detailed [installation instructions][yarn-install].
* [Java](http://www.java.com): We minify JavaScript using
[Closure Tools](https://developers.google.com/closure/), which require Java (version 7 or higher)
to be installed and included in your
[PATH](http://docs.oracle.com/javase/tutorial/essential/environment/paths.html) variable.
* [Grunt](http://gruntjs.com): We use Grunt as our build system. We're using it as a local dependency,
but you can also add the grunt command-line tool globally (with `yarn global add grunt-cli`), which allows
you to leave out the `yarn` prefix for all our grunt commands.
### Forking AngularJS on Github
To contribute code to AngularJS, you must have a GitHub account so you can push code to your own
fork of AngularJS and open Pull Requests in the [GitHub Repository][github].
To create a Github account, follow the instructions [here](https://github.com/signup/free).
Afterwards, go ahead and [fork](http://help.github.com/forking) the
[main AngularJS repository][github].
### Building AngularJS
To build AngularJS, you clone the source code repository and use Grunt to generate the non-minified
and minified AngularJS files:
```shell
# Clone your Github repository:
git clone https://github.com/<github username>/angular.js.git
# Go to the AngularJS directory:
cd angular.js
# Add the main AngularJS repository as an upstream remote to your repository:
git remote add upstream "https://github.com/angular/angular.js.git"
# Install JavaScript dependencies:
yarn install
# Build AngularJS:
yarn grunt package
```
**Note:** If you're using Windows, you must use an elevated command prompt (right click, run as
Administrator). This is because `yarn grunt package` creates some symbolic links.
The build output is in the `build` directory. It consists of the following files and
directories:
* `angular-<version>.zip` — The complete zip file, containing all of the release build
artifacts.
* `angular.js` / `angular.min.js` — The regular and minified core AngularJS script file.
* `angular-*.js` / `angular-*.min.js` — All other AngularJS module script files.
* `docs/` — A directory that contains a standalone version of the docs
(same as served in `docs.angularjs.org`).
### <a name="local-server"></a> Running a Local Development Web Server
To debug code, run end-to-end tests, and serve the docs, it is often useful to have a local
HTTP server. For this purpose, we have made available a local web server based on Node.js.
1. To start the web server, run:
```shell
yarn grunt webserver
```
2. To access the local server, enter the following URL into your web browser:
```text
http://localhost:8000/
```
By default, it serves the contents of the AngularJS project directory.
3. To access the locally served docs, visit this URL:
```text
http://localhost:8000/build/docs/
```
## <a name="tests"> Running Tests
### <a name="unit-tests"></a> Running the Unit Test Suite
We write unit and integration tests with Jasmine and execute them with Karma. To run all of the
tests once on Chrome run:
```shell
yarn grunt test:unit
```
To run the tests on other browsers use the command line flag:
```shell
yarn grunt test:unit --browsers=Chrome,Firefox
```
**Note:** there should be _no spaces between browsers_. `Chrome, Firefox` is INVALID.
If you have a Saucelabs or Browserstack account, you can also run the unit tests on these services
via our pre-defined customLaunchers. See the [karma config file](/karma-shared.conf.js) for all pre-configured browsers.
For example, to run the whole unit test suite on selected browsers:
```shell
# Browserstack
yarn grunt test:unit --browsers=BS_Chrome,BS_Firefox,BS_Safari,BS_IE_9,BS_IE_10,BS_IE_11,BS_EDGE,BS_iOS_10
# Saucelabs
yarn grunt test:unit --browsers=SL_Chrome,SL_Firefox,SL_Safari,SL_IE_9,SL_IE_10,SL_IE_11,SL_EDGE,SL_iOS_10
```
Running these commands requires you to set up [Karma Browserstack][karma-browserstack] or
[Karma-Saucelabs][karma-saucelabs], respectively.
During development, however, it's more productive to continuously run unit tests every time the
source or test files change. To execute tests in this mode run:
1. To start the Karma server, capture Chrome browser and run unit tests, run:
```shell
yarn grunt autotest
```
2. To capture more browsers, open this URL in the desired browser (URL might be different if you
have multiple instance of Karma running, read Karma's console output for the correct URL):
```text
http://localhost:9876/
```
3. To re-run tests just change any source or test file.
To learn more about all of the preconfigured Grunt tasks run:
```shell
yarn grunt --help
```
### <a name="e2e-tests"></a> Running the End-to-end Test Suite
AngularJS's end to end tests are run with Protractor. Simply run:
```shell
yarn grunt test:e2e
```
This will start the webserver and run the tests on Chrome.
## <a name="rules"></a> Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
* All features or bug fixes **must be tested** by one or more [specs][unit-testing].
* All public API methods **must be documented** with ngdoc, an extended version of jsdoc (we added
support for markdown and templating via @ngdoc tag). To see how we document our APIs, please check
out the existing source code and see the section about [writing documentation](#documentation)
* With the exceptions listed below, we follow the rules contained in
[Google's JavaScript Style Guide][js-style-guide]:
* **Do not use namespaces**: Instead, wrap the entire AngularJS code base in an anonymous
closure and export our API explicitly rather than implicitly.
* Wrap all code at **100 characters**.
* Instead of complex inheritance hierarchies, we **prefer simple objects**. We use prototypal
inheritance only when absolutely necessary.
* We **love functions and closures** and, whenever possible, prefer them over objects.
* To write concise code that can be better minified, we **use aliases internally** that map to
the external API. See our existing code to see what we mean.
* We **don't go crazy with type annotations** for private internal APIs unless it's an internal
API that is used throughout AngularJS. The best guidance is to do what makes the most sense.
### Specific topics
#### Provider configuration
When adding configuration (options) to [providers][docs.provider], we follow a special pattern.
- for each option, add a `method` that ...
- works as a getter and returns the current value when called without argument
- works as a setter and returns itself for chaining when called with argument
- for boolean options, uses the naming scheme `<option>Enabled([enabled])`
- non-primitive options (e.g. objects) should be copied or the properties assigned explicitly to a
new object so that the configuration cannot be changed during runtime.
For a boolean config example, see [`$compileProvider#debugInfoEnabled`][code.debugInfoEnabled]
For an object config example, see [`$location.html5Mode`][code.html5Mode]
#### Throwing errors
User-facing errors should be thrown with [`minErr`][code.minErr], a special error function that provides
errors ids, templated error messages, and adds a link to a detailed error description.
The `$compile:badrestrict` error is a good example for a well-defined `minErr`:
[code][code.badrestrict] and [description][docs.badrestrict].
## <a name="commits"></a> Git Commit Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the AngularJS change log**.
The commit message formatting can be added using a typical git workflow or through the use of a CLI
wizard ([Commitizen](https://github.com/commitizen/cz-cli)). To use the wizard, run `yarn run commit`
in your terminal after staging your changes in git.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.
### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header
of the reverted commit.
In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit
being reverted.
### Type
Must be one of the following:
* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing or correcting existing tests
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
generation
### Scope
The scope could be anything specifying place of the commit change. For example `$location`,
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
You can use `*` when the change affects more than a single scope.
### Subject
The subject contains succinct description of the change:
* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
[reference GitHub issues that this commit closes][closing-issues].
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.
A detailed explanation can be found in this [document][commit-message-format].
## <a name="documentation"></a> Writing Documentation
The AngularJS project uses a form of [jsdoc](http://usejsdoc.org/) called ngdoc for all of its code
documentation.
This means that all the docs are stored inline in the source code and so are kept in sync as it
changes.
There is also extra content (the developer guide, error pages, the tutorial,
and misceallenous pages) that live inside the AngularJS repository as markdown files.
This means that since we generate the documentation from the source code, we can easily provide
version-specific documentation by simply checking out a version of AngularJS and running the build.
Extracting the source code documentation, processing and building the docs is handled by the
documentation generation tool [Dgeni][dgeni].
### Building and viewing the docs locally
The docs can be built from scratch using grunt:
```shell
yarn grunt docs
```
This defers the doc-building task to `gulp`.
Note that the docs app is using the local build files to run. This means you might first have to run
the build:
```shell
yarn grunt build
```
(This is also necessary if you are making changes to minErrors).
To view the docs, see [Running a Local Development Web Server](#local-server).
### Writing jsdoc
The ngdoc utility has basic support for many of the standard jsdoc directives. But in particular it
is interested in the following block tags:
* `@name name` - the name of the ngdoc document
* `@param {type} name description` - describes a parameter of a function
* `@returns {type} description` - describes what a function returns
* `@requires` - normally indicates that a JavaScript module is required; in an Angular service it is
used to describe what other services this service relies on
* `@property` - describes a property of an object
* `@description` - used to provide a description of a component in markdown
* `@link` - specifies a link to a URL or a type in the API reference.
Links to the API have the following structure:
* the module namespace, followed by `.` (optional, default `ng`)
* the `@ngdoc` type (see below), followed by `:` (optional, automatically inferred)
* the name
* the method, property, or anchor (optional)
* the display name
For example: `{@link ng.type:$rootScope.Scope#$new Scope.$new()}`.
* `@example` - specifies an example. This can be a simple code block, or a
[runnable example](#the-example-tag).
* `@deprecated` - specifies that the following code is deprecated and should not be used.
In The AngularJS docs, there are two specific patterns which can be used to further describe
the deprecation: `sinceVersion="<version>"` and `removeVersion="<version>"`
The `type` in `@param` and `@returns` must be wrapped in `{}` curly braces, e.g. `{Object|Array}`.
Parameters can be made optional by *either* appending a `=` to the type, e.g. `{Object=}`, *or* by
putting the `[name]` in square brackets.
Default values are only possible with the second syntax by appending `=<value>` to the parameter
name, e.g. `@param {boolean} [ownPropsOnly=false]`.
Descriptions can contain markdown formatting.
#### AngularJS-specific jsdoc directives
In addition to the standard jsdoc tags, there are a number that are specific to the Angular
code-base:
* `@ngdoc` - specifies the type of thing being documented. See below for more detail.
* `@eventType emit|broadcast` - specifies whether the event is emitted or broadcast
* `@usage` - shows how to use a `function` or `directive`. Is usually automatically generated.
* `@knownIssue` - adds info about known quirks, problems, or limitations with the API, and possibly,
workarounds. This section is not for bugs.
The following are specific to directives:
* `@animations` - specifies the animations a directive supports
* `@multiElement` - specifies if a directive can span over multiple elements
* `@priority` - specifies a directive's priority
* `@restrict` - is extracted to show the usage of a directive. For example, for [E]lement,
[A]ttribute, and [C]lass, use `@restrict ECA`
* `@scope` - specifies that a directive will create a new scope
### The `@ngdoc` Directive
This directive helps to specify the template used to render the item being documented. For instance,
a directive would have different properties to a filter and so would be documented differently. The
commonly used types are:
* `overview` - a general page (guide, api index)
* `provider` - AngularJS provider, such as `$compileProvider` or `$httpProvider`.
* `service` - injectable AngularJS service, such as `$compile` or `$http`.
* `object` - well defined object (often exposed as a service)
* `function` - function that will be available to other methods (such as a helper function within
the ng module)
* `method` - method on an object/service/controller
* `property` - property on an object/service/controller
* `event` - AngularJS event that will propagate through the `$scope` tree.
* `directive` - AngularJS directive
* `filter` - AngularJS filter
* `error` - minErr error description
### General documentation with Markdown
Any text in tags can contain markdown syntax for formatting. Generally, you can use any markdown
feature.
#### Headings
Only use *h2* headings and lower, as the page title is set in *h1*. Also make sure you follow the
heading hierarchy. This ensures correct table of contents are created.
#### Code blocks
In line code can be specified by enclosing the code in back-ticks (\`).
A block of multi-line code can be enclosed in triple back-ticks (\`\`\`) but it is formatted better
if it is enclosed in &lt;pre&gt;...&lt;/pre&gt; tags and the code lines themselves are indented.
### Writing runnable (live) examples and e2e tests
It is possible to embed examples in the documentation along with appropriate e2e tests. These
examples and scenarios will be converted to runnable code within the documentation. So it is
important that they work correctly. To ensure this, all these e2e scenarios are run as part of the
continuous integration tests.
If you are adding an example with an e2e test, you should [run the test locally](#e2e-tests) first
to ensure it passes. You can change `it(...)` to `fit(...)` to run only your test,
but make sure you change it back to `it(...)` before committing.
#### The `<example>` tag
This tag identifies a block of HTML that will define a runnable example. It can take the following
attributes:
* `animations` - if set to `true` then this example uses ngAnimate.
* `deps` - Semicolon-separated list of additional angular module files to be loaded,
e.g. `angular-animate.js`
* `name` - every example should have a name. It should start with the component, e.g directive name,
and not contain whitespace
* `module` - the name of the app module as defined in the example's JavaScript
Within this tag we provide `<file>` tags that specify what files contain the example code.
```
<example
module="angularAppModule"
name="exampleName"
deps="angular-animate.js;angular-route.js"
animations="true">
...
<file name="index.html">...</file>
<file name="script.js">...</file>
<file name="animations.css">...</file>
<file name="protractor.js">...</file>
...
</example>
```
You can see an example of a well-defined example [in the `ngRepeat` documentation][code.ngRepeat-example].
[closing-issues]: https://help.github.com/articles/closing-issues-via-commit-messages/
[Closure guide to i18n changes]: https://github.com/google/closure-library/wiki/Internationalization-%28i18n%29-changes-in-Closure-Library
[code.badrestrict]: https://github.com/angular/angular.js/blob/202f1809ad14827a6ac6a125157c605d65e0b551/src/ng/compile.js#L1107-L1110
[code.debugInfoEnabled]: https://github.com/angular/angular.js/blob/32fbb2e78f53d765fbb170f7cf99e42e072d363b/src/ng/compile.js#L1378-L1413
[code.html5Mode]: https://github.com/angular/angular.js/blob/202f1809ad14827a6ac6a125157c605d65e0b551/src/ng/location.js#L752-L797
[code.minErr]: https://github.com/angular/angular.js/blob/202f1809ad14827a6ac6a125157c605d65e0b551/src/minErr.js#L53-L113
[code.ngRepeat-example]: https://github.com/angular/angular.js/blob/0822d34b10ea0371c260c80a1486a4d508ea5a91/src/ng/directive/ngRepeat.js#L249-L340
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[Common Locale Data Repository (CLDR)]: http://cldr.unicode.org
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
[dgeni]: https://github.com/angular/dgeni
[docs.badrestrict]: docs/content/error/$compile/badrestrict.ngdoc
[docs.provider]: https://code.angularjs.org/snapshot/docs/api/auto/service/$provide#provider
[git-revert]: https://git-scm.com/docs/git-revert
[git-setup]: https://help.github.com/articles/set-up-git
[github-issues]: https://github.com/angular/angular.js/issues
[github]: https://github.com/angular/angular.js
[js-style-guide]: https://google.github.io/styleguide/javascriptguide.xml
[karma-browserstack]: https://github.com/karma-runner/karma-browserstack-launcher
[karma-saucelabs]: https://github.com/karma-runner/karma-sauce-launcher
[unit-testing]: https://docs.angularjs.org/guide/unit-testing
[yarn-install]: https://yarnpkg.com/en/docs/install
+330 -117
View File
@@ -1,34 +1,90 @@
'use strict';
var serveFavicon = require('serve-favicon');
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
var files = require('./angularFiles').files;
var mergeFilesFor = require('./angularFiles').mergeFilesFor;
var util = require('./lib/grunt/utils.js');
var versionInfo = require('./lib/versions/version-info');
var path = require('path');
var e2e = require('./test/e2e/tools');
var semver = require('semver');
var exec = require('shelljs').exec;
var pkg = require(__dirname + '/package.json');
var codeScriptFolder = util.codeScriptFolder;
var docsScriptFolder = util.docsScriptFolder;
// Node.js version checks
if (!semver.satisfies(process.version, pkg.engines.node)) {
reportOrFail('Invalid node version (' + process.version + '). ' +
'Please use a version that satisfies ' + pkg.engines.node);
}
// Yarn version checks
var expectedYarnVersion = pkg.engines.yarn;
var currentYarnVersion = exec('yarn --version', {silent: true}).stdout.trim();
if (!semver.satisfies(currentYarnVersion, expectedYarnVersion)) {
reportOrFail('Invalid yarn version (' + currentYarnVersion + '). ' +
'Please use a version that satisfies ' + expectedYarnVersion);
}
// Grunt CLI version checks
var expectedGruntVersion = pkg.engines['grunt-cli'];
var currentGruntVersions = exec('grunt --version', {silent: true}).stdout;
var match = /^grunt-cli v(.+)$/m.exec(currentGruntVersions);
if (!match) {
reportOrFail('Unable to compute the current grunt-cli version. We found:\n' +
currentGruntVersions);
} else {
if (!semver.satisfies(match[1], expectedGruntVersion)) {
reportOrFail('Invalid grunt-cli version (' + match[1] + '). ' +
'Please use a version that satisfies ' + expectedGruntVersion);
}
}
// Ensure Node.js dependencies have been installed
if (!process.env.CI) {
var yarnOutput = exec('yarn install');
if (yarnOutput.code !== 0) {
throw new Error('Yarn install failed: ' + yarnOutput.stderr);
}
}
module.exports = function(grunt) {
//grunt plugins
// this loads all the node_modules that start with `grunt-` as plugins
require('load-grunt-tasks')(grunt);
// load additional grunt tasks
grunt.loadTasks('lib/grunt');
grunt.loadNpmTasks('angular-benchpress');
// compute version related info for this build
var NG_VERSION = versionInfo.currentVersion;
NG_VERSION.cdn = versionInfo.cdnVersion;
var dist = 'angular-'+ NG_VERSION.full;
var dist = 'angular-' + NG_VERSION.full;
//global beforeEach
util.init();
var deployVersion = NG_VERSION.full;
if (NG_VERSION.isSnapshot) {
deployVersion = NG_VERSION.distTag === 'latest' ? 'snapshot-stable' : 'snapshot';
}
if (versionInfo.cdnVersion == null) {
throw new Error('Unable to read CDN version, are you offline or has the CDN not been properly pushed?\n' +
'Perhaps you want to set the NG1_BUILD_NO_REMOTE_VERSION_REQUESTS environment variable?');
}
//config
grunt.initConfig({
NG_VERSION: NG_VERSION,
parallel: {
travis: {
tasks: [
util.parallelTask(['test:unit', 'test:promises-aplus', 'tests:docs'], {stream: true}),
util.parallelTask(['test:e2e'])
]
bp_build: {
options: {
buildPath: 'build/benchmarks',
benchmarksPath: 'benchmarks'
}
},
@@ -39,37 +95,39 @@ module.exports = function(grunt) {
hostname: '0.0.0.0',
base: '.',
keepalive: true,
middleware: function(connect, options){
middleware: function(connect, options) {
var base = Array.isArray(options.base) ? options.base[options.base.length - 1] : options.base;
return [
//uncomment to enable CSP
// util.csp(),
util.conditionalCsp(),
util.rewrite(),
connect.favicon('images/favicon.ico'),
connect.static(options.base),
connect.directory(options.base)
e2e.middleware(),
serveFavicon('images/favicon.ico'),
serveStatic(base),
serveIndex(base)
];
}
}
},
testserver: {
options: {
// We use end2end task (which does not start the webserver)
// and start the webserver as a separate process (in travis_build.sh)
// to avoid https://github.com/joyent/libuv/issues/826
// We start the webserver as a separate process from the E2E tests
port: 8000,
hostname: '0.0.0.0',
middleware: function(connect, options){
middleware: function(connect, options) {
var base = Array.isArray(options.base) ? options.base[options.base.length - 1] : options.base;
return [
function(req, resp, next) {
// cache get requests to speed up tests on travis
// cache GET requests to speed up tests
if (req.method === 'GET') {
resp.setHeader('Cache-control', 'public, max-age=3600');
}
next();
},
connect.favicon('images/favicon.ico'),
connect.static(options.base)
util.conditionalCsp(),
e2e.middleware(),
serveFavicon('images/favicon.ico'),
serveStatic(base)
];
}
}
@@ -80,14 +138,20 @@ module.exports = function(grunt) {
tests: {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
'jquery-2.2': 'karma-jquery-2.2.conf.js',
'jquery-2.1': 'karma-jquery-2.1.conf.js',
docs: 'karma-docs.conf.js',
modules: 'karma-modules.conf.js'
modules: 'karma-modules.conf.js',
'modules-ngAnimate': 'karma-modules-ngAnimate.conf.js',
'modules-ngMock': 'karma-modules-ngMock.conf.js'
},
autotest: {
jqlite: 'karma-jqlite.conf.js',
jquery: 'karma-jquery.conf.js',
'jquery-2.2': 'karma-jquery-2.2.conf.js',
'jquery-2.1': 'karma-jquery-2.1.conf.js',
modules: 'karma-modules.conf.js',
docs: 'karma-docs.conf.js'
},
@@ -95,79 +159,42 @@ module.exports = function(grunt) {
protractor: {
normal: 'protractor-conf.js',
travis: 'protractor-travis-conf.js',
jenkins: 'protractor-jenkins-conf.js'
circleci: 'protractor-circleci-conf.js'
},
clean: {
build: ['build'],
tmp: ['tmp']
tmp: ['tmp'],
deploy: [
codeScriptFolder + '/deploy',
docsScriptFolder + '/deploy',
docsScriptFolder + '/functions/content'
]
},
jshint: {
options: {
jshintrc: true,
},
node: {
files: { src: ['*.js', 'lib/**/*.js'] },
},
tests: {
files: { src: 'test/**/*.js' },
},
ng: {
files: { src: files['angularSrc'] },
},
ngAnimate: {
files: { src: 'src/ngAnimate/**/*.js' },
},
ngCookies: {
files: { src: 'src/ngCookies/**/*.js' },
},
ngLocale: {
files: { src: 'src/ngLocale/**/*.js' },
},
ngMessages: {
files: { src: 'src/ngMessages/**/*.js' },
},
ngMock: {
files: { src: 'src/ngMock/**/*.js' },
},
ngResource: {
files: { src: 'src/ngResource/**/*.js' },
},
ngRoute: {
files: { src: 'src/ngRoute/**/*.js' },
},
ngSanitize: {
files: { src: 'src/ngSanitize/**/*.js' },
},
ngScenario: {
files: { src: 'src/ngScenario/**/*.js' },
},
ngTouch: {
files: { src: 'src/ngTouch/**/*.js' },
}
},
jscs: {
src: ['src/**/*.js', 'test/**/*.js'],
options: {
config: ".jscs.json"
eslint: {
all: {
src: [
'*.js',
'benchmarks/**/*.js',
'docs/**/*.js',
'lib/**/*.js',
'scripts/**/*.js',
'!scripts/*/*/node_modules/**',
'src/**/*.js',
'test/**/*.js',
'i18n/**/*.js',
'!docs/app/assets/js/angular-bootstrap/**',
'!docs/config/templates/**',
'!src/angular.bind.js',
'!i18n/closure/**',
'!src/ngParseExt/ucd.js'
]
}
},
build: {
scenario: {
dest: 'build/angular-scenario.js',
src: [
'bower_components/jquery/dist/jquery.js',
util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
],
styles: {
css: ['css/angular.css', 'css/angular-scenario.css']
}
},
angular: {
dest: 'build/angular.js',
src: util.wrap([files['angularSrc']], 'angular'),
@@ -185,6 +212,12 @@ module.exports = function(grunt) {
dest: 'build/angular-touch.js',
src: util.wrap(files['angularModules']['ngTouch'], 'module')
},
touchModuleTestBundle: {
dest: 'build/test-bundles/angular-touch.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngTouch'),
suffix: 'src/module.suffix'
},
mocks: {
dest: 'build/angular-mocks.js',
src: util.wrap(files['angularModules']['ngMock'], 'module'),
@@ -194,14 +227,42 @@ module.exports = function(grunt) {
dest: 'build/angular-sanitize.js',
src: util.wrap(files['angularModules']['ngSanitize'], 'module')
},
sanitizeModuleTestBundle: {
dest: 'build/test-bundles/angular-sanitize.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngSanitize'),
suffix: 'src/module.suffix'
},
resource: {
dest: 'build/angular-resource.js',
src: util.wrap(files['angularModules']['ngResource'], 'module')
},
resourceModuleTestBundle: {
dest: 'build/test-bundles/angular-resource.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngResource'),
suffix: 'src/module.suffix'
},
messageformat: {
dest: 'build/angular-message-format.js',
src: util.wrap(files['angularModules']['ngMessageFormat'], 'module')
},
messageformatModuleTestBundle: {
dest: 'build/test-bundles/angular-message-format.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngMessageFormat'),
suffix: 'src/module.suffix'
},
messages: {
dest: 'build/angular-messages.js',
src: util.wrap(files['angularModules']['ngMessages'], 'module')
},
messagesModuleTestBundle: {
dest: 'build/test-bundles/angular-messages.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngMessages'),
suffix: 'src/module.suffix'
},
animate: {
dest: 'build/angular-animate.js',
src: util.wrap(files['angularModules']['ngAnimate'], 'module')
@@ -210,13 +271,39 @@ module.exports = function(grunt) {
dest: 'build/angular-route.js',
src: util.wrap(files['angularModules']['ngRoute'], 'module')
},
routeModuleTestBundle: {
dest: 'build/test-bundles/angular-route.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngRoute'),
suffix: 'src/module.suffix'
},
cookies: {
dest: 'build/angular-cookies.js',
src: util.wrap(files['angularModules']['ngCookies'], 'module')
},
"promises-aplus-adapter": {
cookiesModuleTestBundle: {
dest: 'build/test-bundles/angular-cookies.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngCookies'),
suffix: 'src/module.suffix'
},
aria: {
dest: 'build/angular-aria.js',
src: util.wrap(files['angularModules']['ngAria'], 'module')
},
ariaModuleTestBundle: {
dest: 'build/test-bundles/angular-aria.js',
prefix: 'src/module.prefix',
src: mergeFilesFor('karmaModules-ngAria'),
suffix: 'src/module.suffix'
},
parseext: {
dest: 'build/angular-parse-ext.js',
src: util.wrap(files['angularModules']['ngParseExt'], 'module')
},
'promises-aplus-adapter': {
dest:'tmp/promises-aplus-adapter++.js',
src:['src/ng/q.js','lib/promises-aplus/promises-aplus-test-adapter.js']
src:['src/ng/q.js', 'lib/promises-aplus/promises-aplus-test-adapter.js']
}
},
@@ -226,25 +313,42 @@ module.exports = function(grunt) {
animate: 'build/angular-animate.js',
cookies: 'build/angular-cookies.js',
loader: 'build/angular-loader.js',
messageformat: 'build/angular-message-format.js',
messages: 'build/angular-messages.js',
touch: 'build/angular-touch.js',
resource: 'build/angular-resource.js',
route: 'build/angular-route.js',
sanitize: 'build/angular-sanitize.js'
sanitize: 'build/angular-sanitize.js',
aria: 'build/angular-aria.js',
parseext: 'build/angular-parse-ext.js'
},
"ddescribe-iit": {
'ddescribe-iit': {
files: [
'src/**/*.js',
'test/**/*.js',
'!test/ngScenario/DescribeSpec.js',
'!src/ng/directive/attrs.js', // legitimate xit here
'!src/ngScenario/**/*.js'
]
'!test/helpers/privateMocks*.js'
],
options: {
disallowed: [
'fit',
'iit',
'xit',
'fthey',
'tthey',
'xthey',
'fdescribe',
'ddescribe',
'xdescribe',
'it.only',
'describe.only'
]
}
},
"merge-conflict": {
'merge-conflict': {
files: [
'src/**/*',
'test/**/*',
@@ -256,7 +360,53 @@ module.exports = function(grunt) {
copy: {
i18n: {
files: [
{ src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
{
src: 'src/ngLocale/**',
dest: 'build/i18n/',
expand: true,
flatten: true
}
]
},
deployFirebaseCode: {
files: [
{
cwd: 'build',
src: '**',
dest: codeScriptFolder + '/deploy/' + deployVersion + '/',
expand: true
}
]
},
deployFirebaseDocs: {
files: [
// The source files are needed by the embedded examples in the docs app.
{
src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'],
dest: docsScriptFolder + '/deploy/',
expand: true,
flatten: true
},
{
cwd: 'build/docs',
src: ['**', '!ptore2e/**', '!index*.html'],
dest: docsScriptFolder + '/deploy/',
expand: true
},
{
src: 'build/docs/index-production.html',
dest: docsScriptFolder + '/deploy/index.html'
},
{
src: 'build/docs/index-production.html',
dest: docsScriptFolder + '/functions/content/index.html'
},
{
cwd: 'build/docs',
src: 'partials/**',
dest: docsScriptFolder + '/functions/content/',
expand: true
}
]
}
},
@@ -264,7 +414,7 @@ module.exports = function(grunt) {
compress: {
build: {
options: {archive: 'build/' + dist +'.zip', mode: 'zip'},
options: {archive: 'build/' + dist + '.zip', mode: 'zip'},
src: ['**'],
cwd: 'build',
expand: true,
@@ -273,14 +423,17 @@ module.exports = function(grunt) {
}
},
shell:{
"promises-aplus-tests":{
options:{
//stdout:true,
stderr:true,
failOnError:true
shell: {
'install-node-dependencies': {
command: 'yarn'
},
'promises-aplus-tests': {
options: {
stdout: false,
stderr: true,
failOnError: true
},
command:path.normalize('./node_modules/.bin/promises-aplus-tests tmp/promises-aplus-adapter++.js')
command: path.normalize('./node_modules/.bin/promises-aplus-tests tmp/promises-aplus-adapter++.js --timeout 2000')
}
},
@@ -300,23 +453,83 @@ module.exports = function(grunt) {
}
});
//alias tasks
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'jscs', 'package','test:unit','test:promises-aplus', 'tests:docs', 'test:protractor']);
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', [
'eslint',
'package',
'test:unit',
'test:promises-aplus',
'tests:docs',
'test:protractor'
]);
grunt.registerTask('test:jqlite', 'Run the unit tests with Karma' , ['tests:jqlite']);
grunt.registerTask('test:jquery', 'Run the jQuery unit tests with Karma', ['tests:jquery']);
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
grunt.registerTask('test:jquery', 'Run the jQuery (latest) unit tests with Karma', ['tests:jquery']);
grunt.registerTask('test:jquery-2.2', 'Run the jQuery 2.2 unit tests with Karma', ['tests:jquery-2.2']);
grunt.registerTask('test:jquery-2.1', 'Run the jQuery 2.1 unit tests with Karma', ['tests:jquery-2.1']);
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', [
'build',
'tests:modules',
'tests:modules-ngAnimate',
'tests:modules-ngMock'
]);
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:normal']);
grunt.registerTask('test:travis-protractor', 'Run the end to end tests with Protractor for Travis CI builds', ['connect:testserver', 'protractor:travis']);
grunt.registerTask('test:ci-protractor', 'Run the end to end tests with Protractor for Jenkins CI builds', ['webdriver', 'connect:testserver', 'protractor:jenkins']);
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', [
'test:jqlite',
'test:jquery',
'test:jquery-2.2',
'test:jquery-2.1',
'test:modules'
]);
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', [
'webdriver',
'connect:testserver',
'protractor:normal'
]);
grunt.registerTask('test:circleci-protractor', 'Run the end to end tests with Protractor for CircleCI builds', [
'connect:testserver',
'protractor:circleci'
]);
grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']);
grunt.registerTask('test:promises-aplus',['build:promises-aplus-adapter','shell:promises-aplus-tests']);
grunt.registerTask('minify', ['bower','clean', 'build', 'minall']);
grunt.registerTask('test:promises-aplus',[
'build:promises-aplus-adapter',
'shell:promises-aplus-tests'
]);
grunt.registerTask('minify', [
'clean',
'build',
'minall'
]);
grunt.registerTask('webserver', ['connect:devserver']);
grunt.registerTask('package', ['bower','clean', 'buildall', 'minall', 'collect-errors', 'docs', 'copy', 'write', 'compress']);
grunt.registerTask('ci-checks', ['ddescribe-iit', 'merge-conflict', 'jshint', 'jscs']);
grunt.registerTask('package', [
'validate-angular-files',
'clean',
'buildall',
'minall',
'collect-errors',
'write',
'docs',
'copy:i18n',
'compress:build'
]);
grunt.registerTask('ci-checks', [
'ddescribe-iit',
'merge-conflict',
'eslint'
]);
grunt.registerTask('prepareDeploy', [
'copy:deployFirebaseCode',
'copy:deployFirebaseDocs'
]);
grunt.registerTask('default', ['package']);
};
function reportOrFail(message) {
if (process.env.CI) {
throw new Error(message);
} else {
console.log('===============================================================================');
console.log(message);
console.log('===============================================================================');
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2010-2014 Google, Inc. http://angularjs.org
Copyright (c) 2010-2020 Google LLC. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+3 -3
View File
@@ -1,13 +1,13 @@
Using AngularJS with the Closure Compiler
=========================================
The Closure Compiler project contains externs definitions for AngularJS
JavaScript in its `contrib/externs` directory.
The Closure Compiler project contains definitions for the AngularJS JavaScript
in its `contrib/externs` directory.
The definitions contain externs for use with the Closure compiler (aka
JSCompiler). Passing these files to the --externs parameter of a compiler
pass allows using type annotations for AngularJS objects. For example,
Angular's $scope objects can be annotated as:
AngularJS's $scope objects can be annotated as:
```js
/** @type {angular.Scope} */
var scope = $scope;
+90 -25
View File
@@ -1,44 +1,109 @@
AngularJS [![Build Status](https://travis-ci.org/angular/angular.js.svg?branch=master)](https://travis-ci.org/angular/angular.js)
AngularJS [![CircleCI](https://circleci.com/gh/angular/angular.js/tree/master.svg?style=shield)](https://circleci.com/gh/angular/workflows/angular.js/tree/master)
=========
AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you
use good old HTML (or HAML, Jade and friends!) as your template language and lets you extend HTMLs
use good old HTML (or HAML, Jade/Pug and friends!) as your template language and lets you extend HTMLs
syntax to express your applications components clearly and succinctly. It automatically
synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data
binding. To help you structure your application better and make it easy to test, AngularJS teaches
the browser how to do dependency injection and inversion of control. Oh yeah and it also helps with
server-side communication, taming async callbacks with promises and deferreds; and makes client-side
navigation and deeplinking with hashbang urls or HTML5 pushState a piece of cake. The best of all:
it makes development fun!
the browser how to do dependency injection and inversion of control.
* Web site: http://angularjs.org
* Tutorial: http://docs.angularjs.org/tutorial
* API Docs: http://docs.angularjs.org/api
* Developer Guide: http://docs.angularjs.org/guide
* Contribution guidelines: http://docs.angularjs.org/misc/contribute
* Dashboard: http://dashboard.angularjs.org
It also helps with server-side communication, taming async callbacks with promises and deferred objects,
and it makes client-side navigation and deep linking with hashbang urls or HTML5 pushState a
piece of cake. Best of all? It makes development fun!
Building AngularJS
---------
[Once you have your environment setup](http://docs.angularjs.org/misc/contribute) just run:
--------------------
grunt package
**AngularJS support has officially ended as of January 2022.
[See what ending support means](https://docs.angularjs.org/misc/version-support-status)
and [read the end of life announcement](https://goo.gle/angularjs-end-of-life).**
**Visit [angular.io](https://angular.io) for the actively supported Angular.**
--------------------
* Web site: https://angularjs.org
* Tutorial: https://docs.angularjs.org/tutorial
* API Docs: https://docs.angularjs.org/api
* Developer Guide: https://docs.angularjs.org/guide
* Contribution guidelines: [CONTRIBUTING.md](CONTRIBUTING.md)
* Core Development: [DEVELOPERS.md](DEVELOPERS.md)
* Dashboard: https://dashboard.angularjs.org
Running Tests
-------------
To execute all unit tests, use:
Documentation
--------------------
Go to https://docs.angularjs.org
grunt test:unit
Contribute
--------------------
To execute end-to-end (e2e) tests, use:
We've set up a separate document for our
[contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
grunt package
grunt test:e2e
Develop
--------------------
To learn more about the grunt tasks, run `grunt --help` and also read our
[contribution guidelines](http://docs.angularjs.org/misc/contribute).
We've set up a separate document for
[developers](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md).
[![Analytics](https://ga-beacon.appspot.com/UA-8594346-11/angular.js/README.md?pixel)](https://github.com/igrigorik/ga-beacon)
What to use AngularJS for and when to use it
---------
AngularJS is the next generation framework where each component is designed to work with every other
component in an interconnected way like a well-oiled machine. AngularJS is JavaScript MVC made easy
and done right. (Well it is not really MVC, read on, to understand what this means.)
#### MVC, no, MV* done the right way!
[MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), short for
Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the
different parts of an application separated for proper readability and debugging. Model is the data
and the database. View is the user interface and what the user sees. Controller is the main link
between Model and View. These are the three pillars of major programming frameworks present on the
market today. On the other hand AngularJS works on MV*, short for Model-View-_Whatever_. The
_Whatever_ is AngularJS's way of telling that you may create any kind of linking between the Model
and the View here.
Unlike other frameworks in any programming language, where MVC, the three separate components, each
one has to be written and then connected by the programmer, AngularJS helps the programmer by asking
him/her to just create these and everything else will be taken care of by AngularJS.
#### Interconnection with HTML at the root level
AngularJS uses HTML to define the user's interface. AngularJS also enables the programmer to write
new HTML tags (AngularJS Directives) and increase the readability and understandability of the HTML
code. Directives are AngularJSs way of bringing additional functionality to HTML. Directives
achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY
(Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the
application.
HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where
to load the app, which components or controllers to use for each element, etc. We specify "what"
gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort
of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various
moving parts, we simply define what we want and AngularJS will take care of the dependencies.
#### Data Handling made simple
Data and Data Models in AngularJS are plain JavaScript objects and one can add and change properties
directly on it and loop over objects and arrays at will.
#### Two-way Data Binding
One of AngularJS's strongest features. Two-way Data Binding means that if something changes in the
Model, the change gets reflected in the View instantaneously, and the same happens the other way
around. This is also referred to as Reactive Programming, i.e. suppose `a = b + c` is being
programmed and after this, if the value of `b` and/or `c` is changed then the value of `a` will be
automatically updated to reflect the change. AngularJS uses its "scopes" as a glue between the Model
and View and makes these updates in one available for the other.
#### Less Written Code and Easily Maintainable Code
Everything in AngularJS is created to enable the programmer to end up writing less code that is
easily maintainable and readable by any other new person on the team. Believe it or not, one can
write a complete working two-way data binded application in less than 10 lines of code. Try and see
for yourself!
#### Testing Ready
AngularJS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies
to its controllers and services whenever required. This helps in making the AngularJS code ready for
unit testing by making use of mock dependencies created and injected. This makes AngularJS more
modular and easily testable thus in turn helping a team create more robust applications.
+98
View File
@@ -0,0 +1,98 @@
# AngularJS Release instructions
## Compare the list of commits between stable and unstable
There is a script - compare-master-to-stable.js - that helps with this.
We just want to make sure that good commits (low risk fixes + docs fixes) got cherry-picked into stable branch and nothing interesting got merged only into stable branch.
## Pick a release name (for this version)
A super-heroic power (adverb-verb phrase).
## Generate release notes
Example Commit: https://github.com/angular/angular.js/commit/7ab5098c14ee4f195dbfe2681e402fe2dfeacd78
1) Run
```bash
node_modules/.bin/changez -o changes.md -v <new version> <base branch>
```
2) Review the generated file and manually fix typos, group and reorder stuff if needed.
3) Move the content into CHANGELOG.md add release code-names to headers.
4) Push the changes to your private github repo and review.
5) cherry-pick the release notes commit to the appropriate branches.
## Pick a commit to release (for this version)
Usually this will be the commit containing the release notes, but it may also be in the past.
## Run "release" script
```bash
scripts/release/release.sh --git-push-dryrun=false --commit-sha=8822a4f --version-number=1.7.6 --version-name=gravity-manipulation
```
1) The SHA is of the commit to release (could be in the past).
2) The version number and code-name that should be released, not the next version number (e.g. to release 1.2.12 you enter 1.2.12 as release version and the code-name that was picked for 1.2.12, cauliflower-eradication).
3) You will need to have write access to all the AngularJS github dist repositories and publish rights for the AngularJS packages on npm.
## Update GitHub milestones
1) Create the next milestone if it doesn't exist yet-giving ita due date.
2) Move all open issues and PRs for the current milestone to the next milestone<br>
You can do this by filtering the current milestone, selecting via checklist, and moving to the next milestone within the GH issues page.
3) Close the current milestone click the milestones tab and close from there.
4) Create a new holding milestone for the release after next-but don't give it a due date otherwise that will mess up the dashboard.
## Push build artifacts to CDN
Google CDNs are fed with data from google3 every day at 11:15am PT it takes only few minutes for the import to propagate).
If we want to make our files available, we need submit our CLs before this time on the day of the release.
## Don't update the package.json (branchVersion) until the CDN has updated
This is the version used to compute what version to link to in the CDN. If you update this too early then the CDN lookup fails and you end up with 'null, for the version, which breaks the docs.
## Verify angularjs.org download modal has latest version (updates via CI job)
The versions in the modal are updated (based on the versions available on CDN) as part of the CI deploy stage.
(You may need to explicitly trigger the CI job. e.g. re-running the last `deploy` job.)
## Announce the release (via official Google accounts)
Double check that angularjs.org is up to date with the new release version before sharing.
1) Collect a list of contributors
use: `git log --format='%aN' v1.2.12..v1.2.13 | sort -u`
2) Write a blog post (for minor releases, not patch releases) and publish it with the "release" tag
3) Post on twitter as yourself (tweet from your heart; there is no template for this), retweet as @AngularJS
## Party!
## Major Release Tasks
1) Update angularjs.org to use the latest branch.
2) Write up a migration document.
3) Create a new git branch for the version that has been released (e.g. 1.8.x).
4) Check that the build and release scripts still work.
5) Update the dist-tag of the old branch, see https://github.com/angular/angular.js/pull/12722.
6) Write a blog post.
+16
View File
@@ -0,0 +1,16 @@
# Security Policy
## Supported Versions
**AngularJS support has officially ended as of January 2022.**
[See what ending support means](https://docs.angularjs.org/misc/version-support-status)
and [read the end of life announcement](https://goo.gle/angularjs-end-of-life).
Visit [angular.io](https://angular.io) for the actively supported Angular.
| Version | Supported | Status | Comments |
| ----------- | ------------------ | --------------------- | ------------------------------------ |
| 1.8.x | :x: | All support ended | |
| 1.3.x-1.7.x | :x: | All support ended | |
| 1.2.x | :x: | All support ended | Last version to provide IE 8 support |
| <1.2.0 | :x: | All support ended | |
+10 -9
View File
@@ -1,6 +1,6 @@
# Triage new issues/PRs on github
This document shows the steps the Angular team is using to triage issues.
This document shows the steps the AngularJS team is using to triage issues.
The labels are used later on for [planning releases](#assigning-work).
@@ -20,13 +20,12 @@ The following is done automatically so you don't have to worry about it:
This process based on the idea of minimizing user pain
[from this blog post](http://www.lostgarden.com/2008/05/improving-bug-triage-with-user-pain.html).
1. Open the list of [non triaged issues](https://github.com/angular/angular.js/issues?direction=desc&milestone=none&page=1&sort=created&state=open)
1. Open the list of [non triaged issues](https://github.com/angular/angular.js/issues?q=is%3Aopen+sort%3Acreated-desc+no%3Amilestone)
* Sort by submit date, with the newest issues first
* You don't have to do issues in order; feel free to pick and choose issues as you please.
* You can triage older issues as well
* Triage to your heart's content
1. Assign yourself: Pick an issue that is not assigned to anyone and assign it to you
1. Understandable? - verify if the description of the request is clear.
* If not, [close it][] according to the instructions below and go to the last step.
1. Duplicate?
@@ -36,7 +35,6 @@ This process based on the idea of minimizing user pain
* Label `Type: Bug`
* Reproducible? - Steps to reproduce the bug are clear. If they are not, ask for a clarification. If there's no reply after a week, [close it][].
* Reproducible on master? - <http://code.angularjs.org/snapshot/>
1. Non bugs:
* Label `Type: Feature`, `Type: Chore`, or `Type: Perf`
* Belongs in core? Often new features should be implemented as a third-party module rather than an addition to the core.
@@ -47,19 +45,22 @@ This process based on the idea of minimizing user pain
1. Label `frequency: *` How often does this issue come up? How many developers does this affect? Chose just one of the following:
* low - obscure issue affecting a handful of developers
* moderate - impacts a common usage pattern
* high - impacts most or all Angular apps
* high - impacts most or all AngularJS apps
1. Label `severity: *` - How bad is the issue? Chose just one of the following:
* security issue
* regression
* memory leak
* broken expected use - it's hard or impossible for a developer using Angular to accomplish something that Angular should be able to do
* broken expected use - it's hard or impossible for a developer using AngularJS to accomplish something that AngularJS should be able to do
* confusing - unexpected or inconsistent behavior; hard-to-debug
* inconvenience - causes ugly/boilerplate code in apps
1. Label `component: *`
* In rare cases, it's ok to have multiple components.
1. Label `PRs plz!` - These issues are good targets for PRs from the open source community. Apply to issues where the problem and solution are well defined in the comments, and it's not too complex.
1. Label `PRs plz!` - These issues are good targets for PRs from the open source community. In addition to applying this label, you must:
* Leave a comment explaining the problem and solution so someone can easily finish it.
* Assign the issue to yourself.
* Give feedback on PRs addressing this issue.
* You are responsible for mentoring contributors helping with this issue.
1. Label `origin: google` for issues from Google
1. Assign a milestone:
* Backlog - triaged fixes and features, should be the default choice
* Current 1.x.y milestone (e.g. 1.3.0-beta-2) - regressions and urgent bugs only
@@ -94,7 +95,7 @@ You can mention him in the relevant thread like this: `@btford`.
> Thanks for submitting this issue!
> Unfortunately, we don't think this functionality belongs in core.
> The good news is that you could easily implement this as a third-party module and publish it on Bower and/or npm.
> The good news is that you could easily implement this as a third-party module and publish it to the npm registry.
## Assigning Work
Vendored Executable → Regular
+155 -53
View File
@@ -5,6 +5,8 @@ var angularFiles = {
'src/minErr.js',
'src/Angular.js',
'src/loader.js',
'src/shallowCopy.js',
'src/stringify.js',
'src/AngularPublic.js',
'src/jqLite.js',
'src/apis.js',
@@ -13,17 +15,21 @@ var angularFiles = {
'src/ng/anchorScroll.js',
'src/ng/animate.js',
'src/ng/asyncCallback.js',
'src/ng/animateRunner.js',
'src/ng/animateCss.js',
'src/ng/browser.js',
'src/ng/cacheFactory.js',
'src/ng/compile.js',
'src/ng/controller.js',
'src/ng/document.js',
'src/ng/exceptionHandler.js',
'src/ng/forceReflow.js',
'src/ng/http.js',
'src/ng/httpBackend.js',
'src/ng/interpolate.js',
'src/ng/interval.js',
'src/ng/intervalFactory.js',
'src/ng/jsonpCallbacks.js',
'src/ng/locale.js',
'src/ng/location.js',
'src/ng/log.js',
@@ -31,12 +37,17 @@ var angularFiles = {
'src/ng/q.js',
'src/ng/raf.js',
'src/ng/rootScope.js',
'src/ng/rootElement.js',
'src/ng/sanitizeUri.js',
'src/ng/sce.js',
'src/ng/sniffer.js',
'src/ng/taskTrackerFactory.js',
'src/ng/templateRequest.js',
'src/ng/testability.js',
'src/ng/timeout.js',
'src/ng/urlUtils.js',
'src/ng/window.js',
'src/ng/cookieReader.js',
'src/ng/filter.js',
'src/ng/filter/filter.js',
@@ -50,6 +61,7 @@ var angularFiles = {
'src/ng/directive/form.js',
'src/ng/directive/input.js',
'src/ng/directive/ngBind.js',
'src/ng/directive/ngChange.js',
'src/ng/directive/ngClass.js',
'src/ng/directive/ngCloak.js',
'src/ng/directive/ngController.js',
@@ -58,8 +70,13 @@ var angularFiles = {
'src/ng/directive/ngIf.js',
'src/ng/directive/ngInclude.js',
'src/ng/directive/ngInit.js',
'src/ng/directive/ngList.js',
'src/ng/directive/ngModel.js',
'src/ng/directive/ngModelOptions.js',
'src/ng/directive/ngNonBindable.js',
'src/ng/directive/ngOptions.js',
'src/ng/directive/ngPluralize.js',
'src/ng/directive/ngRef.js',
'src/ng/directive/ngRepeat.js',
'src/ng/directive/ngShowHide.js',
'src/ng/directive/ngStyle.js',
@@ -67,28 +84,57 @@ var angularFiles = {
'src/ng/directive/ngTransclude.js',
'src/ng/directive/script.js',
'src/ng/directive/select.js',
'src/ng/directive/style.js'
'src/ng/directive/validators.js',
'src/angular.bind.js',
'src/publishExternalApis.js',
'src/ngLocale/angular-locale_en-us.js'
],
'angularLoader': [
'src/stringify.js',
'src/minErr.js',
'src/loader.js'
],
'angularModules': {
'ngAnimate': [
'src/ngAnimate/animate.js'
'src/ngAnimate/shared.js',
'src/ngAnimate/rafScheduler.js',
'src/ngAnimate/animateChildrenDirective.js',
'src/ngAnimate/animateCss.js',
'src/ngAnimate/animateCssDriver.js',
'src/ngAnimate/animateJs.js',
'src/ngAnimate/animateJsDriver.js',
'src/ngAnimate/animateQueue.js',
'src/ngAnimate/animateCache.js',
'src/ngAnimate/animation.js',
'src/ngAnimate/ngAnimateSwap.js',
'src/ngAnimate/module.js'
],
'ngCookies': [
'src/ngCookies/cookies.js'
'src/ngCookies/cookies.js',
'src/ngCookies/cookieWriter.js'
],
'ngMessageFormat': [
'src/ngMessageFormat/messageFormatCommon.js',
'src/ngMessageFormat/messageFormatSelector.js',
'src/ngMessageFormat/messageFormatInterpolationParts.js',
'src/ngMessageFormat/messageFormatParser.js',
'src/ngMessageFormat/messageFormatService.js'
],
'ngMessages': [
'src/ngMessages/messages.js'
],
'ngParseExt': [
'src/ngParseExt/ucd.js',
'src/ngParseExt/module.js'
],
'ngResource': [
'src/ngResource/resource.js'
],
'ngRoute': [
'src/shallowCopy.js',
'src/routeToRegExp.js',
'src/ngRoute/route.js',
'src/ngRoute/routeParams.js',
'src/ngRoute/directive/ngView.js'
@@ -98,110 +144,166 @@ var angularFiles = {
'src/ngSanitize/filter/linky.js'
],
'ngMock': [
'src/ngMock/angular-mocks.js'
'src/routeToRegExp.js',
'src/ngMock/angular-mocks.js',
'src/ngMock/browserTrigger.js'
],
'ngTouch': [
'src/ngTouch/touch.js',
'src/ngTouch/swipe.js',
'src/ngTouch/directive/ngClick.js',
'src/ngTouch/directive/ngSwipe.js'
],
'ngAria': [
'src/ngAria/aria.js'
]
},
'angularScenario': [
'src/ngScenario/Scenario.js',
'src/ngScenario/browserTrigger.js',
'src/ngScenario/Application.js',
'src/ngScenario/Describe.js',
'src/ngScenario/Future.js',
'src/ngScenario/ObjectModel.js',
'src/ngScenario/Runner.js',
'src/ngScenario/SpecRunner.js',
'src/ngScenario/dsl.js',
'src/ngScenario/matchers.js',
'src/ngScenario/output/Html.js',
'src/ngScenario/output/Json.js',
'src/ngScenario/output/Xml.js',
'src/ngScenario/output/Object.js'
],
'angularTest': [
'test/helpers/*.js',
'test/ngScenario/*.js',
'test/ngScenario/output/*.js',
'test/*.js',
'test/auto/*.js',
'test/ng/**/*.js',
'test/ngAnimate/*.js',
'test/ngMessageFormat/*.js',
'test/ngMessages/*.js',
'test/ngCookies/*.js',
'test/ngResource/*.js',
'test/ngRoute/**/*.js',
'test/ngSanitize/**/*.js',
'test/ngMock/*.js',
'test/ngTouch/**/*.js'
'test/ngTouch/**/*.js',
'test/ngAria/*.js'
],
'karma': [
'bower_components/jquery/dist/jquery.js',
'node_modules/jquery/dist/jquery.js',
'test/jquery_remove.js',
'@angularSrc',
'src/publishExternalApis.js',
'@angularSrcModules',
'@angularScenario',
'@angularTest',
'@angularTest'
],
'karmaExclude': [
'test/jquery_alias.js',
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js'
'src/angular.bind.js'
],
'karmaScenario': [
'build/angular-scenario.js',
'build/docs/docs-scenario.js'
],
"karmaModules": [
'karmaModules-ngAnimate': [
'build/angular.js',
'@angularSrcModules',
'src/ngScenario/browserTrigger.js',
'test/helpers/*.js',
'test/ngMock/*.js',
'test/ngCookies/*.js',
'test/ngRoute/**/*.js',
'test/ngResource/*.js',
'test/ngSanitize/**/*.js',
'build/angular-mocks.js',
'test/modules/no_bootstrap.js',
'test/helpers/matchers.js',
'test/helpers/privateMocks.js',
'test/helpers/support.js',
'test/helpers/testabilityPatch.js',
'@angularSrcModuleNgAnimate',
'test/ngAnimate/**/*.js'
],
'karmaModules-ngAria': [
'@angularSrcModuleNgAria',
'test/ngAria/**/*.js'
],
'karmaModules-ngCookies': [
'@angularSrcModuleNgCookies',
'test/ngCookies/**/*.js'
],
'karmaModules-ngMessageFormat': [
'@angularSrcModuleNgMessageFormat',
'test/ngMessageFormat/**/*.js'
],
'karmaModules-ngMessages': [
'build/angular-animate.js',
'@angularSrcModuleNgMessages',
'test/ngMessages/**/*.js'
],
// ngMock doesn't include the base because it must use the ngMock src files
'karmaModules-ngMock': [
'build/angular.js',
'src/ngMock/*.js',
'test/modules/no_bootstrap.js',
'test/helpers/matchers.js',
'test/helpers/privateMocks.js',
'test/helpers/support.js',
'test/helpers/testabilityPatch.js',
'src/routeToRegExp.js',
'build/angular-animate.js',
'test/ngMock/**/*.js'
],
'karmaModules-ngResource': [
'@angularSrcModuleNgResource',
'test/ngResource/**/*.js'
],
'karmaModules-ngRoute': [
'build/angular-animate.js',
'@angularSrcModuleNgRoute',
'test/ngRoute/**/*.js'
],
'karmaModules-ngSanitize': [
'@angularSrcModuleNgSanitize',
'test/ngSanitize/**/*.js'
],
'karmaModules-ngTouch': [
'@angularSrcModuleNgTouch',
'test/ngTouch/**/*.js'
],
'karmaJquery': [
'bower_components/jquery/dist/jquery.js',
'node_modules/jquery/dist/jquery.js',
'test/jquery_alias.js',
'@angularSrc',
'src/publishExternalApis.js',
'@angularSrcModules',
'@angularScenario',
'@angularTest',
'@angularTest'
],
'karmaJqueryExclude': [
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'test/jquery_remove.js'
'test/jquery_remove.js',
'src/angular.bind.js'
]
};
['2.1', '2.2'].forEach(function(jQueryVersion) {
angularFiles['karmaJquery' + jQueryVersion] = []
.concat(angularFiles.karmaJquery)
.map(function(path) {
if (path.startsWith('node_modules/jquery')) {
return path.replace(/^node_modules\/jquery/, 'node_modules/jquery-' + jQueryVersion);
}
return path;
});
});
angularFiles['angularSrcModuleNgAnimate'] = angularFiles['angularModules']['ngAnimate'];
angularFiles['angularSrcModuleNgAria'] = angularFiles['angularModules']['ngAria'];
angularFiles['angularSrcModuleNgCookies'] = angularFiles['angularModules']['ngCookies'];
angularFiles['angularSrcModuleNgMessageFormat'] = angularFiles['angularModules']['ngMessageFormat'];
angularFiles['angularSrcModuleNgMessages'] = angularFiles['angularModules']['ngMessages'];
angularFiles['angularSrcModuleNgResource'] = angularFiles['angularModules']['ngResource'];
angularFiles['angularSrcModuleNgRoute'] = angularFiles['angularModules']['ngRoute'];
angularFiles['angularSrcModuleNgSanitize'] = angularFiles['angularModules']['ngSanitize'];
angularFiles['angularSrcModuleNgTouch'] = angularFiles['angularModules']['ngTouch'];
angularFiles['angularSrcModules'] = [].concat(
angularFiles['angularModules']['ngAnimate'],
angularFiles['angularModules']['ngMessageFormat'],
angularFiles['angularModules']['ngMessages'],
angularFiles['angularModules']['ngCookies'],
angularFiles['angularModules']['ngResource'],
angularFiles['angularModules']['ngRoute'],
angularFiles['angularModules']['ngSanitize'],
angularFiles['angularModules']['ngMock'],
angularFiles['angularModules']['ngTouch']
angularFiles['angularModules']['ngTouch'],
angularFiles['angularModules']['ngAria']
);
if (exports) {
@@ -212,7 +314,7 @@ if (exports) {
Array.prototype.slice.call(arguments, 0).forEach(function(filegroup) {
angularFiles[filegroup].forEach(function(file) {
// replace @ref
var match = file.match(/^\@(.*)/);
var match = file.match(/^@(.*)/);
if (match) {
files = files.concat(angularFiles[match[1]]);
} else {
+11
View File
@@ -0,0 +1,11 @@
{
"root": true,
"extends": "../.eslintrc-browser.json",
"globals": {
"benchmarkSteps": false,
// Benchmarks are not run in IE 9 so we're fine.
"console": false
}
}
+6
View File
@@ -0,0 +1,6 @@
Instructions for using benchpress (how to create benchmarks, how to run, how to configure) can be
found at: https://github.com/angular/benchpress/blob/master/README.md.
In this project, there is a configured grunt task for building the benchmarks,
`grunt bp_build`, which places the runnable benchmarks in "/build/benchmarks/".
The existing `grunt webserver` task can be used to serve the built benchmarks at `localhost:8000/build/benchmarks/<benchmark-name>`
+44
View File
@@ -0,0 +1,44 @@
'use strict';
angular
.module('animationBenchmark', ['ngAnimate'], config)
.controller('BenchmarkController', BenchmarkController);
// Functions - Definitions
function config($compileProvider) {
$compileProvider
.commentDirectivesEnabled(false)
.cssClassDirectivesEnabled(false)
.debugInfoEnabled(false);
}
function BenchmarkController($scope) {
var self = this;
var itemCount = 1000;
var items = (new Array(itemCount + 1)).join('.').split('');
benchmarkSteps.push({
name: 'create',
fn: function() {
$scope.$apply(function() {
self.items = items;
});
}
});
benchmarkSteps.push({
name: '$digest',
fn: function() {
$scope.$root.$digest();
}
});
benchmarkSteps.push({
name: 'destroy',
fn: function() {
$scope.$apply(function() {
self.items = [];
});
}
});
}
+22
View File
@@ -0,0 +1,22 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [
{
id: 'jquery',
src: 'jquery-noop.js'
}, {
id: 'angular',
src: '/build/angular.js'
}, {
id: 'angular-animate',
src: '/build/angular-animate.js'
}, {
src: 'app.js'
}
]
});
};
+1
View File
@@ -0,0 +1 @@
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
+28
View File
@@ -0,0 +1,28 @@
<style>
[ng-cloak] { display: none !important; }
.animation-container .ng-enter,
.animation-container .ng-leave {
transition: all 0.1s;
}
.animation-container .ng-enter,
.animation-container .ng-leave.ng-leave-active {
opacity: 0;
}
.animation-container .ng-enter.ng-enter-active,
.animation-container .ng-leave {
opacity: 1;
}
</style>
<div ng-app="animationBenchmark" ng-cloak ng-controller="BenchmarkController as bm">
<div class="container-fluid">
<h2>Large collection of elements animated in and out with ngAnimate</h2>
<div class="animation-container">
<div ng-repeat="i in bm.items track by $index">
Just a plain ol' element
</div>
</div>
</div>
</div>
+61
View File
@@ -0,0 +1,61 @@
'use strict';
var app = angular.module('boostrapCompileBenchmark', []);
var commentDirectivesEnabled;
var cssClassDirectivesEnabled;
app.config(function($compileProvider) {
$compileProvider.debugInfoEnabled(false);
commentDirectivesEnabled = window.location.toString().indexOf('comment=disabled') === -1;
cssClassDirectivesEnabled = window.location.toString().indexOf('css=disabled') === -1;
$compileProvider
.commentDirectivesEnabled(commentDirectivesEnabled)
.cssClassDirectivesEnabled(cssClassDirectivesEnabled);
})
.controller('DataController', function DataController($compile, $http, $rootScope) {
this.isEA = !commentDirectivesEnabled && !cssClassDirectivesEnabled;
this.isEAC = !commentDirectivesEnabled && cssClassDirectivesEnabled;
this.isEAM = commentDirectivesEnabled && !cssClassDirectivesEnabled;
this.isEACM = commentDirectivesEnabled && cssClassDirectivesEnabled;
this.repeats = 50;
this.templates = [
'bootstrap-carousel.tpl.html',
'bootstrap-theme.tpl.html'
];
this.html = null;
this.loadTemplate = function() {
this.html = null;
$http.get(window.location.pathname + this.selectedTemplate)
.then(function(response) { this.html = response.data; }.bind(this));
};
this.selectedTemplate = this.templates[0];
this.loadTemplate();
var linkers = [];
benchmarkSteps.push({
name: 'create',
fn: function() {
for (var i = 0; i < this.repeats; i++) {
var linker = $compile(this.html);
linkers.push(linker);
}
}.bind(this)
});
benchmarkSteps.push({
name: 'destroy',
fn: function() {
linkers.length = 0;
}
});
});
@@ -0,0 +1,172 @@
<!-- code from http://getbootstrap.com/examples/carousel -->
<div class="navbar-wrapper">
<div class="container">
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</div>
</div>
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="first-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="First slide">
<div class="container">
<div class="carousel-caption">
<h1>Example headline.</h1>
<p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p>
<p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
</div>
</div>
</div>
<div class="item">
<img class="second-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Second slide">
<div class="container">
<div class="carousel-caption">
<h1>Another example headline.</h1>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img class="third-slide" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Third slide">
<div class="container">
<div class="carousel-caption">
<h1>One more for good measure.</h1>
<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
<p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div><!-- /.carousel -->
<!-- Marketing messaging and featurettes
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
<div class="container marketing">
<!-- Three columns of text below the carousel -->
<div class="row">
<div class="col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
<p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
<p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
</div><!-- /.col-lg-4 -->
<div class="col-lg-4">
<img class="img-circle" src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" alt="Generic placeholder image" width="140" height="140">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<!-- START THE FEATURETTES -->
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">First featurette heading. <span class="text-muted">It'll blow your mind.</span></h2>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive center-block" data-src="holder.js/500x500/auto" alt="Generic placeholder image">
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7 col-md-push-5">
<h2 class="featurette-heading">Oh yeah, it's that good. <span class="text-muted">See for yourself.</span></h2>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5 col-md-pull-7">
<img class="featurette-image img-responsive center-block" data-src="holder.js/500x500/auto" alt="Generic placeholder image">
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">And lastly, this one. <span class="text-muted">Checkmate.</span></h2>
<p class="lead">Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive center-block" data-src="holder.js/500x500/auto" alt="Generic placeholder image">
</div>
</div>
<hr class="featurette-divider">
<!-- /END THE FEATURETTES -->
<!-- FOOTER -->
<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>&copy; 2016 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
</footer>
</div><!-- /.container -->
@@ -0,0 +1,595 @@
<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Bootstrap theme</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container theme-showcase" role="main">
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>Theme example</h1>
<p>This is a template showcasing the optional theme stylesheet included in Bootstrap. Use it as a starting point to create something more unique by building on or modifying it.</p>
</div>
<div class="page-header">
<h1>Buttons</h1>
</div>
<p>
<button type="button" class="btn btn-lg btn-default">Default</button>
<button type="button" class="btn btn-lg btn-primary">Primary</button>
<button type="button" class="btn btn-lg btn-success">Success</button>
<button type="button" class="btn btn-lg btn-info">Info</button>
<button type="button" class="btn btn-lg btn-warning">Warning</button>
<button type="button" class="btn btn-lg btn-danger">Danger</button>
<button type="button" class="btn btn-lg btn-link">Link</button>
</p>
<p>
<button type="button" class="btn btn-default">Default</button>
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-link">Link</button>
</p>
<p>
<button type="button" class="btn btn-sm btn-default">Default</button>
<button type="button" class="btn btn-sm btn-primary">Primary</button>
<button type="button" class="btn btn-sm btn-success">Success</button>
<button type="button" class="btn btn-sm btn-info">Info</button>
<button type="button" class="btn btn-sm btn-warning">Warning</button>
<button type="button" class="btn btn-sm btn-danger">Danger</button>
<button type="button" class="btn btn-sm btn-link">Link</button>
</p>
<p>
<button type="button" class="btn btn-xs btn-default">Default</button>
<button type="button" class="btn btn-xs btn-primary">Primary</button>
<button type="button" class="btn btn-xs btn-success">Success</button>
<button type="button" class="btn btn-xs btn-info">Info</button>
<button type="button" class="btn btn-xs btn-warning">Warning</button>
<button type="button" class="btn btn-xs btn-danger">Danger</button>
<button type="button" class="btn btn-xs btn-link">Link</button>
</p>
<div class="page-header">
<h1>Tables</h1>
</div>
<div class="row">
<div class="col-md-6">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-md-6">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>Mark</td>
<td>Otto</td>
<td>@TwBootstrap</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-condensed">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page-header">
<h1>Thumbnails</h1>
</div>
<img data-src="holder.js/200x200" class="img-thumbnail" alt="200x200" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzIwMHgyMDAKQ3JlYXRlZCB3aXRoIEhvbGRlci5qcyAyLjYuMC4KTGVhcm4gbW9yZSBhdCBodHRwOi8vaG9sZGVyanMuY29tCihjKSAyMDEyLTIwMTUgSXZhbiBNYWxvcGluc2t5IC0gaHR0cDovL2ltc2t5LmNvCi0tPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbI2hvbGRlcl8xNTYyY2ExYjA3YiB0ZXh0IHsgZmlsbDojQUFBQUFBO2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjEwcHQgfSBdXT48L3N0eWxlPjwvZGVmcz48ZyBpZD0iaG9sZGVyXzE1NjJjYTFiMDdiIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9Ijc0LjY5NTMxMjUiIHk9IjEwNC41Ij4yMDB4MjAwPC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="width: 200px; height: 200px;">
<div class="page-header">
<h1>Labels</h1>
</div>
<h1>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h1>
<h2>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h2>
<h3>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h3>
<h4>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h4>
<h5>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h5>
<h6>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</h6>
<p>
<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
</p>
<div class="page-header">
<h1>Badges</h1>
</div>
<p>
<a href="#">Inbox <span class="badge">42</span></a>
</p>
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active"><a href="#">Home <span class="badge">42</span></a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages <span class="badge">3</span></a></li>
</ul>
<div class="page-header">
<h1>Dropdown menus</h1>
</div>
<div class="dropdown theme-dropdown clearfix">
<a id="dropdownMenu1" href="#" class="sr-only dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li class="active"><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</div>
<div class="page-header">
<h1>Navs</h1>
</div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#">Home</a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages</a></li>
</ul>
<ul class="nav nav-pills" role="tablist">
<li role="presentation" class="active"><a href="#">Home</a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages</a></li>
</ul>
<div class="page-header">
<h1>Navbars</h1>
</div>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="page-header">
<h1>Alerts</h1>
</div>
<div class="alert alert-success" role="alert">
<strong>Well done!</strong> You successfully read this important alert message.
</div>
<div class="alert alert-info" role="alert">
<strong>Heads up!</strong> This alert needs your attention, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
<div class="alert alert-danger" role="alert">
<strong>Oh snap!</strong> Change a few things up and try submitting again.
</div>
<div class="page-header">
<h1>Progress bars</h1>
</div>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"><span class="sr-only">60% Complete</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"><span class="sr-only">40% Complete (success)</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"><span class="sr-only">20% Complete</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"><span class="sr-only">60% Complete (warning)</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"><span class="sr-only">80% Complete (danger)</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"><span class="sr-only">60% Complete</span></div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 35%"><span class="sr-only">35% Complete (success)</span></div>
<div class="progress-bar progress-bar-warning" style="width: 20%"><span class="sr-only">20% Complete (warning)</span></div>
<div class="progress-bar progress-bar-danger" style="width: 10%"><span class="sr-only">10% Complete (danger)</span></div>
</div>
<div class="page-header">
<h1>List groups</h1>
</div>
<div class="row">
<div class="col-sm-4">
<ul class="list-group">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<div class="list-group">
<a href="#" class="list-group-item active">
Cras justo odio
</a>
<a href="#" class="list-group-item">Dapibus ac facilisis in</a>
<a href="#" class="list-group-item">Morbi leo risus</a>
<a href="#" class="list-group-item">Porta ac consectetur ac</a>
<a href="#" class="list-group-item">Vestibulum at eros</a>
</div>
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<div class="list-group">
<a href="#" class="list-group-item active">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
<a href="#" class="list-group-item">
<h4 class="list-group-item-heading">List group item heading</h4>
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
</a>
</div>
</div><!-- /.col-sm-4 -->
</div>
<div class="page-header">
<h1>Panels</h1>
</div>
<div class="row">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
</div><!-- /.col-sm-4 -->
</div>
<div class="page-header">
<h1>Wells</h1>
</div>
<div class="well">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed diam eget risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean lacinia bibendum nulla sed consectetur.</p>
</div>
<div class="page-header">
<h1>Carousel</h1>
</div>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class=""></li>
<li data-target="#carousel-example-generic" data-slide-to="1" class=""></li>
<li data-target="#carousel-example-generic" data-slide-to="2" class="active"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item">
<img data-src="holder.js/1140x500/auto/#777:#555/text:First slide" alt="First slide [1140x500]" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTE0MCIgaGVpZ2h0PSI1MDAiIHZpZXdCb3g9IjAgMCAxMTQwIDUwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvMTE0MHg1MDAvYXV0by8jNzc3OiM1NTUvdGV4dDpGaXJzdCBzbGlkZQpDcmVhdGVkIHdpdGggSG9sZGVyLmpzIDIuNi4wLgpMZWFybiBtb3JlIGF0IGh0dHA6Ly9ob2xkZXJqcy5jb20KKGMpIDIwMTItMjAxNSBJdmFuIE1hbG9waW5za3kgLSBodHRwOi8vaW1za3kuY28KLS0+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48IVtDREFUQVsjaG9sZGVyXzE1NjJjYTIxYzRkIHRleHQgeyBmaWxsOiM1NTU7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LWZhbWlseTpBcmlhbCwgSGVsdmV0aWNhLCBPcGVuIFNhbnMsIHNhbnMtc2VyaWYsIG1vbm9zcGFjZTtmb250LXNpemU6NTdwdCB9IF1dPjwvc3R5bGU+PC9kZWZzPjxnIGlkPSJob2xkZXJfMTU2MmNhMjFjNGQiPjxyZWN0IHdpZHRoPSIxMTQwIiBoZWlnaHQ9IjUwMCIgZmlsbD0iIzc3NyIvPjxnPjx0ZXh0IHg9IjM5MC41MDc4MTI1IiB5PSIyNzUuNSI+Rmlyc3Qgc2xpZGU8L3RleHQ+PC9nPjwvZz48L3N2Zz4=" data-holder-rendered="true">
</div>
<div class="item active left">
<img data-src="holder.js/1140x500/auto/#666:#444/text:Second slide" alt="Second slide [1140x500]" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTE0MCIgaGVpZ2h0PSI1MDAiIHZpZXdCb3g9IjAgMCAxMTQwIDUwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvMTE0MHg1MDAvYXV0by8jNjY2OiM0NDQvdGV4dDpTZWNvbmQgc2xpZGUKQ3JlYXRlZCB3aXRoIEhvbGRlci5qcyAyLjYuMC4KTGVhcm4gbW9yZSBhdCBodHRwOi8vaG9sZGVyanMuY29tCihjKSAyMDEyLTIwMTUgSXZhbiBNYWxvcGluc2t5IC0gaHR0cDovL2ltc2t5LmNvCi0tPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbI2hvbGRlcl8xNTYyY2ExZTY3NCB0ZXh0IHsgZmlsbDojNDQ0O2ZvbnQtd2VpZ2h0OmJvbGQ7Zm9udC1mYW1pbHk6QXJpYWwsIEhlbHZldGljYSwgT3BlbiBTYW5zLCBzYW5zLXNlcmlmLCBtb25vc3BhY2U7Zm9udC1zaXplOjU3cHQgfSBdXT48L3N0eWxlPjwvZGVmcz48ZyBpZD0iaG9sZGVyXzE1NjJjYTFlNjc0Ij48cmVjdCB3aWR0aD0iMTE0MCIgaGVpZ2h0PSI1MDAiIGZpbGw9IiM2NjYiLz48Zz48dGV4dCB4PSIzMzUuNjAxNTYyNSIgeT0iMjc1LjUiPlNlY29uZCBzbGlkZTwvdGV4dD48L2c+PC9nPjwvc3ZnPg==" data-holder-rendered="true">
</div>
<div class="item next left">
<img data-src="holder.js/1140x500/auto/#555:#333/text:Third slide" alt="Third slide [1140x500]" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTE0MCIgaGVpZ2h0PSI1MDAiIHZpZXdCb3g9IjAgMCAxMTQwIDUwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+PCEtLQpTb3VyY2UgVVJMOiBob2xkZXIuanMvMTE0MHg1MDAvYXV0by8jNTU1OiMzMzMvdGV4dDpUaGlyZCBzbGlkZQpDcmVhdGVkIHdpdGggSG9sZGVyLmpzIDIuNi4wLgpMZWFybiBtb3JlIGF0IGh0dHA6Ly9ob2xkZXJqcy5jb20KKGMpIDIwMTItMjAxNSBJdmFuIE1hbG9waW5za3kgLSBodHRwOi8vaW1za3kuY28KLS0+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48IVtDREFUQVsjaG9sZGVyXzE1NjJjYTFiNTg5IHRleHQgeyBmaWxsOiMzMzM7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LWZhbWlseTpBcmlhbCwgSGVsdmV0aWNhLCBPcGVuIFNhbnMsIHNhbnMtc2VyaWYsIG1vbm9zcGFjZTtmb250LXNpemU6NTdwdCB9IF1dPjwvc3R5bGU+PC9kZWZzPjxnIGlkPSJob2xkZXJfMTU2MmNhMWI1ODkiPjxyZWN0IHdpZHRoPSIxMTQwIiBoZWlnaHQ9IjUwMCIgZmlsbD0iIzU1NSIvPjxnPjx0ZXh0IHg9IjM3Ny44NjcxODc1IiB5PSIyNzUuNSI+VGhpcmQgc2xpZGU8L3RleHQ+PC9nPjwvZz48L3N2Zz4=" data-holder-rendered="true">
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div> <!-- /container -->
@@ -0,0 +1,15 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+40
View File
@@ -0,0 +1,40 @@
<div ng-app="boostrapCompileBenchmark" ng-cloak>
<div ng-controller="DataController as config">
<p>Please, select which configuration you want to use:</p>
<ul>
<li>
<a href="?comment=disabled&css=disabled">Only EA</a>
<span ng-show="config.isEA">(active)</span>
</li>
<li>
<a href="?comment=disabled">Active EA and classes directives</a>
<span ng-show="config.isEAC">(active)</span>
</li>
<li>
<a href="?css=disabled">Active EA and comment directives</a>
<span ng-show="config.isEAM">(active)</span>
</li>
<li>
<a href="?">Active all directives</a>
<span ng-show="config.isEACM">(active)</span>
</li>
</ul>
<hr>
<p>How many repetitions do you want to do?</p>
<input type="number" ng-model="config.repeats">
<hr>
<p>Template to $compile:</p>
<select
ng-options="template for template in config.templates"
ng-model="config.selectedTemplate"
ng-change="config.loadTemplate()"></select>
<p>The benchmark is
<span ng-show="config.html">Ready!</span>
<span ng-hide="config.html">LOADING!</span>
</p>
</div>
</div>
+58
View File
@@ -0,0 +1,58 @@
'use strict';
var app = angular.module('eventDelegationBenchmark', []);
app.directive('noopDir', function() {
return {
compile: function($element, $attrs) {
return function($scope, $element) {
return 1;
};
}
};
});
app.directive('nativeClick', ['$parse', function($parse) {
return {
compile: function($element, $attrs) {
$parse($attrs.tstEvent);
return function($scope, $element) {
$element[0].addEventListener('click', function() {
console.log('clicked');
}, false);
};
}
};
}]);
app.directive('dlgtClick', function() {
return {
compile: function($element, $attrs) {
// We don't setup the global event listeners as the costs are small and one time only...
}
};
});
app.controller('DataController', function DataController($rootScope) {
this.ngRepeatCount = 1000;
this.rows = [];
var self = this;
benchmarkSteps.push({
name: '$apply',
fn: function() {
var oldRows = self.rows;
$rootScope.$apply(function() {
self.rows = [];
});
self.rows = oldRows;
if (self.rows.length !== self.ngRepeatCount) {
self.rows = [];
for (var i = 0; i < self.ngRepeatCount; i++) {
self.rows.push('row' + i);
}
}
$rootScope.$apply();
}
});
});
+14
View File
@@ -0,0 +1,14 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
}, {
src: 'app.js'
}]
});
};
+139
View File
@@ -0,0 +1,139 @@
<div ng-app="eventDelegationBenchmark">
<div ng-controller="DataController as ctrl">
<div class="container-fluid">
<p>
Impact of event delegation.
</p>
<p>
<label>
Number of ngRepeats:
<input type="number" ng-model="ctrl.ngRepeatCount">
</label>
</p>
<p>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="ngClick">ngClick</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="ngClickNoJqLite">ngClick without jqLite</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="ngShow">baseline: ng-show</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="textInterpolation">baseline: text interpolation</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="dlgtClick">delegate event directive (only compile)</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="noopDir">baseline: noop directive (compile and link)</label></div>
<div class="radio"><label><input type=radio ng-model="benchmarkType" value="noop">baseline: no directive</label></div>
</p>
<p>
How to read the results:
<ul>
<li>The benchmark measures how long it takes to instantiate a given number of directives</li>
<li>ngClick is compared against ngShow and text interpolation as baseline. The results show
how expensive ngClick is compared to other very simple directives that touch the DOM.
</li>
<li>To measure the impact of jqLite.on vs element.addEventListener there is also a benchmark
that as a modified version of ngClick that uses element.addEventListener.
</li>
<li>The delegate event directive is compared against a noop directive with a compile and link function and the case with no directives.
The result shows how expensive it is to add a link function to a directive, as the delegate event directive has none.
</li>
</ul>
</p>
<p>
Results as of 7/31/2014:
<ul>
<li>ngClick is very close to ngShow and text interpolation, especially when looking at a version of ngClick that does not use jqLite.on but element.addEventListener instead.</li>
<li>A delegate event directive that has no link function has the same speed as a directive with link function. I.e. ngClick is slower compared to the delegate event directive only because ngClick touches
the DOM for every element</li>
<li>A delegate event directive could be about 50% faster than ngClick. However, the overall performance
benefit depends on how many (and which) other directives are used on the same element
and what other things are part of the measures use case.
E.g. rows of a table with ngRepeat that use ngClick will probably also contain text interpolation.
</li>
</ul>
</p>
Debug output:
<ng-switch on="benchmarkType">
<div ng-switch-when="ngClick">
<div>
<span ng-repeat="row in ctrl.rows">
<span ng-click="a()">1</span>
<span ng-click="a()">1</span>
<span ng-click="a()">1</span>
<span ng-click="a()">1</span>
</span>
</div>
</div>
<div ng-switch-when="ngClickNoJqLite">
<div>
<span ng-repeat="row in ctrl.rows">
<span native-click="a()">1</span>
<span native-click="a()">1</span>
<span native-click="a()">1</span>
<span native-click="a()">1</span>
<span native-click="a()">1</span>
</span>
</div>
</div>
<div ng-switch-when="ngShow">
<div>
<span ng-repeat="row in ctrl.rows">
<span ng-show="true">1</span>
<span ng-show="true">1</span>
<span ng-show="true">1</span>
<span ng-show="true">1</span>
<span ng-show="true">1</span>
</span>
</div>
</div>
<div ng-switch-when="textInterpolation">
<div>
<span ng-repeat="row in ctrl.rows">
<span>{{row}}</span>
<span>{{row}}</span>
<span>{{row}}</span>
<span>{{row}}</span>
<span>{{row}}</span>
</span>
</div>
</div>
<div ng-switch-when="dlgtClick">
<div>
<span ng-repeat="row in ctrl.rows">
<span dlgt-click="a()">1</span>
<span dlgt-click="a()">1</span>
<span dlgt-click="a()">1</span>
<span dlgt-click="a()">1</span>
<span dlgt-click="a()">1</span>
</span>
</div>
</div>
<div ng-switch-when="noopDir">
<div>
<span ng-repeat="row in ctrl.rows">
<span noop-dir>1</span>
<span noop-dir>1</span>
<span noop-dir>1</span>
<span noop-dir>1</span>
<span noop-dir>1</span>
</span>
</div>
</div>
<div ng-switch-when="noop">
<div>
<span ng-repeat="row in ctrl.rows">
<span>1</span>
<span>1</span>
<span>1</span>
<span>1</span>
<span>1</span>
</span>
</div>
</div>
</ng-switch>
</div>
</div>
</div>
+187
View File
@@ -0,0 +1,187 @@
'use strict';
var app = angular.module('largetableBenchmark', []);
app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});
app.filter('noop', function() {
return function(input) {
return input;
};
});
app.controller('DataController', function DataController($scope, $rootScope) {
var totalRows = 1000;
var totalColumns = 20;
var data = $scope.data = [];
$scope.digestDuration = '?';
$scope.numberOfBindings = totalRows * totalColumns * 2 + totalRows + 1;
$scope.numberOfWatches = '?';
/** @this */
function iGetter() { return this.i; }
/** @this */
function jGetter() { return this.j; }
for (var i = 0; i < totalRows; i++) {
data[i] = [];
for (var j = 0; j < totalColumns; j++) {
data[i][j] = {
i: i, j: j,
iFn: iGetter,
jFn: jGetter
};
}
}
var previousType;
benchmarkSteps.push({
name: 'destroy',
fn: function() {
$scope.$apply(function() {
previousType = $scope.benchmarkType;
$scope.benchmarkType = 'none';
});
}
});
benchmarkSteps.push({
name: 'create',
fn: function() {
$scope.$apply(function() {
$scope.benchmarkType = previousType;
});
}
});
benchmarkSteps.push({
name: '$apply',
fn: function() {
$rootScope.$apply();
}
});
});
app.directive('baselineBindingTable', function() {
return {
restrict: 'E',
link: function($scope, $element) {
var i, j, row, cell, comment;
var document = window.document;
var template = document.createElement('span');
template.setAttribute('ng-repeat', 'foo in foos');
template.classList.add('ng-scope');
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode(':'));
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode('|'));
for (i = 0; i < 1000; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < 20; j++) {
cell = template.cloneNode(true);
row.appendChild(cell);
cell.childNodes[0].textContent = i;
cell.childNodes[2].textContent = j;
cell.ng3992 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
}
};
});
app.directive('baselineInterpolationTable', function() {
return {
restrict: 'E',
link: function($scope, $element) {
var i, j, row, cell, comment;
var document = window.document;
var template = document.createElement('span');
template.setAttribute('ng-repeat', 'foo in foos');
template.classList.add('ng-scope');
for (i = 0; i < 1000; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < 20; j++) {
cell = template.cloneNode(true);
row.appendChild(cell);
cell.textContent = '' + i + ':' + j + '|';
cell.ng3992 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
}
};
});
/*
the fastest
240/44
app.directive('baselineTable', function() {
return function($scope, $element) {
var i, j, row, cell;
for (i = 0; i < 1000; i++) {
row = document.createElement('div');
for (j = 0; j < 20; j++) {
cell = document.createElement('span');
cell.textContent = '' + i + ':' + j;
row.appendChild(cell);
}
$element[0].appendChild(row);
}
};
});
*/
/*
with comments and expando
232/90
app.directive('baselineTable', function() {
return function($scope, $element) {
var i, j, row, cell, comment;
for (i = 0; i < 1000; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < 20; j++) {
cell = document.createElement('span');
row.appendChild(cell);
cell.textContent = '' + i + ':' + j;
cell.ng3992 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
};
});
*/
+19
View File
@@ -0,0 +1,19 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'jquery',
src: 'jquery-noop.js'
},
{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+1
View File
@@ -0,0 +1 @@
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
+106
View File
@@ -0,0 +1,106 @@
<style>
[ng-cloak] { display: none; }
</style>
<div ng-app="largetableBenchmark" ng-cloak>
<div ng-controller="DataController">
<div class="container-fluid">
<p>
Large table rendered with AngularJS
</p>
<div><label><input type="radio" ng-model="benchmarkType" value="none">none: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="baselineBinding">baseline binding: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="baselineInterpolation">baseline interpolation: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngBind">ngBind: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngBindOnce">ngBindOnce: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="interpolation">interpolation: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="bindOnceInterpolation">interpolation + bind-once: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="interpolationAttr">attribute interpolation: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngBindFn">ngBind + fnInvocation: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="interpolationFn">interpolation + fnInvocation: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngBindFilter">ngBind + filter: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="interpolationFilter">interpolation + filter: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngModelConstName">ngModel (const name): </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="ngModelInterpName">ngModel (interp name): </label></div>
<ng-switch on="benchmarkType">
<baseline-binding-table ng-switch-when="baselineBinding">
</baseline-binding-table>
<baseline-interpolation-table ng-switch-when="baselineInterpolation">
</baseline-interpolation-table>
<div ng-switch-when="ngBind">
<h2>baseline binding</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row">
<span ng-bind="column.i"></span>:<span ng-bind="column.j"></span>|
</span>
</div>
</div>
<div ng-switch-when="ngBindOnce">
<h2>baseline binding once</h2>
<div ng-repeat="row in ::data">
<span ng-repeat="column in ::row">
<span ng-bind="::column.i"></span>:<span ng-bind="::column.j"></span>|
</span>
</div>
</div>
<div ng-switch-when="interpolation">
<h2>baseline interpolation</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row">{{column.i}}:{{column.j}}|</span>
</div>
</div>
<div ng-switch-when="bindOnceInterpolation">
<h2>baseline one-time interpolation</h2>
<div ng-repeat="row in ::data">
<span ng-repeat="column in ::row">{{::column.i}}:{{::column.j}}|</span>
</div>
</div>
<div ng-switch-when="interpolationAttr">
<h2>attribute interpolation</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row" i="{{column.i}}" j="{{column.j}}">i,j attrs</span>
</div>
</div>
<div ng-switch-when="ngBindFn">
<h2>bindings with functions</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row"><span ng-bind="column.iFn()"></span>:<span ng-bind="column.jFn()"></span>|</span>
</div>
</div>
<div ng-switch-when="interpolationFn">
<h2>interpolation with functions</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row">{{column.iFn()}}:{{column.jFn()}}|</span>
</div>
</div>
<div ng-switch-when="ngBindFilter">
<h2>bindings with filter</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row"><span ng-bind="column.i | noop"></span>:<span ng-bind="column.j | noop"></span>|</span>
</div>
</div>
<div ng-switch-when="interpolationFilter">
<h2>interpolation with filter</h2>
<div ng-repeat="row in data">
<span ng-repeat="column in row">{{column.i | noop}}:{{column.j | noop}}|</span>
</div>
</div>
<div ng-switch-when="ngModelConstName">
<h2>ngModel (const name)</h2>
<div ng-repeat="row in data">
<input type="text" ng-model="row.i" name="constName" />
<input type="text" ng-model="row.j" />
</div>
</div>
<div ng-switch-when="ngModelInterpName">
<h2>ngModel (interp name)</h2>
<div ng-repeat="(rowIdx, row) in data">
<input type="text" ng-model="row.i" name="input-{{rowIdx}}" />
<input type="text" ng-model="row.j" name="input2-{{rowIdx}}" />
</div>
</div>
</ng-switch>
</div>
</div>
</div>
+108
View File
@@ -0,0 +1,108 @@
'use strict';
var app = angular.module('ngClassBenchmark', []);
app.controller('DataController', function DataController($scope) {
this.init = function() {
this.numberOfTodos = 1000;
this.implementation = 'tableOptimized';
this.completedPeriodicity = 3;
this.importantPeriodicity = 13;
this.urgentPeriodicity = 29;
this.createTodos(100);
this.setTodosValuesWithSeed(0);
};
this.clearTodos = function() {
this.todos = null;
};
this.createTodos = function(count) {
var i;
this.todos = [];
for (i = 0; i < count; i++) {
this.todos.push({
id: i + 1,
completed: false,
important: false,
urgent: false
});
}
};
this.setTodosValuesWithSeed = function(offset) {
var i, todo;
for (i = 0; i < this.todos.length; i++) {
todo = this.todos[i];
todo.completed = 0 === (i + offset) % this.completedPeriodicity;
todo.important = 0 === (i + offset) % this.importantPeriodicity;
todo.urgent = 0 === (i + offset) % this.urgentPeriodicity;
}
};
this.init();
benchmarkSteps.push({
name: 'setup',
fn: function() {
$scope.$apply();
this.clearTodos();
this.createTodos(this.numberOfTodos);
}.bind(this)
});
benchmarkSteps.push({
name: 'create',
fn: function() {
// initialize data for first time that will construct the DOM
this.setTodosValuesWithSeed(0);
$scope.$apply();
}.bind(this)
});
benchmarkSteps.push({
name: '$apply',
fn: function() {
$scope.$apply();
}
});
benchmarkSteps.push({
name: 'update',
fn: function() {
// move everything but completed
this.setTodosValuesWithSeed(3);
$scope.$apply();
}.bind(this)
});
benchmarkSteps.push({
name: 'unclass',
fn: function() {
// remove all classes
this.setTodosValuesWithSeed(NaN);
$scope.$apply();
}.bind(this)
});
benchmarkSteps.push({
name: 'class',
fn: function() {
// add all classes as the initial state
this.setTodosValuesWithSeed(0);
$scope.$apply();
}.bind(this)
});
benchmarkSteps.push({
name: 'destroy',
fn: function() {
this.clearTodos();
$scope.$apply();
}.bind(this)
});
});
+15
View File
@@ -0,0 +1,15 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+177
View File
@@ -0,0 +1,177 @@
<style>
.gold {
background: gold;
}
.silver {
background: silver;
}
.table tbody tr > td.success {
background-color: #dff0d8;
}
.table tbody tr > td.error {
background-color: #f2dede;
}
.table tbody tr > td.warning {
background-color: #fcf8e3;
}
.table tbody tr > td.info {
background-color: #d9edf7;
}
.completed {
text-decoration: line-through;
}
.important {
font-weight: bold;
}
.urgent {
color: red;
}
</style>
<div ng-app="ngClassBenchmark" ng-cloak class="container-fluid">
<div ng-controller="DataController as benchmark" class="row">
<div class="col-lg-12">
<div class="well">
<h3>Parameters</h3>
<br>
<p>
<label>Number of todos</label><br>
<input type="number" ng-model="benchmark.numberOfTodos">
</p>
<br>
<p>
<label>Implementation</label><br>
<div class="radio">
<label>
<input ng-model="benchmark.implementation" value="tableOptimized"
type="radio" name="implementation">
Table optimized <br>
<code>ng-class="todo.completed && 'success'"</code>
</label>
</div>
<div class="radio">
<label>
<input ng-model="benchmark.implementation" value="table"
type="radio" name="implementation">
Table <br>
<code>ng-class="{success: todo.completed}"</code>
</label>
</div>
<div class="radio">
<label>
<input ng-model="benchmark.implementation" value="list"
type="radio" name="implementation">
List <br>
<code>ng-class="{completed: todo.completed, urgent: todo.urgent, important: todo.important"}</code>
</label>
</div>
<div class="radio">
<label>
<input ng-model="benchmark.implementation" value="singleOptimized"
type="radio" name="implementation">
Single ngClass optimized <br>
<code>
ng-class="{'panel-success': !!benchmark.todos, 'panel-danger': !benchmark.todos}"
</code>
</label>
</div>
<div class="radio">
<label>
<input ng-model="benchmark.implementation" value="single"
type="radio" name="implementation">
Single ngClass <br>
<code>
ng-class="{'panel-success': benchmark.todos, 'panel-danger': !benchmark.todos}"
</code>
</label>
</div>
</p>
</div>
<br>
<h3>Example</h3>
<div ng-switch="benchmark.implementation">
<table ng-switch-when="tableOptimized" class="table">
<thead>
<tr>
<th>todo #id</th>
<th>completed?</th>
<th>urgent?</th>
<th>important?</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="todo in benchmark.todos track by todo.id"
ng-class="todo.completed && 'active'"
ng-class-even="todo.completed && todo.important && 'gold'"
ng-class-odd="todo.completed && todo.important && 'silver'"
>
<td>#{{todo.id}}</td>
<td>{{todo.completed}}</td>
<td ng-class="todo.urgent && 'danger'">{{todo.urgent}}</td>
<td ng-class="todo.important && 'success'">{{todo.important}}</td>
</tr>
</tbody>
</table>
<table ng-switch-when="table" class="table">
<thead>
<tr>
<th>todo #id</th>
<th>completed?</th>
<th>urgent?</th>
<th>important?</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="todo in benchmark.todos track by todo.id"
ng-class="{active: todo.completed}"
ng-class-even="{gold: todo.completed && todo.important}"
ng-class-odd="{silver: todo.completed && todo.important}"
>
<td>#{{todo.id}}</td>
<td>{{todo.completed}}</td>
<td ng-class="{danger: todo.urgent}">{{todo.urgent}}</td>
<td ng-class="{success: todo.important}">{{todo.important}}</td>
</tr>
</tbody>
</table>
<ul ng-switch-when="list">
<li ng-repeat="todo in benchmark.todos track by todo.id"
ng-class="{
completed: todo.completed,
urgent: todo.urgent,
important: todo.important
}">#{{todo.id}}</li>
</ul>
<div ng-switch-when="singleOptimized"
class="panel"
ng-class="{'panel-success': !!benchmark.todos, 'panel-danger': !benchmark.todos}">
<div class="panel-heading">
<h3 class="panel-title">Information</h3>
</div>
<div class="panel-body"> The title is green because there are todos... </div>
</div>
<div ng-switch-when="single"
class="panel"
ng-class="{'panel-success': benchmark.todos, 'panel-danger': !benchmark.todos}">
<div class="panel-heading">
<h3 class="panel-title">Information</h3>
</div>
<div class="panel-body"> The title is green because there are todos... </div>
</div>
</div>
</div>
</div>
</div>
<br><br><br>
+95
View File
@@ -0,0 +1,95 @@
'use strict';
/* globals angular, benchmarkSteps */
var app = angular.module('ngOptionsBenchmark', []);
app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});
app.controller('DataController', function($scope, $element) {
$scope.items = [];
$scope.count = 10000;
function changeOptions() {
$scope.items = [];
for (var i = 0; i < $scope.count; ++i) {
$scope.items.push({
id: i,
label: 'item-' + i,
group: 'group-' + i % 100
});
}
}
var selectElement = $element.find('select');
console.log(selectElement);
benchmarkSteps.push({
name: 'add-options',
fn: function() {
$scope.$apply(function() {
$scope.count = 10000;
changeOptions();
});
}
});
benchmarkSteps.push({
name: 'set-model-1',
fn: function() {
$scope.$apply(function() {
$scope.x = $scope.items[1000];
});
}
});
benchmarkSteps.push({
name: 'set-model-2',
fn: function() {
$scope.$apply(function() {
$scope.x = $scope.items[10];
});
}
});
benchmarkSteps.push({
name: 'remove-options',
fn: function() {
$scope.count = 100;
changeOptions();
}
});
benchmarkSteps.push({
name: 'add-options',
fn: function() {
$scope.$apply(function() {
$scope.count = 10000;
changeOptions();
});
}
});
benchmarkSteps.push({
name: 'set-view-1',
fn: function() {
selectElement.val('2000');
selectElement.triggerHandler('change');
}
});
benchmarkSteps.push({
name: 'set-view-2',
fn: function() {
selectElement.val('1000');
selectElement.triggerHandler('change');
}
});
});
+15
View File
@@ -0,0 +1,15 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+10
View File
@@ -0,0 +1,10 @@
<div ng-app="ngOptionsBenchmark" ng-cloak>
<div ng-controller="DataController">
<div class="container-fluid">
<p>
Tests the execution of ng-options for rendering during model and option updates.
</p>
<select ng-model="x" ng-options="a as a.label group by a.group for a in items track by a.id"></select>
</div>
</div>
</div>
+50
View File
@@ -0,0 +1,50 @@
'use strict';
var app = angular.module('orderByBenchmark', []);
app.controller('DataController', function DataController($rootScope, $scope) {
this.ngRepeatCount = 5000;
this.rows = [];
var self = this;
$scope.benchmarkType = 'baseline';
$scope.rawProperty = function(key) {
return function(item) {
return item[key];
};
};
// Returns a random integer between min (included) and max (excluded)
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
benchmarkSteps.push({
name: 'setup',
description: 'Set rows to empty array and apply, then push new rows to be applied in next step',
fn: function() {
var oldRows = self.rows;
$rootScope.$apply(function() {
self.rows = [];
});
self.rows = oldRows;
if (self.rows.length !== self.ngRepeatCount) {
self.rows = [];
for (var i = 0; i < self.ngRepeatCount; i++) {
self.rows.push({
'name': getRandomInt(i, (i + 40)),
'index': i
});
}
}
}
});
benchmarkSteps.push({
name: '$apply',
fn: function() {
$rootScope.$apply();
}
});
});
+18
View File
@@ -0,0 +1,18 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [
{
'id': 'jquery',
'src': 'jquery-noop.js'
}, {
id: 'angular',
src: '/build/angular.js'
}, {
src: 'app.js'
}]
});
};
+1
View File
@@ -0,0 +1 @@
// Override me with ?jquery=/node_modules/jquery/dist/jquery.js
+82
View File
@@ -0,0 +1,82 @@
<div class="container-fluid" ng-app="orderByBenchmark">
<div class="row" ng-controller="DataController as ctrl">
<div class="col-lg-8">
<p>Filters</p>
<p>
<label>Number of ngRepeats:</label>
<input type="number" ng-model="ctrl.ngRepeatCount">
</p>
<p>
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="baseline">baseline
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="orderBy">orderBy
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:'name'"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType" value="orderByArray">orderBy array expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:['name', 'index']"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType"
value="orderByFunction">orderBy function expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')"</code></pre>
<br />
<div class="radio">
<label>
<input type="radio" ng-model="benchmarkType"
value="orderByArrayFunction">orderBy array function expression
</label>
</div>
<pre><code>ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]"</code></pre>
</p>
Debug output:
<ng-switch on="benchmarkType">
<div ng-switch-when="baseline">
<span ng-repeat="row in ctrl.rows">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderBy">
<span ng-repeat="row in ctrl.rows | orderBy:'name'">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByArray">
<span ng-repeat="row in ctrl.rows | orderBy:['name', 'index']">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByFunction">
<span ng-repeat="row in ctrl.rows | orderBy:rawProperty('name')">
<span ng-bind="row.name"></span>,
</span>
</div>
<div ng-switch-when="orderByArrayFunction">
<span ng-repeat="row in ctrl.rows | orderBy:[rawProperty('name'), rawProperty('index')]">
<span ng-bind="row.name"></span>,
</span>
</div>
</ng-switch>
</div>
</div>
</div>
+84
View File
@@ -0,0 +1,84 @@
'use strict';
var app = angular.module('parsedExpressionBenchmark', []);
app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});
app.filter('noop', function() {
return function(input) {
return input;
};
});
//Executes the specified expression as a watcher
app.directive('bmPeWatch', function() {
return {
restrict: 'A',
compile: function($element, $attrs) {
$element.text($attrs.bmPeWatch);
return function($scope, $element, $attrs) {
$scope.$watch($attrs.bmPeWatch, function(val) {
$element.text(val);
});
};
}
};
});
//Executes the specified expression as a collection watcher
app.directive('bmPeWatchCollection', function() {
return {
restrict: 'A',
compile: function($element, $attrs) {
$element.text($attrs.bmPeWatchCollection);
return function($scope, $element, $attrs) {
$scope.$watchCollection($attrs.bmPeWatchCollection, function(val) {
$element.text(val);
});
};
}
};
});
app.controller('DataController', function($scope, $rootScope) {
var totalRows = 10000;
var data = $scope.data = [];
var star = '*';
$scope.func = function() { return star; };
for (var i = 0; i < totalRows; i++) {
data.push({
index: i,
odd: i % 2 === 0,
even: i % 2 === 1,
str0: 'foo-' + Math.random() * Date.now(),
str1: 'bar-' + Math.random() * Date.now(),
str2: 'baz-' + Math.random() * Date.now(),
num0: Math.random() * Date.now(),
num1: Math.random() * Date.now(),
num2: Math.random() * Date.now(),
date0: new Date(Math.random() * Date.now()),
date1: new Date(Math.random() * Date.now()),
date2: new Date(Math.random() * Date.now()),
func: function() { return star; },
obj: data[i - 1],
keys: data[i - 1] && (data[i - 1].keys || Object.keys(data[i - 1]))
});
}
benchmarkSteps.push({
name: '$apply',
fn: function() {
for (var i = 0; i < 50; i++) {
$rootScope.$digest();
}
}
});
});
@@ -0,0 +1,15 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+253
View File
@@ -0,0 +1,253 @@
<div ng-app="parsedExpressionBenchmark" ng-cloak>
<div ng-controller="DataController">
<div class="container-fluid">
<p>
Tests the execution of $parse()ed expressions. Each test tries to isolate specific expression types. Expressions should (probably) not be constant so they get evaluated per digest.
</p>
<ul style="list-style:none">
<li>
<input type="radio" ng-model="expressionType" value="simplePath" id="simplePath">
<label for="simplePath">Simple Paths</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="complexPath" id="complexPath">
<label for="complexPath">Complex Paths</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="fieldAccess" id="fieldAccess">
<label for="fieldAccess">Field Accessors</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="fieldIndex" id="fieldIndex">
<label for="fieldIndex">Field Indexes</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="operators" id="operators">
<label for="operators">Binary/Unary operators</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="shortCircuitingOperators" id="shortCircuitingOperators">
<label for="shortCircuitingOperators">AND/OR short-circuiting operators</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="filters" id="filters">
<label for="filters">Filters</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="functionCalls" id="functionCalls">
<label for="functionCalls">Function calls</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="assignment" id="assignment">
<label for="assignment">Assignment</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="objectLiterals" id="objectLiterals">
<label for="objectLiterals">Object Literals</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="arrayLiterals" id="arrayLiterals">
<label for="arrayLiterals">Array Literals</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="watchCollection" id="watchCollection">
<label for="watchCollection">$watchCollection</label>
</li>
<li>
<input type="radio" ng-model="expressionType" value="watchCollectionLiterals" id="watchCollectionLiterals">
<label for="watchCollectionLiterals">$watchCollection Literals</label>
</li>
</ul>
<!--
NOTES:
- ensure each tested expression has at least one variable in it to avoid constant expressions
-->
<ul ng-switch="expressionType">
<li ng-switch-when="simplePath" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="rowIdx"></span>
<span bm-pe-watch="row.index"></span>
<span bm-pe-watch="row.num0"></span>
<span bm-pe-watch="row.num1"></span>
<span bm-pe-watch="row.num2"></span>
<span bm-pe-watch="row.str0"></span>
<span bm-pe-watch="row.str1"></span>
<span bm-pe-watch="row.str2"></span>
<span bm-pe-watch="row.date0"></span>
<span bm-pe-watch="row.obj"></span>
<span bm-pe-watch="row.keys"></span>
</li>
<li ng-switch-when="complexPath" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="row.index"></span>
<span bm-pe-watch="row.num0"></span>
<span bm-pe-watch="row.num1"></span>
<span bm-pe-watch="row.str0"></span>
<span bm-pe-watch="row.str1"></span>
<span bm-pe-watch="row.obj.index"></span>
<span bm-pe-watch="row.obj.index"></span>
<span bm-pe-watch="row.obj.index"></span>
<span bm-pe-watch="row.obj.obj.index"></span>
<span bm-pe-watch="row.obj.obj.index"></span>
<span bm-pe-watch="row.obj.obj.obj.index"></span>
<span bm-pe-watch="row.obj.obj.obj.index"></span>
</li>
<li ng-switch-when="fieldAccess" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="data[rowIdx].index"></span>
<span bm-pe-watch="data[rowIdx].num0"></span>
<span bm-pe-watch="data[rowIdx].num1"></span>
<span bm-pe-watch="data[rowIdx].str0"></span>
<span bm-pe-watch="data[rowIdx].str1"></span>
<span bm-pe-watch="data[rowIdx].obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.obj.obj.index"></span>
<span bm-pe-watch="data[rowIdx].obj.obj.obj.index"></span>
</li>
<li ng-switch-when="fieldIndex" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="data[rowIdx]"></span>
<span bm-pe-watch="row['str0']"></span>
<span bm-pe-watch="row['str1']"></span>
<span bm-pe-watch="data[row['index']]['index']"></span>
<span bm-pe-watch="data[rowIdx]['obj']"></span>
<span bm-pe-watch="data[rowIdx]['obj']['obj']"></span>
<span bm-pe-watch="row[row['keys'][0]]"></span>
<span bm-pe-watch="row[row['keys'][1]]"></span>
<span bm-pe-watch="row[row['keys'][2]]"></span>
<span bm-pe-watch="row[row['keys'][3]]"></span>
<span bm-pe-watch="row[row['keys'][4]]"></span>
<span bm-pe-watch="row[row['keys'][5]]"></span>
</li>
<li ng-switch-when="operators" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="+rowIdx"></span>
<span bm-pe-watch="-rowIdx"></span>
<span bm-pe-watch="rowIdx + 1"></span>
<span bm-pe-watch="rowIdx - 1"></span>
<span bm-pe-watch="rowIdx * 2"></span>
<span bm-pe-watch="rowIdx + -1"></span>
<span bm-pe-watch="rowIdx - -1"></span>
<span bm-pe-watch="-rowIdx * 2 + 1"></span>
<span bm-pe-watch="rowIdx % 2"></span>
<span bm-pe-watch="rowIdx % 2 === 1"></span>
<span bm-pe-watch="rowIdx % 2 === 0"></span>
<span bm-pe-watch="rowIdx / 1"></span>
<span bm-pe-watch="-rowIdx * 2 * rowIdx + rowIdx / rowIdx + 1"></span>
</li>
<li ng-switch-when="shortCircuitingOperators" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="rowIdx && row.odd"></span>
<span bm-pe-watch="row.odd && row.even"></span>
<span bm-pe-watch="row.odd && !row.even"></span>
<span bm-pe-watch="row.odd || row.even"></span>
<span bm-pe-watch="row.odd || row.even || row.index"></span>
<span bm-pe-watch="row.index === 1 || row.index === 2"></span>
<span bm-pe-watch="row.num0 < row.num1 && row.num1 < row.num2"></span>
<span bm-pe-watch="row.num0 < row.num1 || row.num1 < row.num2"></span>
</li>
<li ng-switch-when="filters" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="rowIdx | noop"></span>
<span bm-pe-watch="rowIdx | noop"></span>
<span bm-pe-watch="rowIdx | noop"></span>
<span bm-pe-watch="rowIdx | noop:1"></span>
<span bm-pe-watch="rowIdx | noop:rowIdx"></span>
<span bm-pe-watch="rowIdx | noop:1:2:3:4:5"></span>
<span bm-pe-watch="rowIdx | noop:rowIdx:rowIdx:rowIdx"></span>
<span bm-pe-watch="rowIdx | noop | noop"></span>
<span bm-pe-watch="rowIdx | noop:1 | noop"></span>
<span bm-pe-watch="rowIdx | noop | noop:null:undefined:0"></span>
<span bm-pe-watch="rowIdx | noop | noop | noop"></span>
<span bm-pe-watch="rowIdx | noop:1 | noop:2 | noop:3"></span>
</li>
<li ng-switch-when="functionCalls" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="func()"></span>
<span bm-pe-watch="func(1)"></span>
<span bm-pe-watch="func(1, 2)"></span>
<span bm-pe-watch="func(1, 2, 3)"></span>
<span bm-pe-watch="row.func()"></span>
<span bm-pe-watch="row.func(1)"></span>
<span bm-pe-watch="row.func(1, 2)"></span>
<span bm-pe-watch="row.func(1, 2, 3)"></span>
<span bm-pe-watch="func(func())"></span>
<span bm-pe-watch="func(func(), func())"></span>
<span bm-pe-watch="row.func(row.func())"></span>
<span bm-pe-watch="row.func(row.func(), row.func())"></span>
</li>
<li ng-switch-when="assignment" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="row.foo = row.str0"></span>
<span bm-pe-watch="row.obj.foo = row.str1"></span>
<span bm-pe-watch="row.obj.obj.foo = row.str2"></span>
<span bm-pe-watch="row['bar'] = row.num0"></span>
<span bm-pe-watch="row.obj['bar'] = row.num1"></span>
<span bm-pe-watch="row.obj.obj['bar'] = row.num2"></span>
<span bm-pe-watch="row[0] = row.date0"></span>
<span bm-pe-watch="row.obj[0] = row.date1"></span>
<span bm-pe-watch="row.obj.obj[0] = row.date2"></span>
</li>
<li ng-switch-when="objectLiterals" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="{foo: rowIdx}"></span>
<span bm-pe-watch="{foo: row, bar: rowIdx}"></span>
<span bm-pe-watch="{0: row, 1: rowIdx, 2: 3}"></span>
<span bm-pe-watch="{str: 'foo', num: rowIdx, b: true}"></span>
<span bm-pe-watch="{a: {b: {c: {d: {e: {f: rowIdx}}}}}}"></span>
<span bm-pe-watch="{a: rowIdx, b: 1, c: 2, d: 3, e: 4, f: 5, g: rowIdx, h: 6, i: 7, j: 8, k: rowIdx}"></span>
</li>
<li ng-switch-when="arrayLiterals" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch="[rowIdx]"></span>
<span bm-pe-watch="[rowIdx, 0]"></span>
<span bm-pe-watch="[rowIdx, 0, 1]"></span>
<span bm-pe-watch="[rowIdx, 0, 1, 2]"></span>
<span bm-pe-watch="[rowIdx, 0, 1, 2, 3]"></span>
<span bm-pe-watch="[[], [rowIdx], [], [], [3], [[[]]]]"></span>
<span bm-pe-watch="[rowIdx, undefined, null, true, false]"></span>
<span bm-pe-watch="[[][0], [0][0], [][rowIdx]]"></span>
<span bm-pe-watch="[0, rowIdx]"></span>
<span bm-pe-watch="[0, 1, rowIdx]"></span>
<span bm-pe-watch="[0, 1, 2, rowIdx]"></span>
<span bm-pe-watch="[0, 1, 2, 3, rowIdx]"></span>
</li>
<li ng-switch-when="watchCollection" ng-repeat="(rowIdx, row) in data">
<span bm-pe-watch-collection="data"></span>
<span bm-pe-watch-collection="row.keys"></span>
<span bm-pe-watch-collection="thisProbablyDoesntHaveAValue"></span>
</li>
<li ng-switch-when="watchCollectionLiterals" ng-repeat="(rowIdx, row) in ::data">
<span bm-pe-watch-collection="[rowIdx, row]"></span>
<span bm-pe-watch-collection="[rowIdx, row, num0, str0, date0, obj, g, h, i, j, k, l, m, n, o, p]"></span>
<span bm-pe-watch-collection="{a: rowIdx, b: row, c: num0, d: str0, e: date0, f: obj, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p}"></span>
<!-- primitive/valueOf-compatible -->
<span bm-pe-watch-collection="[rowIdx, row]"></span>
<span bm-pe-watch-collection="[rowIdx, num0, str0, date0, date1, h, i, j, k, l, m, n, o, p]"></span>
<span bm-pe-watch-collection="{a: rowIdx, c: num0, d: str0, e: date0, g: date1, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p}"></span>
</li>
</ul>
</div>
</div>
</div>
@@ -0,0 +1,9 @@
'use strict';
angular.module('repeatAnimateBenchmark', ['ngAnimate'])
.config(function($animateProvider) {
$animateProvider.classNameFilter(/animate-/);
})
.run(function($rootScope) {
$rootScope.fileType = 'classfilter';
});
@@ -0,0 +1,6 @@
'use strict';
angular.module('repeatAnimateBenchmark', [])
.run(function($rootScope) {
$rootScope.fileType = 'noanimate';
});
+7
View File
@@ -0,0 +1,7 @@
'use strict';
angular.module('repeatAnimateBenchmark', ['ngAnimate'])
.run(function($rootScope) {
$rootScope.fileType = 'default';
});
+24
View File
@@ -0,0 +1,24 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [
{
id: 'angular',
src: '/build/angular.js'
},
{
id: 'angular-animate',
src: '/build/angular-animate.js'
},
{
id: 'app',
src: 'app.js'
},
{
src: 'common.js'
}]
});
};
+120
View File
@@ -0,0 +1,120 @@
'use strict';
(function() {
var app = angular.module('repeatAnimateBenchmark');
app.config(function($compileProvider, $animateProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});
app.run(function($animate) {
if ($animate.enabled) {
$animate.enabled(true);
}
});
app.controller('DataController', function($scope, $rootScope, $animate) {
var totalRows = 500;
var totalColumns = 20;
var data = $scope.data = [];
function fillData() {
if ($animate.enabled) {
$animate.enabled($scope.benchmarkType !== 'globallyDisabled');
}
for (var i = 0; i < totalRows; i++) {
data[i] = [];
for (var j = 0; j < totalColumns; j++) {
data[i][j] = {
i: i
};
}
}
}
benchmarkSteps.push({
name: 'enter',
fn: function() {
$scope.$apply(function() {
fillData();
});
}
});
benchmarkSteps.push({
name: 'leave',
fn: function() {
$scope.$apply(function() {
data = $scope.data = [];
});
}
});
});
app.directive('disableAnimations', function($animate) {
return {
link: {
pre: function(s, e) {
$animate.enabled(e, false);
}
}
};
});
app.directive('noop', function($animate) {
return {
link: {
pre: angular.noop
}
};
});
app.directive('baseline', function($document) {
return {
restrict: 'E',
link: function($scope, $element) {
var document = $document[0];
var i, j, row, cell, comment;
var template = document.createElement('span');
template.setAttribute('ng-repeat', 'foo in foos');
template.classList.add('ng-scope');
template.appendChild(document.createElement('span'));
template.appendChild(document.createTextNode(':'));
function createList() {
for (i = 0; i < $scope.data.length; i++) {
row = document.createElement('div');
$element[0].appendChild(row);
for (j = 0; j < $scope.data[i].length; j++) {
cell = template.cloneNode(true);
row.appendChild(cell);
cell.childNodes[0].textContent = i;
cell.ng339 = 'xxx';
comment = document.createComment('ngRepeat end: bar in foo');
row.appendChild(comment);
}
comment = document.createComment('ngRepeat end: foo in foos');
$element[0].appendChild(comment);
}
}
$scope.$watch('data.length', function(newVal) {
if (newVal === 0) {
while ($element[0].firstChild) {
$element[0].removeChild($element[0].firstChild);
}
} else {
createList();
}
});
}
};
});
})();
+70
View File
@@ -0,0 +1,70 @@
<div ng-app="repeatAnimateBenchmark" ng-cloak>
<div ng-controller="DataController">
<div class="container-fluid">
<p>
Tests rendering of an ngRepeat with 500 elements.<br>
Animations can be enabled / disabled in different ways.<br>
Two tests require reloading the app with different module / app configurations.
</p>
<div><label><input type="radio" ng-model="benchmarkType" value="none">none: </label></div>
<div><label><input type="radio" ng-model="benchmarkType" value="baseline">baseline (vanilla Javascript): </label></div>
<div><label><input type="radio" ng-model="benchmarkType" ng-disabled="fileType !== 'default'" value="enabled">enabled : </label> (requires <a href="./">app.js</a>)</div>
<div><label><input type="radio" ng-model="benchmarkType" ng-disabled="fileType !== 'default' && fileType !== 'classfilter'" value="globallyDisabled">globally disabled:</label> (requires <a href="./">app.js</a> or <a href="?app=app-classfilter.js">app-classfilter.js</a>)</div>
<div><label><input type="radio" ng-model="benchmarkType" ng-disabled="fileType !== 'default'" value="disabledParentElement">disabled by $animate.enabled() on parent element: </label> (requires <a href="./">app.js</a>)</div>
<div><label><input type="radio" ng-model="benchmarkType" ng-disabled="fileType !== 'noanimate'" value="noanimate">Without ngAnimate:</label> (requires <a href="?app=app-noanimate.js">app-noanimate.js</a>)</div>
<div><label><input type="radio" ng-model="benchmarkType" ng-disabled="fileType !== 'classfilter'" value="disabledClassFilter">disabled by classNameFilter on element:</label> (requires <a href="?app=app-classfilter.js">app-classfilter.js</a>)</div>
<ng-switch on="benchmarkType">
<baseline ng-switch-when="baseline">
</baseline>
<div ng-switch-when="noanimate">
<div noop>
<div ng-repeat="row in data">
<span ng-repeat="column in row">
<span>{{column.i}}</span>
</span>
</div>
</div>
</div>
<div ng-switch-when="enabled">
<div noop>
<div ng-repeat="row in data">
<span ng-repeat="column in row">
<span>{{column.i}}</span>
</span>
</div>
</div>
</div>
<div ng-switch-when="globallyDisabled">
<div noop>
<div ng-repeat="row in data">
<span ng-repeat="column in row">
<span>{{column.i}}</span>
</span>
</div>
</div>
</div>
<div ng-switch-when="disabledClassFilter">
<div noop>
<div ng-repeat="row in data">
<span class="disable-animations" ng-repeat="column in row">
<span>{{column.i}}</span>
</span>
</div>
</div>
</div>
<div ng-switch-when="disabledParentElement">
<div disable-animations>
<div ng-repeat="row in data">
<span ng-repeat="column in row">
<span>{{column.i}}</span>
</span>
</div>
</div>
</div>
</ng-switch>
</div>
</div>
</div>
+104
View File
@@ -0,0 +1,104 @@
'use strict';
/* globals angular, benchmarkSteps */
var app = angular.module('selectBenchmark', []);
app.config(function($compileProvider) {
if ($compileProvider.debugInfoEnabled) {
$compileProvider.debugInfoEnabled(false);
}
});
app.controller('DataController', function($scope, $element) {
$scope.groups = [];
$scope.count = 10000;
function changeOptions() {
$scope.groups = [];
var i = 0;
var group;
while (i < $scope.count) {
if (i % 100 === 0) {
group = {
name: 'group-' + $scope.groups.length,
items: []
};
$scope.groups.push(group);
}
group.items.push({
id: i,
label: 'item-' + i
});
i++;
}
}
var selectElement = $element.find('select');
console.log(selectElement);
benchmarkSteps.push({
name: 'add-options',
fn: function() {
$scope.$apply(function() {
$scope.count = 10000;
changeOptions();
});
}
});
benchmarkSteps.push({
name: 'set-model-1',
fn: function() {
$scope.$apply(function() {
$scope.x = $scope.groups[10].items[0];
});
}
});
benchmarkSteps.push({
name: 'set-model-2',
fn: function() {
$scope.$apply(function() {
$scope.x = $scope.groups[0].items[10];
});
}
});
benchmarkSteps.push({
name: 'remove-options',
fn: function() {
$scope.count = 100;
changeOptions();
}
});
benchmarkSteps.push({
name: 'add-options',
fn: function() {
$scope.$apply(function() {
$scope.count = 10000;
changeOptions();
});
}
});
benchmarkSteps.push({
name: 'set-view-1',
fn: function() {
selectElement.val('2000');
selectElement.triggerHandler('change');
}
});
benchmarkSteps.push({
name: 'set-view-2',
fn: function() {
selectElement.val('1000');
selectElement.triggerHandler('change');
}
});
});
+15
View File
@@ -0,0 +1,15 @@
/* eslint-env node */
'use strict';
module.exports = function(config) {
config.set({
scripts: [{
id: 'angular',
src: '/build/angular.js'
},
{
src: 'app.js'
}]
});
};
+15
View File
@@ -0,0 +1,15 @@
<div ng-app="selectBenchmark" ng-cloak>
<div ng-controller="DataController">
<div class="container-fluid">
<p>
Tests the execution of a select with ngRepeat'ed options with ngValue for rendering during model
and option updates.
</p>
<select ng-model="x">
<optgroup ng-repeat="g in groups track by g.name" label="{{g.name}}">
<option ng-repeat="a in g.items track by a.id" ng-value="a">{{a.label}}</option>
</optgroup>
</select>
</div>
</div>
</div>
-12
View File
@@ -1,12 +0,0 @@
{
"name": "AngularJS",
"devDependencies": {
"jquery": "2.1.1",
"lunr.js": "0.4.3",
"open-sans-fontface": "1.0.4",
"google-code-prettify": "1.0.1",
"closure-compiler": "https://closure-compiler.googlecode.com/files/compiler-20130603.zip",
"ng-closure-runner": "https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip",
"bootstrap": "3.1.1"
}
}
-208
View File
@@ -1,208 +0,0 @@
#!/usr/bin/env node
// TODO(vojta): pre-commit hook for validating messages
// TODO(vojta): report errors, currently Q silence everything which really sucks
'use strict';
var child = require('child_process');
var fs = require('fs');
var util = require('util');
var q = require('qq');
var GIT_LOG_CMD = 'git log --grep="%s" -E --format=%s %s..HEAD';
var GIT_TAG_CMD = 'git describe --tags --abbrev=0';
var HEADER_TPL = '<a name="%s"></a>\n# %s (%s)\n\n';
var LINK_ISSUE = '[#%s](https://github.com/angular/angular.js/issues/%s)';
var LINK_COMMIT = '[%s](https://github.com/angular/angular.js/commit/%s)';
var EMPTY_COMPONENT = '$$';
var warn = function() {
console.log('WARNING:', util.format.apply(null, arguments));
};
var parseRawCommit = function(raw) {
if (!raw) return null;
var lines = raw.split('\n');
var msg = {}, match;
msg.hash = lines.shift();
msg.subject = lines.shift();
msg.closes = [];
msg.breaks = [];
lines.forEach(function(line) {
match = line.match(/(?:Closes|Fixes)\s#(\d+)/);
if (match) msg.closes.push(parseInt(match[1]));
});
match = raw.match(/BREAKING CHANGE:([\s\S]*)/);
if (match) {
msg.breaking = match[1];
}
msg.body = lines.join('\n');
match = msg.subject.match(/^(.*)\((.*)\)\:\s(.*)$/);
if (!match || !match[1] || !match[3]) {
warn('Incorrect message: %s %s', msg.hash, msg.subject);
return null;
}
msg.type = match[1];
msg.component = match[2];
msg.subject = match[3];
return msg;
};
var linkToIssue = function(issue) {
return util.format(LINK_ISSUE, issue, issue);
};
var linkToCommit = function(hash) {
return util.format(LINK_COMMIT, hash.substr(0, 8), hash);
};
var currentDate = function() {
var now = new Date();
var pad = function(i) {
return ('0' + i).substr(-2);
};
return util.format('%d-%s-%s', now.getFullYear(), pad(now.getMonth() + 1), pad(now.getDate()));
};
var printSection = function(stream, title, section, printCommitLinks) {
printCommitLinks = printCommitLinks === undefined ? true : printCommitLinks;
var components = Object.getOwnPropertyNames(section).sort();
if (!components.length) return;
stream.write(util.format('\n## %s\n\n', title));
components.forEach(function(name) {
var prefix = '-';
var nested = section[name].length > 1;
if (name !== EMPTY_COMPONENT) {
if (nested) {
stream.write(util.format('- **%s:**\n', name));
prefix = ' -';
} else {
prefix = util.format('- **%s:**', name);
}
}
section[name].forEach(function(commit) {
if (printCommitLinks) {
stream.write(util.format('%s %s\n (%s', prefix, commit.subject, linkToCommit(commit.hash)));
if (commit.closes.length) {
stream.write(',\n ' + commit.closes.map(linkToIssue).join(', '));
}
stream.write(')\n');
} else {
stream.write(util.format('%s %s', prefix, commit.subject));
}
});
});
stream.write('\n');
};
var readGitLog = function(grep, from) {
var deferred = q.defer();
// TODO(vojta): if it's slow, use spawn and stream it instead
child.exec(util.format(GIT_LOG_CMD, grep, '%H%n%s%n%b%n==END==', from), function(code, stdout, stderr) {
var commits = [];
stdout.split('\n==END==\n').forEach(function(rawCommit) {
var commit = parseRawCommit(rawCommit);
if (commit) commits.push(commit);
});
deferred.resolve(commits);
});
return deferred.promise;
};
var writeChangelog = function(stream, commits, version) {
var sections = {
fix: {},
feat: {},
perf: {},
breaks: {}
};
sections.breaks[EMPTY_COMPONENT] = [];
commits.forEach(function(commit) {
var section = sections[commit.type];
var component = commit.component || EMPTY_COMPONENT;
if (section) {
section[component] = section[component] || [];
section[component].push(commit);
}
if (commit.breaking) {
sections.breaks[component] = sections.breaks[component] || [];
sections.breaks[component].push({
subject: util.format("due to %s,\n %s", linkToCommit(commit.hash), commit.breaking),
hash: commit.hash,
closes: []
});
}
});
stream.write(util.format(HEADER_TPL, version, version, currentDate()));
printSection(stream, 'Bug Fixes', sections.fix);
printSection(stream, 'Features', sections.feat);
printSection(stream, 'Performance Improvements', sections.perf);
printSection(stream, 'Breaking Changes', sections.breaks, false);
};
var getPreviousTag = function() {
var deferred = q.defer();
child.exec(GIT_TAG_CMD, function(code, stdout, stderr) {
if (code) deferred.reject('Cannot get the previous tag.');
else deferred.resolve(stdout.replace('\n', ''));
});
return deferred.promise;
};
var generate = function(version, file) {
getPreviousTag().then(function(tag) {
console.log('Reading git log since', tag);
readGitLog('^fix|^feat|^perf|BREAKING', tag).then(function(commits) {
console.log('Parsed', commits.length, 'commits');
console.log('Generating changelog to', file || 'stdout', '(', version, ')');
writeChangelog(file ? fs.createWriteStream(file) : process.stdout, commits, version);
});
});
};
// publish for testing
exports.parseRawCommit = parseRawCommit;
// hacky start if not run by jasmine :-D
if (process.argv.join('').indexOf('jasmine-node') === -1) {
generate(process.argv[2], process.argv[3]);
}
-47
View File
@@ -1,47 +0,0 @@
/* global describe: false, it: false, expect: false */
'use strict';
describe('changelog.js', function() {
var ch = require('./changelog');
describe('parseRawCommit', function() {
it('should parse raw commit', function() {
var msg = ch.parseRawCommit(
'9b1aff905b638aa274a5fc8f88662df446d374bd\n' +
'feat(scope): broadcast $destroy event on scope destruction\n' +
'perf testing shows that in chrome this change adds 5-15% overhead\n' +
'when destroying 10k nested scopes where each scope has a $destroy listener\n');
expect(msg.type).toBe('feat');
expect(msg.hash).toBe('9b1aff905b638aa274a5fc8f88662df446d374bd');
expect(msg.subject).toBe('broadcast $destroy event on scope destruction');
expect(msg.body).toBe('perf testing shows that in chrome this change adds 5-15% overhead\n' +
'when destroying 10k nested scopes where each scope has a $destroy listener\n');
expect(msg.component).toBe('scope');
});
it('should parse closed issues', function() {
var msg = ch.parseRawCommit(
'13f31602f396bc269076ab4d389cfd8ca94b20ba\n' +
'feat(ng-list): Allow custom separator\n' +
'bla bla bla\n\n' +
'Closes #123\nCloses #25\n');
expect(msg.closes).toEqual([123, 25]);
});
it('should parse breaking changes', function() {
var msg = ch.parseRawCommit(
'13f31602f396bc269076ab4d389cfd8ca94b20ba\n' +
'feat(ng-list): Allow custom separator\n' +
'bla bla bla\n\n' +
'BREAKING CHANGE: first breaking change\nsomething else\n' +
'another line with more info\n');
expect(msg.breaking).toEqual(' first breaking change\nsomething else\nanother line with more info\n');
});
});
});
+2 -1
View File
@@ -13,7 +13,8 @@ body {
text-align: center;
}
#json, #xml {
#json,
#xml {
display: none;
}
+15 -3
View File
@@ -1,11 +1,23 @@
@charset "UTF-8";
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
.ng-cloak, .x-ng-cloak,
.ng-hide:not(.ng-animate) {
[ng\:cloak],
[ng-cloak],
[data-ng-cloak],
[x-ng-cloak],
.ng-cloak,
.x-ng-cloak,
.ng-hide:not(.ng-hide-animate) {
display: none !important;
}
ng\:form {
display: block;
}
.ng-animate-shim {
visibility:hidden;
}
.ng-anchor {
position:absolute;
}
+1
View File
@@ -0,0 +1 @@
.visible-phone{display:none}.visible-desktop{display:block}.navbar{display:block}.navbar .container{padding:0 16px;width:auto}.navbar .brand{float:left;margin:8px 80px 0 8px;padding:0}.navbar .brand a{display:block;height:30px;margin:6px 0 5px 0;overflow:hidden;padding:0;width:117px}.navbar .nav{float:right}.navbar .nav .dropdown-toggle{color:rgba(255,255,255,0.87);font-size:16px;font-weight:300;line-height:56px;padding:0 24px;text-transform:uppercase;transition:all .3s}.navbar .nav .dropdown-toggle:hover,.navbar .nav .dropdown-toggle:active,.navbar .nav .dropdown-toggle:focus{background:#37474F;color:#fff}.navbar .nav .dropdown-menu{background:#37474F;border:none;border-radius:0;box-shadow:0 0 16px rgba(0,0,0,0.12),0 16px 16px rgba(0,0,0,0.24);color:#fff;left:auto;margin:0;padding:0;right:0}.navbar .nav .dropdown-menu:after,.navbar .nav .dropdown-menu:before{display:none}.navbar .nav .dropdown-menu li{border-bottom:1px solid rgba(38,50,56,0.56);box-sizing:border-box;line-height:48px}.navbar .nav .dropdown-menu li:last-child{border:none}.navbar .nav .dropdown-menu a{background:#37474F;color:#fff;font-weight:300;line-height:48px;padding:0 16px;transition:all .2s}.navbar .nav .dropdown-menu a:hover,.navbar .nav .dropdown-menu a:focus{background:#455A64}.navbar .navbar-search{left:200px;margin:0;position:absolute;right:440px;top:8px;width:auto}.navbar .navbar-search i{color:#546E7A;font-size:16px;left:12px;position:absolute;top:11px}.navbar .navbar-search .search-query{background:#37474F;border:none;border-radius:2px;box-shadow:none;box-sizing:border-box;color:#546E7A;font-size:14px;height:40px;width:100%;padding:0 16px 0 32px;text-shadow:none;transition:all .3s}.navbar .navbar-search .search-query:-webkit-autofill,.navbar .navbar-search .search-query:-webkit-autofill:hover,.navbar .navbar-search .search-query:-webkit-autofill:focus{background-color:#fff;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#455A64}.navbar .navbar-search .search-query:hover,.navbar .navbar-search .search-query:active,.navbar .navbar-search .search-query:focus{background:#fff;box-shadow:inset 0 2px 4px rgba(0,0,0,0.24);color:#2196F3}.navbar .navbar-search .search-query::-webkit-input-placeholder{color:#546E7A}.navbar .navbar-search .search-query::-moz-placeholder{color:#546E7A}.navbar .navbar-search .search-query:-ms-input-placeholder{color:#546E7A}.navbar .navbar-search .search-query:-moz-placeholder{color:#546E7A}#navbar-main .navbar-inner{background:#263238;height:56px}#navbar-notice{z-index:1029;top:56px}#navbar-notice .navbar-inner{background:#ECEFF1;box-shadow:0 0 3px rgba(0,0,0,0.12),0 3px 3px rgba(0,0,0,0.24);height:auto}.site-notice{padding:4px 0;text-align:center;font-size:13px;margin:0}@media handheld and (max-width: 800px), screen and (max-device-width: 800px), screen and (max-width: 800px){.visible-phone{display:block}.visible-desktop{display:none}}@media handheld and (max-width: 800px), screen and (max-device-width: 800px), screen and (max-width: 800px){.homepage .container{padding:16px;width:auto}.homepage .span1{width:auto}.homepage .span2{width:auto}.homepage .span3{width:auto}.homepage .span4{width:auto}.homepage .span5{width:auto}.homepage .span6{width:auto}.homepage .span7{width:auto}.homepage .span8{width:auto}.homepage .span9{width:auto}.homepage .span10{width:auto}.homepage .navbar .container{padding:0 8px}.homepage #navbar-main .navbar-inner{height:40px}.homepage #navbar-main .brand{margin:6px 0 0 0}.homepage #navbar-main .brand a{margin:0}.homepage #navbar-main .nav{margin:0}.homepage #navbar-main .nav .dropdown-toggle{font-size:12px;line-height:40px;padding:0 8px}.homepage #navbar-main .dropdown-menu a{padding:0 8px}.homepage #navbar-main .navbar-search{background:#263238;border-bottom:1px solid #263238;left:0;right:0;top:100%}.homepage #navbar-main .navbar-search i{left:12px;top:7px}.homepage #navbar-main .navbar-search .search-query{border-radius:0;height:32px}.homepage #navbar-notice{top:40px}.homepage #navbar-notice .site-notice{font-size:11px}.homepage .hero{padding:80px 32px 32px 32px}.homepage .hero h2{background-size:230px 60px;height:60px;width:230px}}
+3 -3
View File
@@ -22,7 +22,7 @@ ul.doc-example > li.doc-example-heading {
span.nojsfiddle {
float: right;
font-size: 14px;
margin-right:10px;
margin-right: 10px;
margin-top: 10px;
}
@@ -42,7 +42,7 @@ form.jsfiddle button {
color: #7989D6;
border-color: #7989D6;
-moz-border-radius: 8px;
-webkit-border-radius:8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}
@@ -56,7 +56,7 @@ li.doc-example-live {
}
div.syntaxhighlighter {
padding-bottom: 1px !important; /* fix to remove unnecessary scrollbars http://is.gd/gSMgC */
padding-bottom: 1px !important; /* fix to remove unnecessary scrollbars */
}
/* TABS - tutorial environment navigation */
File diff suppressed because it is too large Load Diff
+4
View File
@@ -6,6 +6,10 @@
line-height: 1.5;
}
.lang-text * {
color: #333333!important;
}
.pln {
color: #333333;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Executable → Regular
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Some files were not shown because too many files have changed in this diff Show More