Compare commits
84 Commits
2.0.0-beta
...
2.0.0-rc.0
Author | SHA1 | Date | |
---|---|---|---|
00d3b6083c | |||
c386fc8379 | |||
43527172ed | |||
b88384eed8 | |||
107016ec12 | |||
d930ad1816 | |||
072446aed3 | |||
2e1f3f003d | |||
fdd8bd1a36 | |||
7db911fdd4 | |||
b6fd81169b | |||
3ae856ab8b | |||
ce5b37239e | |||
3e17c99f4e | |||
bb8976608d | |||
cd52318f48 | |||
2570b72158 | |||
6e79de794c | |||
c4be30d2e8 | |||
57240c85a5 | |||
a66cdb469f | |||
505da6c0a8 | |||
4fe0f1fa65 | |||
ec4ca0eace | |||
db95fd6ca9 | |||
ca13f1c024 | |||
277b1fc473 | |||
8836219b16 | |||
6f5e3f9390 | |||
a84c2d7fee | |||
f114d6c560 | |||
163d80adb7 | |||
9e05814212 | |||
ab56be46e1 | |||
6a0cbb8a57 | |||
4e2c68354e | |||
62a0809e81 | |||
76d6f5fa0d | |||
0f1b370117 | |||
e589f9949b | |||
0f774df811 | |||
351f24e8eb | |||
aecb60a604 | |||
4d691b61ee | |||
11955f9b13 | |||
5ff31f0713 | |||
deba804671 | |||
e5b87e55da | |||
d097784d57 | |||
15f6b27ae0 | |||
176e55927c | |||
365be6a309 | |||
713e6d4aff | |||
a8e277b067 | |||
3aa322a9c6 | |||
a02614beaa | |||
d2527b504a | |||
46cd868827 | |||
b1a9e445b3 | |||
5297c9d9cc | |||
ee7caceec7 | |||
a0b5964a63 | |||
cacdead96d | |||
96ae348648 | |||
78946fe9fa | |||
33e53c9a59 | |||
c493d88405 | |||
8bf6ef6544 | |||
ca40ef5ac7 | |||
7c0d4976b1 | |||
30de2db349 | |||
602641dffd | |||
560cc14d97 | |||
de56dd5f30 | |||
fa5bfe4b64 | |||
446657bdd5 | |||
79830f1c75 | |||
6e1fed42b7 | |||
d35c109cb9 | |||
fad3b6434c | |||
073ec0a7eb | |||
70b23ae2ca | |||
769835e53e | |||
ac55e1e27b |
8
.gitignore
vendored
8
.gitignore
vendored
@ -21,6 +21,11 @@ tmp
|
|||||||
*.js.deps
|
*.js.deps
|
||||||
*.js.map
|
*.js.map
|
||||||
|
|
||||||
|
# Files created by the template compiler
|
||||||
|
**/*.ngfactory.ts
|
||||||
|
**/*.css.ts
|
||||||
|
**/*.css.shim.ts
|
||||||
|
|
||||||
# Or type definitions we mirror from github
|
# Or type definitions we mirror from github
|
||||||
# (NB: these lines are removed in publish-build-artifacts.sh)
|
# (NB: these lines are removed in publish-build-artifacts.sh)
|
||||||
**/typings/**/*.d.ts
|
**/typings/**/*.d.ts
|
||||||
@ -49,3 +54,6 @@ npm-debug.log
|
|||||||
|
|
||||||
# built dart payload tests
|
# built dart payload tests
|
||||||
/modules_dart/payload/**/build
|
/modules_dart/payload/**/build
|
||||||
|
|
||||||
|
# rollup-test output
|
||||||
|
/modules/rollup-test/dist/
|
||||||
|
270
.travis.yml
270
.travis.yml
@ -3,132 +3,190 @@ sudo: false
|
|||||||
node_js:
|
node_js:
|
||||||
- '5.4.1'
|
- '5.4.1'
|
||||||
|
|
||||||
|
addons:
|
||||||
|
# firefox: "38.0"
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
# needed to install g++ that is used by npms's native modules
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
- g3_v2_0
|
- g3_v2_0
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.pub-cache
|
- ./node_modules
|
||||||
- $HOME/.chrome/chromium
|
- ./.chrome/chromium
|
||||||
|
# - $HOME/.pub-cache
|
||||||
|
|
||||||
before_cache:
|
|
||||||
# Undo the pollution of the typescript_next build before the cache is primed for future use
|
#before_cache:
|
||||||
- if [[ "$MODE" == "typescript_next" ]]; then npm install typescript; fi
|
# # Undo the pollution of the typescript_next build before the cache is primed for future use
|
||||||
|
# - if [[ "$MODE" == "typescript_next" ]]; then npm install typescript; fi
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise
|
# - KARMA_JS_BROWSERS=ChromeNoSandbox
|
||||||
# more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements
|
# - E2E_BROWSERS=ChromeOnTravis
|
||||||
- CXX=g++-4.8
|
# - LOGS_DIR=/tmp/angular-build/logs
|
||||||
- KARMA_DART_BROWSERS=DartiumWithWebPlatform
|
# - ARCH=linux-x64
|
||||||
# No sandbox mode is needed for Chromium in Travis, it crashes otherwise: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start
|
|
||||||
- KARMA_JS_BROWSERS=ChromeNoSandbox
|
|
||||||
- E2E_BROWSERS=ChromeOnTravis
|
|
||||||
- LOGS_DIR=/tmp/angular-build/logs
|
|
||||||
- SAUCE_USERNAME=angular-ci
|
|
||||||
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
|
|
||||||
- BROWSER_STACK_USERNAME=angularteam1
|
|
||||||
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
|
|
||||||
- ARCH=linux-x64
|
|
||||||
- DART_DEV_VERSION=latest
|
|
||||||
- DART_STABLE_VERSION=latest
|
|
||||||
- DART_CHANNEL=stable
|
|
||||||
- DART_VERSION=$DART_STABLE_VERSION
|
|
||||||
# Token for tsd to increase github rate limit
|
|
||||||
# See https://github.com/DefinitelyTyped/tsd#tsdrc
|
|
||||||
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
|
|
||||||
# because those are not visible for pull requests, and those should also be reliable.
|
|
||||||
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
|
|
||||||
# (password is in Valentine)
|
|
||||||
- TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
|
|
||||||
# GITHUB_TOKEN_ANGULAR
|
|
||||||
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
|
|
||||||
matrix:
|
matrix:
|
||||||
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||||
- MODE=dart
|
- CI_MODE=js
|
||||||
- MODE=dart DART_CHANNEL=dev
|
- CI_MODE=lint
|
||||||
- MODE=saucelabs_required
|
- CI_MODE=e2e
|
||||||
- MODE=browserstack_required
|
- CI_MODE=saucelabs_required
|
||||||
- MODE=saucelabs_optional
|
- CI_MODE=browserstack_required
|
||||||
- MODE=browserstack_optional
|
|
||||||
- MODE=dart_ddc
|
|
||||||
- MODE=js
|
|
||||||
- MODE=router
|
|
||||||
- MODE=build_only
|
|
||||||
- MODE=typescript_next
|
|
||||||
- MODE=lint
|
|
||||||
|
|
||||||
matrix:
|
#matrix:
|
||||||
allow_failures:
|
# allow_failures:
|
||||||
- env: "MODE=saucelabs_optional"
|
# - env: "MODE=saucelabs_optional"
|
||||||
- env: "MODE=browserstack_optional"
|
# - env: "MODE=browserstack_optional"
|
||||||
|
|
||||||
addons:
|
|
||||||
firefox: "38.0"
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-4.8
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- node tools/analytics/build-analytics start ci job
|
|
||||||
- node tools/analytics/build-analytics start ci before_install
|
|
||||||
- echo ${TSDRC} > .tsdrc
|
|
||||||
- export CHROME_BIN=$HOME/.chrome/chromium/chrome-linux/chrome
|
|
||||||
- export DISPLAY=:99.0
|
|
||||||
- export GIT_SHA=$(git rev-parse HEAD)
|
|
||||||
- ./scripts/ci/init_android.sh
|
|
||||||
- sh -e /etc/init.d/xvfb start
|
|
||||||
# Use a separate SauseLabs account for upstream/master builds in order for Sauce to create a badge representing the status of just upstream/master
|
|
||||||
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true'
|
|
||||||
- node tools/analytics/build-analytics success ci before_install
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- node tools/analytics/build-analytics start ci install
|
- ./scripts/ci-lite/install.sh
|
||||||
# Install version of npm that we are locked against
|
|
||||||
- npm install -g npm@3.5.3
|
|
||||||
# Install version of Chromium that we are locked against
|
|
||||||
- ./scripts/ci/install_chromium.sh
|
|
||||||
# Install version of Dart based on the matrix build variables
|
|
||||||
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH}
|
|
||||||
# Print the size of caches to ease debugging
|
|
||||||
- du -sh ./node_modules || true
|
|
||||||
# Install npm dependecies
|
|
||||||
# check-node-modules will exit(1) if we don't need to install
|
|
||||||
# we need to manually kick off the postinstall script if check-node-modules exit(0)s
|
|
||||||
- node tools/npm/check-node-modules --purge && npm install || npm run postinstall
|
|
||||||
- node tools/analytics/build-analytics success ci install
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- node tools/analytics/build-analytics start ci before_script
|
|
||||||
- mkdir -p $LOGS_DIR
|
|
||||||
- ./scripts/ci/presubmit-queue-setup.sh
|
|
||||||
- node tools/analytics/build-analytics success ci before_script
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- node tools/analytics/build-analytics start ci script
|
- ./scripts/ci-lite/build.sh && ./scripts/ci-lite/test.sh
|
||||||
- ./scripts/ci/build_and_test.sh ${MODE}
|
|
||||||
- node tools/analytics/build-analytics success ci script
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- node tools/analytics/build-analytics start ci after_script
|
- ./scripts/ci-lite/cleanup.sh
|
||||||
- ./scripts/ci/print-logs.sh
|
|
||||||
- ./scripts/ci/after-script.sh
|
|
||||||
- ./scripts/publish/publish-build-artifacts.sh
|
|
||||||
- node tools/analytics/build-analytics success ci after_script
|
|
||||||
- tools/analytics/build-analytics $TRAVIS_TEST_RESULT ci job
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks:
|
#branches:
|
||||||
urls:
|
# except:
|
||||||
- https://webhooks.gitter.im/e/1ef62e23078036f9cee4
|
# - g3_v2_0
|
||||||
# trigger Buildtime Trend Service to parse Travis CI log
|
#
|
||||||
- https://buildtimetrend.herokuapp.com/travis
|
#cache:
|
||||||
- http://104.197.9.155:8484/hubot/travis/activity
|
# directories:
|
||||||
on_success: always # options: [always|never|change] default: always
|
# - $HOME/.pub-cache
|
||||||
on_failure: always # options: [always|never|change] default: always
|
# - $HOME/.chrome/chromium
|
||||||
on_start: never # default: never
|
#
|
||||||
slack:
|
#before_cache:
|
||||||
secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0=
|
# # Undo the pollution of the typescript_next build before the cache is primed for future use
|
||||||
|
# - if [[ "$MODE" == "typescript_next" ]]; then npm install typescript; fi
|
||||||
|
#
|
||||||
|
#env:
|
||||||
|
# global:
|
||||||
|
# # Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise
|
||||||
|
# # more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements
|
||||||
|
# - CXX=g++-4.8
|
||||||
|
# - KARMA_DART_BROWSERS=DartiumWithWebPlatform
|
||||||
|
# # No sandbox mode is needed for Chromium in Travis, it crashes otherwise: https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start
|
||||||
|
# - KARMA_JS_BROWSERS=ChromeNoSandbox
|
||||||
|
# - E2E_BROWSERS=ChromeOnTravis
|
||||||
|
# - LOGS_DIR=/tmp/angular-build/logs
|
||||||
|
# - SAUCE_USERNAME=angular-ci
|
||||||
|
# - SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
|
||||||
|
# - BROWSER_STACK_USERNAME=angularteam1
|
||||||
|
# - BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
|
||||||
|
# - ARCH=linux-x64
|
||||||
|
# - DART_DEV_VERSION=latest
|
||||||
|
# - DART_STABLE_VERSION=latest
|
||||||
|
# - DART_CHANNEL=stable
|
||||||
|
# - DART_VERSION=$DART_STABLE_VERSION
|
||||||
|
# # Token for tsd to increase github rate limit
|
||||||
|
# # See https://github.com/DefinitelyTyped/tsd#tsdrc
|
||||||
|
# # This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
|
||||||
|
# # because those are not visible for pull requests, and those should also be reliable.
|
||||||
|
# # This SSO token belongs to github account angular-github-ratelimit-token which has no access
|
||||||
|
# # (password is in Valentine)
|
||||||
|
# - TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
|
||||||
|
# # GITHUB_TOKEN_ANGULAR
|
||||||
|
# - secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
|
||||||
|
# matrix:
|
||||||
|
# # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||||
|
# - MODE=dart
|
||||||
|
# - MODE=dart DART_CHANNEL=dev
|
||||||
|
# - MODE=saucelabs_required
|
||||||
|
# - MODE=browserstack_required
|
||||||
|
# - MODE=saucelabs_optional
|
||||||
|
# - MODE=browserstack_optional
|
||||||
|
# - MODE=dart_ddc
|
||||||
|
# - MODE=js
|
||||||
|
# - MODE=router
|
||||||
|
# - MODE=build_only
|
||||||
|
# - MODE=typescript_next
|
||||||
|
# - MODE=lint
|
||||||
|
#
|
||||||
|
#matrix:
|
||||||
|
# allow_failures:
|
||||||
|
# - env: "MODE=saucelabs_optional"
|
||||||
|
# - env: "MODE=browserstack_optional"
|
||||||
|
#
|
||||||
|
#addons:
|
||||||
|
# firefox: "38.0"
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# - ubuntu-toolchain-r-test
|
||||||
|
# packages:
|
||||||
|
# - g++-4.8
|
||||||
|
#
|
||||||
|
#before_install:
|
||||||
|
# - node tools/analytics/build-analytics start ci job
|
||||||
|
# - node tools/analytics/build-analytics start ci before_install
|
||||||
|
# - echo ${TSDRC} > .tsdrc
|
||||||
|
# - export CHROME_BIN=$HOME/.chrome/chromium/chrome-linux/chrome
|
||||||
|
# - export DISPLAY=:99.0
|
||||||
|
# - export GIT_SHA=$(git rev-parse HEAD)
|
||||||
|
# - ./scripts/ci/init_android.sh
|
||||||
|
# - sh -e /etc/init.d/xvfb start
|
||||||
|
# # Use a separate SauseLabs account for upstream/master builds in order for Sauce to create a badge representing the status of just upstream/master
|
||||||
|
# - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && SAUCE_USERNAME="angular2-ci" && SAUCE_ACCESS_KEY="693ebc16208a-0b5b-1614-8d66-a2662f4e" || true'
|
||||||
|
# - node tools/analytics/build-analytics success ci before_install
|
||||||
|
#
|
||||||
|
#install:
|
||||||
|
# - node tools/analytics/build-analytics start ci install
|
||||||
|
# # Install version of npm that we are locked against
|
||||||
|
# - npm install -g npm@3.5.3
|
||||||
|
# # Install version of Chromium that we are locked against
|
||||||
|
# - ./scripts/ci/install_chromium.sh
|
||||||
|
# # Install version of Dart based on the matrix build variables
|
||||||
|
# - ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${DART_VERSION} ${ARCH}
|
||||||
|
# # Print the size of caches to ease debugging
|
||||||
|
# - du -sh ./node_modules || true
|
||||||
|
# # Install npm dependecies
|
||||||
|
# # check-node-modules will exit(1) if we don't need to install
|
||||||
|
# # we need to manually kick off the postinstall script if check-node-modules exit(0)s
|
||||||
|
# - node tools/npm/check-node-modules --purge && npm install || npm run postinstall
|
||||||
|
# - node tools/analytics/build-analytics success ci install
|
||||||
|
#
|
||||||
|
#before_script:
|
||||||
|
# - node tools/analytics/build-analytics start ci before_script
|
||||||
|
# - mkdir -p $LOGS_DIR
|
||||||
|
# - ./scripts/ci/presubmit-queue-setup.sh
|
||||||
|
# - node tools/analytics/build-analytics success ci before_script
|
||||||
|
#
|
||||||
|
#script:
|
||||||
|
# - node tools/analytics/build-analytics start ci script
|
||||||
|
# - ./scripts/ci/build_and_test.sh ${MODE}
|
||||||
|
# - node tools/analytics/build-analytics success ci script
|
||||||
|
#
|
||||||
|
#after_script:
|
||||||
|
# - node tools/analytics/build-analytics start ci after_script
|
||||||
|
# - ./scripts/ci/print-logs.sh
|
||||||
|
# - ./scripts/ci/after-script.sh
|
||||||
|
# - ./scripts/publish/publish-build-artifacts.sh
|
||||||
|
# - node tools/analytics/build-analytics success ci after_script
|
||||||
|
# - tools/analytics/build-analytics $TRAVIS_TEST_RESULT ci job
|
||||||
|
#
|
||||||
|
#notifications:
|
||||||
|
# webhooks:
|
||||||
|
# urls:
|
||||||
|
# - https://webhooks.gitter.im/e/1ef62e23078036f9cee4
|
||||||
|
# # trigger Buildtime Trend Service to parse Travis CI log
|
||||||
|
# - https://buildtimetrend.herokuapp.com/travis
|
||||||
|
# - http://104.197.9.155:8484/hubot/travis/activity
|
||||||
|
# on_success: always # options: [always|never|change] default: always
|
||||||
|
# on_failure: always # options: [always|never|change] default: always
|
||||||
|
# on_start: never # default: never
|
||||||
|
# slack:
|
||||||
|
# secure: EP4MzZ8JMyNQJ4S3cd5LEPWSMjC7ZRdzt3veelDiOeorJ6GwZfCDHncR+4BahDzQAuqyE/yNpZqaLbwRWloDi15qIUsm09vgl/1IyNky1Sqc6lEknhzIXpWSalo4/T9ZP8w870EoDvM/UO+LCV99R3wS8Nm9o99eLoWVb2HIUu0=
|
||||||
|
20
CHANGELOG.md
20
CHANGELOG.md
@ -18,12 +18,22 @@
|
|||||||
|
|
||||||
### BREAKING CHANGES
|
### BREAKING CHANGES
|
||||||
|
|
||||||
* - `#...` now always means `ref-`.
|
The reference `#...` now always means `ref-`.
|
||||||
- `<template #abc>` now defines a reference to the TemplateRef, instead of an input variable used inside of the template.
|
|
||||||
- `#...` inside of a *ngIf, … directives is deprecated.
|
|
||||||
Use `let …` instead.
|
|
||||||
- `var-...` is deprecated. Replace with `let-...` for `<template>` elements and `ref-` for non `<template>` elements.
|
|
||||||
|
|
||||||
|
**Before:**
|
||||||
|
- Outside of `ngFor`, a `#...` meant a reference.
|
||||||
|
- Inside of `ngFor`, it meant a local variable.
|
||||||
|
|
||||||
|
This was pattern was confusing.
|
||||||
|
|
||||||
|
**After:**
|
||||||
|
|
||||||
|
- `<template #abc>` now defines a reference to a TemplateRef, instead of an input variable used inside of the template.
|
||||||
|
- Inside of structural directives that declare local variables, such as `*ngFor`, usage of `#...` is deprecated. Use `let` instead.
|
||||||
|
- `<div *ngFor="#item of items">` now becomes `<div *ngFor="let item of items">`
|
||||||
|
- `var-...` is deprecated.
|
||||||
|
- use `#` or a `ref-` outside of `*ngFor`
|
||||||
|
- for `ngFor`, use the syntax: `<template ngFor let-... [ngForOf]="...">`
|
||||||
|
|
||||||
|
|
||||||
<a name="2.0.0-beta.16"></a>
|
<a name="2.0.0-beta.16"></a>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
[](http://issuestats.com/github/angular/angular)
|
[](http://issuestats.com/github/angular/angular)
|
||||||
[](http://badge.fury.io/js/angular2)
|
[](http://badge.fury.io/js/angular2)
|
||||||
[](https://npmjs.org/package/angular2)
|
[](https://npmjs.org/package/angular2)
|
||||||
|
|
||||||
[](https://saucelabs.com/u/angular2-ci)
|
[](https://saucelabs.com/u/angular2-ci)
|
||||||
|
|
||||||
Angular
|
Angular
|
||||||
|
@ -38,7 +38,7 @@ var customLaunchers = {
|
|||||||
'SL_CHROME': {
|
'SL_CHROME': {
|
||||||
base: 'SauceLabs',
|
base: 'SauceLabs',
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
version: '46'
|
version: '50'
|
||||||
},
|
},
|
||||||
'SL_CHROMEBETA': {
|
'SL_CHROMEBETA': {
|
||||||
base: 'SauceLabs',
|
base: 'SauceLabs',
|
||||||
@ -53,7 +53,7 @@ var customLaunchers = {
|
|||||||
'SL_FIREFOX': {
|
'SL_FIREFOX': {
|
||||||
base: 'SauceLabs',
|
base: 'SauceLabs',
|
||||||
browserName: 'firefox',
|
browserName: 'firefox',
|
||||||
version: '42'
|
version: '45'
|
||||||
},
|
},
|
||||||
'SL_FIREFOXBETA': {
|
'SL_FIREFOXBETA': {
|
||||||
base: 'SauceLabs',
|
base: 'SauceLabs',
|
||||||
@ -299,12 +299,7 @@ module.exports = {
|
|||||||
customLaunchers: customLaunchers,
|
customLaunchers: customLaunchers,
|
||||||
sauceAliases: sauceAliases,
|
sauceAliases: sauceAliases,
|
||||||
browserstackAliases: browserstackAliases
|
browserstackAliases: browserstackAliases
|
||||||
}
|
};
|
||||||
|
|
||||||
if (process.env.TRAVIS) {
|
|
||||||
process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY.split('').reverse().join('');
|
|
||||||
process.env.BROWSER_STACK_ACCESS_KEY = process.env.BROWSER_STACK_ACCESS_KEY.split('').reverse().join('');
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildConfiguration(type, target, required) {
|
function buildConfiguration(type, target, required) {
|
||||||
return Object.keys(CIconfiguration)
|
return Object.keys(CIconfiguration)
|
||||||
|
97
build.sh
Executable file
97
build.sh
Executable file
@ -0,0 +1,97 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e -o pipefail
|
||||||
|
|
||||||
|
cd `dirname $0`
|
||||||
|
|
||||||
|
|
||||||
|
TSCONFIG=./modules/tsconfig.json
|
||||||
|
echo "====== (all)COMPILING: \$(npm bin)/ng2tc -p ${TSCONFIG} ====="
|
||||||
|
rm -rf ./dist/all/
|
||||||
|
mkdir ./dist/all/
|
||||||
|
|
||||||
|
# prepare all files for e2e tests
|
||||||
|
cp -r ./modules/playground ./dist/all/
|
||||||
|
cp -r ./modules/playground/favicon.ico ./dist/
|
||||||
|
#rsync -aP ./modules/playground/* ./dist/all/playground/
|
||||||
|
mkdir ./dist/all/playground/vendor
|
||||||
|
cd ./dist/all/playground/vendor
|
||||||
|
ln -s ../../../../node_modules/es6-shim/es6-shim.js .
|
||||||
|
ln -s ../../../../node_modules/zone.js/dist/zone.js .
|
||||||
|
ln -s ../../../../node_modules/zone.js/dist/long-stack-trace-zone.js .
|
||||||
|
ln -s ../../../../node_modules/systemjs/dist/system.src.js .
|
||||||
|
ln -s ../../../../node_modules/base64-js/lib/b64.js .
|
||||||
|
ln -s ../../../../node_modules/reflect-metadata/Reflect.js .
|
||||||
|
ln -s ../../../../node_modules/rxjs/bundles/Rx.js .
|
||||||
|
ln -s ../../../../node_modules/angular/angular.js .
|
||||||
|
cd -
|
||||||
|
|
||||||
|
# compile ts code
|
||||||
|
$(npm bin)/ng2tc -p ${TSCONFIG}
|
||||||
|
|
||||||
|
|
||||||
|
rm -rf ./dist/packages-dist
|
||||||
|
|
||||||
|
for PACKAGE in \
|
||||||
|
core \
|
||||||
|
compiler \
|
||||||
|
common \
|
||||||
|
platform-browser \
|
||||||
|
platform-browser-dynamic \
|
||||||
|
platform-server \
|
||||||
|
http \
|
||||||
|
router \
|
||||||
|
router-deprecated \
|
||||||
|
upgrade
|
||||||
|
do
|
||||||
|
SRCDIR=./modules/@angular/${PACKAGE}
|
||||||
|
DESTDIR=./dist/packages-dist/${PACKAGE}
|
||||||
|
UMDES6PATH=${DESTDIR}/esm/${PACKAGE}.umd.js
|
||||||
|
UMDES5PATH=${DESTDIR}/${PACKAGE}.umd.js
|
||||||
|
|
||||||
|
|
||||||
|
echo "====== COMPILING: \$(npm bin)/ng2tc -p ${SRCDIR}/tsconfig-es5.json ====="
|
||||||
|
$(npm bin)/ng2tc -p ${SRCDIR}/tsconfig-es5.json
|
||||||
|
cp ${SRCDIR}/package.json ${DESTDIR}/
|
||||||
|
|
||||||
|
|
||||||
|
echo "====== TSC 1.8 d.ts compat for ${DESTDIR} ====="
|
||||||
|
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
|
||||||
|
if [[ ${TRAVIS} ]]; then
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
|
||||||
|
else
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "====== (esm)COMPILING: \$(npm bin)/ng2tc -p ${SRCDIR}/tsconfig-es2015.json ====="
|
||||||
|
$(npm bin)/ng2tc -p ${SRCDIR}/tsconfig-es2015.json
|
||||||
|
|
||||||
|
|
||||||
|
echo "====== BUNDLING: ${SRCDIR} ====="
|
||||||
|
(
|
||||||
|
cd ${SRCDIR}
|
||||||
|
echo "..." # here just to have grep match something and not exit with 1
|
||||||
|
../../../node_modules/.bin/rollup -c rollup.config.js
|
||||||
|
) 2>&1 | grep -v "as external dependency"
|
||||||
|
|
||||||
|
# workaround for https://github.com/rollup/rollup/issues/626
|
||||||
|
if [[ ${TRAVIS} ]]; then
|
||||||
|
sed -i "s/ class exports\./ class /g" ${DESTDIR}/esm/${PACKAGE}.umd.js
|
||||||
|
else
|
||||||
|
sed -i '' "s/ class exports\./ class /g" ${DESTDIR}/esm/${PACKAGE}.umd.js
|
||||||
|
fi
|
||||||
|
|
||||||
|
$(npm bin)/tsc \
|
||||||
|
--out ${UMDES5PATH} \
|
||||||
|
--target es5 \
|
||||||
|
--allowJs \
|
||||||
|
${UMDES6PATH} \
|
||||||
|
modules/\@angular/manual_typings/globals.d.ts \
|
||||||
|
modules/\@angular/typings/es6-collections/es6-collections.d.ts \
|
||||||
|
modules/\@angular/typings/es6-promise/es6-promise.d.ts
|
||||||
|
rm ${UMDES6PATH}
|
||||||
|
|
||||||
|
done
|
104
gulpfile.js
104
gulpfile.js
@ -155,6 +155,8 @@ var NG2_BUNDLE_CONTENT = ANGULAR2_BUNDLE_CONFIG.join(' + ') + ' - rxjs/*';
|
|||||||
var HTTP_BUNDLE_CONTENT = 'angular2/http - rxjs/* - ' + ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
var HTTP_BUNDLE_CONTENT = 'angular2/http - rxjs/* - ' + ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
||||||
var ROUTER_BUNDLE_CONTENT = 'angular2/router + angular2/router/router_link_dsl - rxjs/* - ' +
|
var ROUTER_BUNDLE_CONTENT = 'angular2/router + angular2/router/router_link_dsl - rxjs/* - ' +
|
||||||
ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
||||||
|
var ALT_ROUTER_BUNDLE_CONTENT =
|
||||||
|
'angular2/alt_router - rxjs/* - ' + ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
||||||
var TESTING_BUNDLE_CONTENT =
|
var TESTING_BUNDLE_CONTENT =
|
||||||
'angular2/testing + angular2/http/testing + angular2/router/testing + angular2/platform/testing/browser - rxjs/* - ' +
|
'angular2/testing + angular2/http/testing + angular2/router/testing + angular2/platform/testing/browser - rxjs/* - ' +
|
||||||
ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
ANGULAR2_BUNDLE_CONFIG.join(' - ');
|
||||||
@ -298,7 +300,14 @@ function doCheckFormat() {
|
|||||||
var clangFormat = require('clang-format');
|
var clangFormat = require('clang-format');
|
||||||
var gulpFormat = require('gulp-clang-format');
|
var gulpFormat = require('gulp-clang-format');
|
||||||
|
|
||||||
return gulp.src(['modules/**/*.ts', 'tools/**/*.ts', '!**/typings/**/*.d.ts', 'gulpfile.js'])
|
return gulp.src([
|
||||||
|
'modules/**/*.ts',
|
||||||
|
'tools/**/*.ts',
|
||||||
|
'!**/typings/**/*.d.ts',
|
||||||
|
// workaround https://github.com/angular/clang-format/issues/28
|
||||||
|
'!tools/compiler_cli/src/main.ts',
|
||||||
|
'gulpfile.js'
|
||||||
|
])
|
||||||
.pipe(gulpFormat.checkFormat('file', clangFormat));
|
.pipe(gulpFormat.checkFormat('file', clangFormat));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,22 +461,40 @@ gulp.task('serve.e2e.dart', ['build.js.cjs'], function(neverDone) {
|
|||||||
// ------------------
|
// ------------------
|
||||||
// CI tests suites
|
// CI tests suites
|
||||||
|
|
||||||
function runKarma(configFile, done) {
|
function execProcess(name, args, done) {
|
||||||
var exec = require('child_process').exec;
|
var exec = require('child_process').exec;
|
||||||
|
|
||||||
var cmd = process.platform === 'win32' ? 'node_modules\\.bin\\karma run ' :
|
var cmd = process.platform === 'win32' ? 'node_modules\\.bin\\' + name + ' ' :
|
||||||
'node node_modules/.bin/karma run ';
|
'node node_modules/.bin/' + name + ' ';
|
||||||
cmd += configFile;
|
cmd += args;
|
||||||
exec(cmd, function(e, stdout) {
|
exec(cmd, done);
|
||||||
|
}
|
||||||
|
function runKarma(configFile, done) {
|
||||||
|
execProcess('karma', 'run ' + configFile, function(e, stdout) {
|
||||||
// ignore errors, we don't want to fail the build in the interactive (non-ci) mode
|
// ignore errors, we don't want to fail the build in the interactive (non-ci) mode
|
||||||
// karma server will print all test failures
|
// karma server will print all test failures
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gulp-typescript doesn't work with typescript@next:
|
||||||
|
// https://github.com/ivogabe/gulp-typescript/issues/331
|
||||||
|
function runTsc(project, done) {
|
||||||
|
execProcess('tsc', '-p ' + project, function(e, stdout, stderr) {
|
||||||
|
if (e) {
|
||||||
|
console.log(stdout);
|
||||||
|
console.error(stderr);
|
||||||
|
done(e);
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task('test.js', function(done) {
|
gulp.task('test.js', function(done) {
|
||||||
runSequence('test.unit.tools/ci', 'test.transpiler.unittest', 'test.unit.js/ci',
|
runSequence('test.compiler_cli', 'test.unit.tools/ci', 'test.transpiler.unittest',
|
||||||
'test.unit.cjs/ci', 'test.typings', 'check-public-api', sequenceComplete(done));
|
'test.unit.js/ci', 'test.unit.cjs/ci', 'test.typings', 'check-public-api',
|
||||||
|
sequenceComplete(done));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('test.dart', function(done) {
|
gulp.task('test.dart', function(done) {
|
||||||
@ -768,7 +795,7 @@ gulp.task('!checkAndReport.payload.js', function() {
|
|||||||
{
|
{
|
||||||
failConditions: PAYLOAD_TESTS_CONFIG.ts[packaging].sizeLimits,
|
failConditions: PAYLOAD_TESTS_CONFIG.ts[packaging].sizeLimits,
|
||||||
prefix: caseName + '_' + packaging
|
prefix: caseName + '_' + packaging
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return PAYLOAD_TESTS_CONFIG.ts.cases.reduce(function(sizeReportingStreams, caseName) {
|
return PAYLOAD_TESTS_CONFIG.ts.cases.reduce(function(sizeReportingStreams, caseName) {
|
||||||
@ -896,7 +923,7 @@ gulp.task('test.unit.cjs/ci', function(done) {
|
|||||||
runJasmineTests(['dist/js/cjs/{angular2,benchpress}/test/**/*_spec.js'], done);
|
runJasmineTests(['dist/js/cjs/{angular2,benchpress}/test/**/*_spec.js'], done);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('check-public-api',
|
gulp.task('check-public-api', ['build.tools'],
|
||||||
function(done) { runJasmineTests(['dist/tools/public_api_guard/**/*_spec.js'], done); });
|
function(done) { runJasmineTests(['dist/tools/public_api_guard/**/*_spec.js'], done); });
|
||||||
|
|
||||||
gulp.task('test.unit.cjs', ['build/clean.js', 'build.tools'], function(neverDone) {
|
gulp.task('test.unit.cjs', ['build/clean.js', 'build.tools'], function(neverDone) {
|
||||||
@ -1026,6 +1053,43 @@ gulp.task('!test.typings',
|
|||||||
gulp.task('test.typings', ['build.js.cjs'],
|
gulp.task('test.typings', ['build.js.cjs'],
|
||||||
function(done) { runSequence('!test.typings', sequenceComplete(done)); });
|
function(done) { runSequence('!test.typings', sequenceComplete(done)); });
|
||||||
|
|
||||||
|
gulp.task('!build.compiler_cli', function(done) { runTsc('tools/compiler_cli/src', done); });
|
||||||
|
|
||||||
|
gulp.task('!clean.compiler_cli', function(done) {
|
||||||
|
fse.remove(path.join('dist', 'tools', 'compiler_cli', 'test'),
|
||||||
|
fse.remove(path.join('tools', 'compiler_cli', 'test', 'src', '*.ngfactory.ts'),
|
||||||
|
fse.remove(path.join('tools', 'compiler_cli', 'test', 'src', 'a',
|
||||||
|
'*.ngfactory.ts'),
|
||||||
|
done)));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('!test.compiler_cli.codegen', function(done) {
|
||||||
|
try {
|
||||||
|
require('./dist/tools/compiler_cli/main')
|
||||||
|
.main("tools/compiler_cli/test")
|
||||||
|
.then(done)
|
||||||
|
.catch(function(rej) { done(new Error(rej)); });
|
||||||
|
} catch (err) {
|
||||||
|
done(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('!test.compiler_cli.unit',
|
||||||
|
function(done) { runJasmineTests(['dist/tools/compiler_cli/**/*_spec.js'], done) });
|
||||||
|
|
||||||
|
// This task overwrites our careful tsickle-lowered Decorators with normal .js emit.
|
||||||
|
// So it should only be run after asserting on the .js file content.
|
||||||
|
gulp.task('!test.compiler_cli.verify_codegen',
|
||||||
|
function(done) { runTsc('tools/compiler_cli/test', done); });
|
||||||
|
|
||||||
|
// End-to-end test for compiler CLI.
|
||||||
|
// Calls the compiler using its command-line interface, then compiles the app with the codegen.
|
||||||
|
// TODO(alexeagle): wire up the playground tests with offline compilation, similar to dart.
|
||||||
|
gulp.task('test.compiler_cli', ['!build.compiler_cli'], function(done) {
|
||||||
|
runSequence('!clean.compiler_cli', '!test.compiler_cli.codegen', '!test.compiler_cli.unit',
|
||||||
|
'!test.compiler_cli.verify_codegen', sequenceComplete(done));
|
||||||
|
});
|
||||||
|
|
||||||
// -----------------
|
// -----------------
|
||||||
// orchestrated targets
|
// orchestrated targets
|
||||||
|
|
||||||
@ -1091,7 +1155,7 @@ gulp.task('!build.tools', function() {
|
|||||||
var sourcemaps = require('gulp-sourcemaps');
|
var sourcemaps = require('gulp-sourcemaps');
|
||||||
var tsc = require('gulp-typescript');
|
var tsc = require('gulp-typescript');
|
||||||
|
|
||||||
var stream = gulp.src(['tools/**/*.ts'])
|
var stream = gulp.src(['tools/**/*.ts', '!tools/compiler_cli/**'])
|
||||||
.pipe(sourcemaps.init())
|
.pipe(sourcemaps.init())
|
||||||
.pipe(tsc({
|
.pipe(tsc({
|
||||||
target: 'ES5',
|
target: 'ES5',
|
||||||
@ -1197,6 +1261,8 @@ gulp.task('!bundle.js.prod', ['build.js.prod'], function() {
|
|||||||
bundler.bundle(bundleConfig, HTTP_BUNDLE_CONTENT, './dist/build/http.js', bundlerConfig),
|
bundler.bundle(bundleConfig, HTTP_BUNDLE_CONTENT, './dist/build/http.js', bundlerConfig),
|
||||||
bundler.bundle(bundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.js',
|
bundler.bundle(bundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.js',
|
||||||
bundlerConfig),
|
bundlerConfig),
|
||||||
|
bundler.bundle(bundleConfig, ALT_ROUTER_BUNDLE_CONTENT, './dist/build/alt_router.js',
|
||||||
|
bundlerConfig),
|
||||||
bundler.bundle(bundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.js',
|
bundler.bundle(bundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.js',
|
||||||
bundlerConfig)
|
bundlerConfig)
|
||||||
]);
|
]);
|
||||||
@ -1217,6 +1283,8 @@ gulp.task('!bundle.js.min', ['build.js.prod'], function() {
|
|||||||
bundlerConfig),
|
bundlerConfig),
|
||||||
bundler.bundle(bundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.min.js',
|
bundler.bundle(bundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.min.js',
|
||||||
bundlerConfig),
|
bundlerConfig),
|
||||||
|
bundler.bundle(bundleConfig, ALT_ROUTER_BUNDLE_CONTENT, './dist/build/alt_router.min.js',
|
||||||
|
bundlerConfig),
|
||||||
bundler.bundle(bundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.min.js',
|
bundler.bundle(bundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.min.js',
|
||||||
bundlerConfig)
|
bundlerConfig)
|
||||||
]);
|
]);
|
||||||
@ -1239,6 +1307,8 @@ gulp.task('!bundle.js.dev', ['build.js.dev'], function() {
|
|||||||
bundlerConfig),
|
bundlerConfig),
|
||||||
bundler.bundle(devBundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.dev.js',
|
bundler.bundle(devBundleConfig, ROUTER_BUNDLE_CONTENT, './dist/build/router.dev.js',
|
||||||
bundlerConfig),
|
bundlerConfig),
|
||||||
|
bundler.bundle(devBundleConfig, ALT_ROUTER_BUNDLE_CONTENT,
|
||||||
|
'./dist/build/alt_router.dev.js', bundlerConfig),
|
||||||
bundler.bundle(devBundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.dev.js',
|
bundler.bundle(devBundleConfig, UPGRADE_BUNDLE_CONTENT, './dist/build/upgrade.dev.js',
|
||||||
bundlerConfig)
|
bundlerConfig)
|
||||||
]);
|
]);
|
||||||
@ -1359,6 +1429,7 @@ gulp.task('!bundle.js.prod.deps', ['!bundle.js.prod'], function() {
|
|||||||
return merge2(bundler.modify(['dist/build/angular2.js'], 'angular2.js'),
|
return merge2(bundler.modify(['dist/build/angular2.js'], 'angular2.js'),
|
||||||
bundler.modify(['dist/build/http.js'], 'http.js'),
|
bundler.modify(['dist/build/http.js'], 'http.js'),
|
||||||
bundler.modify(['dist/build/router.js'], 'router.js'),
|
bundler.modify(['dist/build/router.js'], 'router.js'),
|
||||||
|
bundler.modify(['dist/build/alt_router.js'], 'alt_router.js'),
|
||||||
bundler.modify(['dist/build/upgrade.js'], 'upgrade.js'))
|
bundler.modify(['dist/build/upgrade.js'], 'upgrade.js'))
|
||||||
.pipe(gulp.dest('dist/js/bundle'));
|
.pipe(gulp.dest('dist/js/bundle'));
|
||||||
});
|
});
|
||||||
@ -1370,6 +1441,7 @@ gulp.task('!bundle.js.min.deps', ['!bundle.js.min'], function() {
|
|||||||
return merge2(bundler.modify(['dist/build/angular2.min.js'], 'angular2.min.js'),
|
return merge2(bundler.modify(['dist/build/angular2.min.js'], 'angular2.min.js'),
|
||||||
bundler.modify(['dist/build/http.min.js'], 'http.min.js'),
|
bundler.modify(['dist/build/http.min.js'], 'http.min.js'),
|
||||||
bundler.modify(['dist/build/router.min.js'], 'router.min.js'),
|
bundler.modify(['dist/build/router.min.js'], 'router.min.js'),
|
||||||
|
bundler.modify(['dist/build/alt_router.min.js'], 'alt_router.min.js'),
|
||||||
bundler.modify(['dist/build/upgrade.min.js'], 'upgrade.min.js'))
|
bundler.modify(['dist/build/upgrade.min.js'], 'upgrade.min.js'))
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
.pipe(gulp.dest('dist/js/bundle'));
|
.pipe(gulp.dest('dist/js/bundle'));
|
||||||
@ -1401,6 +1473,7 @@ gulp.task('!bundle.js.dev.deps', ['!bundle.js.dev'], function() {
|
|||||||
return merge2(bundler.modify(['dist/build/angular2.dev.js'], 'angular2.dev.js'),
|
return merge2(bundler.modify(['dist/build/angular2.dev.js'], 'angular2.dev.js'),
|
||||||
bundler.modify(['dist/build/http.dev.js'], 'http.dev.js'),
|
bundler.modify(['dist/build/http.dev.js'], 'http.dev.js'),
|
||||||
bundler.modify(['dist/build/router.dev.js'], 'router.dev.js'),
|
bundler.modify(['dist/build/router.dev.js'], 'router.dev.js'),
|
||||||
|
bundler.modify(['dist/build/alt_router.dev.js'], 'alt_router.dev.js'),
|
||||||
bundler.modify(['dist/build/upgrade.dev.js'], 'upgrade.dev.js'))
|
bundler.modify(['dist/build/upgrade.dev.js'], 'upgrade.dev.js'))
|
||||||
.pipe(gulp.dest('dist/js/bundle'));
|
.pipe(gulp.dest('dist/js/bundle'));
|
||||||
});
|
});
|
||||||
@ -1506,13 +1579,16 @@ process.on('beforeExit', function() {
|
|||||||
|
|
||||||
|
|
||||||
var firstTask = true;
|
var firstTask = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gulp.on('task_start', (e) => {
|
gulp.on('task_start', (e) => {
|
||||||
if (firstTask) {
|
if (firstTask) {
|
||||||
firstTask = false;
|
firstTask = false;
|
||||||
analytics.buildSuccess('gulp <startup>', process.uptime() * 1000);
|
analytics.buildSuccess('gulp <startup>', process.uptime() * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
analytics.buildStart('gulp ' + e.task)
|
analytics.buildStart('gulp ' + e.task);
|
||||||
});
|
});
|
||||||
gulp.on('task_stop', (e) => {analytics.buildSuccess('gulp ' + e.task, e.duration * 1000)});
|
gulp.on('task_stop', (e) => { analytics.buildSuccess('gulp ' + e.task, e.duration * 1000); });
|
||||||
gulp.on('task_err', (e) => {analytics.buildError('gulp ' + e.task, e.duration * 1000)});
|
gulp.on('task_err', (e) => { analytics.buildError('gulp ' + e.task, e.duration * 1000); });
|
||||||
|
@ -11,7 +11,8 @@ module.exports = function(config) {
|
|||||||
files: [
|
files: [
|
||||||
// Sources and specs.
|
// Sources and specs.
|
||||||
// Loaded through the System loader, in `test-main.js`.
|
// Loaded through the System loader, in `test-main.js`.
|
||||||
{pattern: 'dist/js/dev/es5/**', included: false, watched: false},
|
{pattern: 'dist/all/@angular/**/*.js', included: false, watched: true},
|
||||||
|
{pattern: 'dist/all/angular2/**/*.js', included: false, watched: true},
|
||||||
|
|
||||||
'node_modules/es6-shim/es6-shim.js',
|
'node_modules/es6-shim/es6-shim.js',
|
||||||
// include Angular v1 for upgrade module testing
|
// include Angular v1 for upgrade module testing
|
||||||
@ -24,16 +25,23 @@ module.exports = function(config) {
|
|||||||
'node_modules/zone.js/dist/fake-async-test.js',
|
'node_modules/zone.js/dist/fake-async-test.js',
|
||||||
|
|
||||||
// Including systemjs because it defines `__eval`, which produces correct stack traces.
|
// Including systemjs because it defines `__eval`, which produces correct stack traces.
|
||||||
'modules/angular2/src/testing/shims_for_IE.js',
|
'shims_for_IE.js',
|
||||||
'node_modules/systemjs/dist/system.src.js',
|
'node_modules/systemjs/dist/system.src.js',
|
||||||
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
|
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
|
||||||
'node_modules/reflect-metadata/Reflect.js',
|
'node_modules/reflect-metadata/Reflect.js',
|
||||||
'tools/build/file2modulename.js',
|
'tools/build/file2modulename.js',
|
||||||
'test-main.js',
|
'test-main.js',
|
||||||
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false}
|
{pattern: 'dist/all/empty.*', included: false, watched: false},
|
||||||
|
{pattern: 'modules/@angular/platform-browser/test/static_assets/**', included: false, watched: false},
|
||||||
|
{pattern: 'modules/@angular/platform-browser-dynamic/test/browser/static_assets/**', included: false, watched: false}
|
||||||
],
|
],
|
||||||
|
|
||||||
exclude: ['dist/js/dev/es5/**/e2e_test/**', 'dist/js/dev/es5/angular2/examples/**', 'dist/angular1_router.js'],
|
exclude: [
|
||||||
|
'dist/all/@angular/**/e2e_test/**',
|
||||||
|
'dist/all/@angular/examples/**',
|
||||||
|
'dist/all/angular1_router.js',
|
||||||
|
'dist/all/@angular/platform-browser/testing/e2e_util.js'
|
||||||
|
],
|
||||||
|
|
||||||
customLaunchers: browserProvidersConf.customLaunchers,
|
customLaunchers: browserProvidersConf.customLaunchers,
|
||||||
|
|
||||||
@ -54,6 +62,7 @@ module.exports = function(config) {
|
|||||||
reporters: ['internal-angular'],
|
reporters: ['internal-angular'],
|
||||||
sauceLabs: {
|
sauceLabs: {
|
||||||
testName: 'Angular2',
|
testName: 'Angular2',
|
||||||
|
retryLimit: 3,
|
||||||
startConnect: false,
|
startConnect: false,
|
||||||
recordVideo: false,
|
recordVideo: false,
|
||||||
recordScreenshots: false,
|
recordScreenshots: false,
|
||||||
@ -68,19 +77,23 @@ module.exports = function(config) {
|
|||||||
browserStack: {
|
browserStack: {
|
||||||
project: 'Angular2',
|
project: 'Angular2',
|
||||||
startTunnel: false,
|
startTunnel: false,
|
||||||
retryLimit: 1,
|
retryLimit: 3,
|
||||||
timeout: 600,
|
timeout: 600,
|
||||||
pollingTimeout: 10000
|
pollingTimeout: 10000
|
||||||
},
|
},
|
||||||
|
|
||||||
browsers: ['Chrome'],
|
browsers: ['Chrome'],
|
||||||
|
|
||||||
port: 9876
|
port: 9876,
|
||||||
|
captureTimeout: 60000,
|
||||||
|
browserDisconnectTimeout : 60000,
|
||||||
|
browserDisconnectTolerance : 3,
|
||||||
|
browserNoActivityTimeout : 60000,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.TRAVIS) {
|
if (process.env.TRAVIS) {
|
||||||
var buildId = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
|
var buildId = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
|
||||||
if (process.env.MODE.startsWith('saucelabs')) {
|
if (process.env.CI_MODE.startsWith('saucelabs')) {
|
||||||
config.sauceLabs.build = buildId;
|
config.sauceLabs.build = buildId;
|
||||||
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
|
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
|
||||||
|
|
||||||
@ -90,7 +103,7 @@ module.exports = function(config) {
|
|||||||
config.transports = ['polling'];
|
config.transports = ['polling'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.MODE.startsWith('browserstack')) {
|
if (process.env.CI_MODE.startsWith('browserstack')) {
|
||||||
config.browserStack.build = buildId;
|
config.browserStack.build = buildId;
|
||||||
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
|
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
|
||||||
}
|
}
|
||||||
|
1
modules/@angular/common/common.dart
Normal file
1
modules/@angular/common/common.dart
Normal file
@ -0,0 +1 @@
|
|||||||
|
export 'index.dart';
|
5
modules/@angular/common/index.ts
Normal file
5
modules/@angular/common/index.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export * from './src/pipes';
|
||||||
|
export * from './src/directives';
|
||||||
|
export * from './src/forms';
|
||||||
|
export * from './src/common_directives';
|
||||||
|
export * from './src/location';
|
13
modules/@angular/common/package.json
Normal file
13
modules/@angular/common/package.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "@angular/common",
|
||||||
|
"version": "$$ANGULAR_VERSION$$",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"jsnext:main": "esm/index.js",
|
||||||
|
"typings": "index.d.ts",
|
||||||
|
"author": "angular",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/core": "$$ANGULAR_VERSION$$"
|
||||||
|
}
|
||||||
|
}
|
18
modules/@angular/common/rollup.config.js
Normal file
18
modules/@angular/common/rollup.config.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
export default {
|
||||||
|
entry: '../../../dist/packages-dist/common/esm/index.js',
|
||||||
|
dest: '../../../dist/packages-dist/common/esm/common.umd.js',
|
||||||
|
sourceMap: true,
|
||||||
|
format: 'umd',
|
||||||
|
moduleName: 'ng.common',
|
||||||
|
globals: {
|
||||||
|
'@angular/core': 'ng.core',
|
||||||
|
'rxjs/Subject': 'Rx',
|
||||||
|
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||||
|
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||||
|
'rxjs/Observable': 'Rx'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
// nodeResolve({ jsnext: true, main: true }),
|
||||||
|
]
|
||||||
|
}
|
@ -1,5 +1,4 @@
|
|||||||
import {CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {Type} from '@angular/core';
|
||||||
|
|
||||||
import {FORM_DIRECTIVES} from './forms';
|
import {FORM_DIRECTIVES} from './forms';
|
||||||
import {CORE_DIRECTIVES} from './directives';
|
import {CORE_DIRECTIVES} from './directives';
|
||||||
|
|
||||||
@ -17,7 +16,7 @@ import {CORE_DIRECTIVES} from './directives';
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
|
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
|
||||||
* 'angular2/common';
|
* '@angular/common';
|
||||||
* import {OtherDirective} from './myDirectives';
|
* import {OtherDirective} from './myDirectives';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
@ -33,7 +32,7 @@ import {CORE_DIRECTIVES} from './directives';
|
|||||||
* one could import all the common directives at once:
|
* one could import all the common directives at once:
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import {COMMON_DIRECTIVES} from 'angular2/common';
|
* import {COMMON_DIRECTIVES} from '@angular/common';
|
||||||
* import {OtherDirective} from './myDirectives';
|
* import {OtherDirective} from './myDirectives';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
@ -46,4 +45,4 @@ import {CORE_DIRECTIVES} from './directives';
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const COMMON_DIRECTIVES: Type[][] = CONST_EXPR([CORE_DIRECTIVES, FORM_DIRECTIVES]);
|
export const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/[CORE_DIRECTIVES, FORM_DIRECTIVES];
|
@ -1,4 +1,4 @@
|
|||||||
import {CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {Type} from '../../src/facade/lang';
|
||||||
import {NgClass} from './ng_class';
|
import {NgClass} from './ng_class';
|
||||||
import {NgFor} from './ng_for';
|
import {NgFor} from './ng_for';
|
||||||
import {NgIf} from './ng_if';
|
import {NgIf} from './ng_if';
|
||||||
@ -19,7 +19,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
|
|||||||
* Instead of writing:
|
* Instead of writing:
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/common';
|
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
|
||||||
* import {OtherDirective} from './myDirectives';
|
* import {OtherDirective} from './myDirectives';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
@ -34,7 +34,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
|
|||||||
* one could import all the core directives at once:
|
* one could import all the core directives at once:
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import {CORE_DIRECTIVES} from 'angular2/common';
|
* import {CORE_DIRECTIVES} from '@angular/common';
|
||||||
* import {OtherDirective} from './myDirectives';
|
* import {OtherDirective} from './myDirectives';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
@ -47,7 +47,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
|
export const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||||
NgClass,
|
NgClass,
|
||||||
NgFor,
|
NgFor,
|
||||||
NgIf,
|
NgIf,
|
||||||
@ -58,4 +58,4 @@ export const CORE_DIRECTIVES: Type[] = CONST_EXPR([
|
|||||||
NgSwitchDefault,
|
NgSwitchDefault,
|
||||||
NgPlural,
|
NgPlural,
|
||||||
NgPluralCase
|
NgPluralCase
|
||||||
]);
|
];
|
@ -1,4 +1,3 @@
|
|||||||
import {isPresent, isString, isArray} from 'angular2/src/facade/lang';
|
|
||||||
import {
|
import {
|
||||||
DoCheck,
|
DoCheck,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
@ -11,8 +10,9 @@ import {
|
|||||||
KeyValueDiffer,
|
KeyValueDiffer,
|
||||||
CollectionChangeRecord,
|
CollectionChangeRecord,
|
||||||
KeyValueChangeRecord
|
KeyValueChangeRecord
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {StringMapWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
|
import {isPresent, isString, isArray} from '../../src/facade/lang';
|
||||||
|
import {StringMapWrapper, isListLikeIterable} from '../../src/facade/collection';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `NgClass` directive conditionally adds and removes CSS classes on an HTML element based on
|
* The `NgClass` directive conditionally adds and removes CSS classes on an HTML element based on
|
||||||
@ -33,8 +33,8 @@ import {StringMapWrapper, isListLikeIterable} from 'angular2/src/facade/collecti
|
|||||||
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
|
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component} from 'angular2/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {NgClass} from 'angular2/common';
|
* import {NgClass} from '@angular/common';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
* selector: 'toggle-button',
|
* selector: 'toggle-button',
|
@ -7,14 +7,24 @@ import {
|
|||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
EmbeddedViewRef,
|
EmbeddedViewRef,
|
||||||
TrackByFn
|
TrackByFn,
|
||||||
} from 'angular2/core';
|
|
||||||
import {isPresent, isBlank, stringify, getTypeNameForDebugging} from 'angular2/src/facade/lang';
|
|
||||||
import {
|
|
||||||
DefaultIterableDiffer,
|
DefaultIterableDiffer,
|
||||||
CollectionChangeRecord
|
CollectionChangeRecord
|
||||||
} from "../../core/change_detection/differs/default_iterable_differ";
|
} from '@angular/core';
|
||||||
import {BaseException} from "../../facade/exceptions";
|
import {isPresent, isBlank, getTypeNameForDebugging} from '../../src/facade/lang';
|
||||||
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
|
|
||||||
|
export class NgForRow {
|
||||||
|
constructor(public $implicit: any, public index: number, public count: number) {}
|
||||||
|
|
||||||
|
get first(): boolean { return this.index === 0; }
|
||||||
|
|
||||||
|
get last(): boolean { return this.index === this.count - 1; }
|
||||||
|
|
||||||
|
get even(): boolean { return this.index % 2 === 0; }
|
||||||
|
|
||||||
|
get odd(): boolean { return !this.even; }
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `NgFor` directive instantiates a template once per item from an iterable. The context for
|
* The `NgFor` directive instantiates a template once per item from an iterable. The context for
|
||||||
@ -75,7 +85,7 @@ export class NgFor implements DoCheck {
|
|||||||
_ngForTrackBy: TrackByFn;
|
_ngForTrackBy: TrackByFn;
|
||||||
private _differ: IterableDiffer;
|
private _differ: IterableDiffer;
|
||||||
|
|
||||||
constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef,
|
constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef<NgForRow>,
|
||||||
private _iterableDiffers: IterableDiffers, private _cdr: ChangeDetectorRef) {}
|
private _iterableDiffers: IterableDiffers, private _cdr: ChangeDetectorRef) {}
|
||||||
|
|
||||||
set ngForOf(value: any) {
|
set ngForOf(value: any) {
|
||||||
@ -90,7 +100,7 @@ export class NgFor implements DoCheck {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set ngForTemplate(value: TemplateRef) {
|
set ngForTemplate(value: TemplateRef<NgForRow>) {
|
||||||
if (isPresent(value)) {
|
if (isPresent(value)) {
|
||||||
this._templateRef = value;
|
this._templateRef = value;
|
||||||
}
|
}
|
||||||
@ -127,22 +137,19 @@ export class NgFor implements DoCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) {
|
for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) {
|
||||||
var viewRef = <EmbeddedViewRef>this._viewContainer.get(i);
|
var viewRef = <EmbeddedViewRef<NgForRow>>this._viewContainer.get(i);
|
||||||
viewRef.setLocal('first', i === 0);
|
viewRef.context.index = i;
|
||||||
viewRef.setLocal('last', i === ilen - 1);
|
viewRef.context.count = ilen;
|
||||||
}
|
}
|
||||||
|
|
||||||
changes.forEachIdentityChange((record) => {
|
changes.forEachIdentityChange((record) => {
|
||||||
var viewRef = <EmbeddedViewRef>this._viewContainer.get(record.currentIndex);
|
var viewRef = <EmbeddedViewRef<NgForRow>>this._viewContainer.get(record.currentIndex);
|
||||||
viewRef.setLocal('\$implicit', record.item);
|
viewRef.context.$implicit = record.item;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _perViewChange(view: EmbeddedViewRef, record: CollectionChangeRecord) {
|
private _perViewChange(view: EmbeddedViewRef<NgForRow>, record: CollectionChangeRecord) {
|
||||||
view.setLocal('\$implicit', record.item);
|
view.context.$implicit = record.item;
|
||||||
view.setLocal('index', record.currentIndex);
|
|
||||||
view.setLocal('even', (record.currentIndex % 2 == 0));
|
|
||||||
view.setLocal('odd', (record.currentIndex % 2 == 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _bulkRemove(tuples: RecordViewTuple[]): RecordViewTuple[] {
|
private _bulkRemove(tuples: RecordViewTuple[]): RecordViewTuple[] {
|
||||||
@ -153,7 +160,8 @@ export class NgFor implements DoCheck {
|
|||||||
var tuple = tuples[i];
|
var tuple = tuples[i];
|
||||||
// separate moved views from removed views.
|
// separate moved views from removed views.
|
||||||
if (isPresent(tuple.record.currentIndex)) {
|
if (isPresent(tuple.record.currentIndex)) {
|
||||||
tuple.view = <EmbeddedViewRef>this._viewContainer.detach(tuple.record.previousIndex);
|
tuple.view =
|
||||||
|
<EmbeddedViewRef<NgForRow>>this._viewContainer.detach(tuple.record.previousIndex);
|
||||||
movedTuples.push(tuple);
|
movedTuples.push(tuple);
|
||||||
} else {
|
} else {
|
||||||
this._viewContainer.remove(tuple.record.previousIndex);
|
this._viewContainer.remove(tuple.record.previousIndex);
|
||||||
@ -169,8 +177,8 @@ export class NgFor implements DoCheck {
|
|||||||
if (isPresent(tuple.view)) {
|
if (isPresent(tuple.view)) {
|
||||||
this._viewContainer.insert(tuple.view, tuple.record.currentIndex);
|
this._viewContainer.insert(tuple.view, tuple.record.currentIndex);
|
||||||
} else {
|
} else {
|
||||||
tuple.view =
|
tuple.view = this._viewContainer.createEmbeddedView(
|
||||||
this._viewContainer.createEmbeddedView(this._templateRef, tuple.record.currentIndex);
|
this._templateRef, new NgForRow(null, null, null), tuple.record.currentIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tuples;
|
return tuples;
|
||||||
@ -178,9 +186,9 @@ export class NgFor implements DoCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RecordViewTuple {
|
class RecordViewTuple {
|
||||||
view: EmbeddedViewRef;
|
view: EmbeddedViewRef<NgForRow>;
|
||||||
record: any;
|
record: any;
|
||||||
constructor(record: any, view: EmbeddedViewRef) {
|
constructor(record: any, view: EmbeddedViewRef<NgForRow>) {
|
||||||
this.record = record;
|
this.record = record;
|
||||||
this.view = view;
|
this.view = view;
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import {Directive, ViewContainerRef, TemplateRef} from 'angular2/core';
|
import {Directive, ViewContainerRef, TemplateRef} from '@angular/core';
|
||||||
import {isBlank} from 'angular2/src/facade/lang';
|
import {isBlank} from '../../src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes or recreates a portion of the DOM tree based on an {expression}.
|
* Removes or recreates a portion of the DOM tree based on an {expression}.
|
||||||
@ -27,7 +27,8 @@ import {isBlank} from 'angular2/src/facade/lang';
|
|||||||
export class NgIf {
|
export class NgIf {
|
||||||
private _prevCondition: boolean = null;
|
private _prevCondition: boolean = null;
|
||||||
|
|
||||||
constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef) {}
|
constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef<Object>) {
|
||||||
|
}
|
||||||
|
|
||||||
set ngIf(newCondition: any /* boolean */) {
|
set ngIf(newCondition: any /* boolean */) {
|
||||||
if (newCondition && (isBlank(this._prevCondition) || !this._prevCondition)) {
|
if (newCondition && (isBlank(this._prevCondition) || !this._prevCondition)) {
|
@ -7,9 +7,10 @@ import {
|
|||||||
Attribute,
|
Attribute,
|
||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
Input
|
Input
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {isPresent, NumberWrapper} from 'angular2/src/facade/lang';
|
import {isPresent, NumberWrapper} from '../../src/facade/lang';
|
||||||
import {Map} from 'angular2/src/facade/collection';
|
import {Map} from '../../src/facade/collection';
|
||||||
|
|
||||||
import {SwitchView} from './ng_switch';
|
import {SwitchView} from './ng_switch';
|
||||||
|
|
||||||
const _CATEGORY_DEFAULT = 'other';
|
const _CATEGORY_DEFAULT = 'other';
|
||||||
@ -76,7 +77,7 @@ export abstract class NgLocalization { abstract getPluralCategory(value: any): s
|
|||||||
export class NgPluralCase {
|
export class NgPluralCase {
|
||||||
/** @internal */
|
/** @internal */
|
||||||
_view: SwitchView;
|
_view: SwitchView;
|
||||||
constructor(@Attribute('ngPluralCase') public value: string, template: TemplateRef,
|
constructor(@Attribute('ngPluralCase') public value: string, template: TemplateRef<Object>,
|
||||||
viewContainer: ViewContainerRef) {
|
viewContainer: ViewContainerRef) {
|
||||||
this._view = new SwitchView(viewContainer, template);
|
this._view = new SwitchView(viewContainer, template);
|
||||||
}
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
import {KeyValueChangeRecord} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
DoCheck,
|
DoCheck,
|
||||||
KeyValueDiffer,
|
KeyValueDiffer,
|
||||||
@ -5,9 +6,8 @@ import {
|
|||||||
ElementRef,
|
ElementRef,
|
||||||
Directive,
|
Directive,
|
||||||
Renderer
|
Renderer
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {isPresent, isBlank, print} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank} from '../../src/facade/lang';
|
||||||
import {KeyValueChangeRecord} from "../../core/change_detection/differs/default_keyvalue_differ";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The `NgStyle` directive changes styles based on a result of expression evaluation.
|
* The `NgStyle` directive changes styles based on a result of expression evaluation.
|
||||||
@ -24,8 +24,8 @@ import {KeyValueChangeRecord} from "../../core/change_detection/differs/default_
|
|||||||
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
|
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component} from 'angular2/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {NgStyle} from 'angular2/common';
|
* import {NgStyle} from '@angular/common';
|
||||||
*
|
*
|
||||||
* @Component({
|
* @Component({
|
||||||
* selector: 'ngStyle-example',
|
* selector: 'ngStyle-example',
|
@ -1,11 +1,12 @@
|
|||||||
import {Directive, Host, ViewContainerRef, TemplateRef} from 'angular2/core';
|
import {Directive, Host, ViewContainerRef, TemplateRef} from '@angular/core';
|
||||||
import {isPresent, isBlank, normalizeBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank, normalizeBlank} from '../../src/facade/lang';
|
||||||
import {ListWrapper, Map} from 'angular2/src/facade/collection';
|
import {ListWrapper, Map} from '../../src/facade/collection';
|
||||||
|
|
||||||
const _WHEN_DEFAULT = CONST_EXPR(new Object());
|
const _WHEN_DEFAULT = /*@ts2dart_const*/ new Object();
|
||||||
|
|
||||||
export class SwitchView {
|
export class SwitchView {
|
||||||
constructor(private _viewContainerRef: ViewContainerRef, private _templateRef: TemplateRef) {}
|
constructor(private _viewContainerRef: ViewContainerRef,
|
||||||
|
private _templateRef: TemplateRef<Object>) {}
|
||||||
|
|
||||||
create(): void { this._viewContainerRef.createEmbeddedView(this._templateRef); }
|
create(): void { this._viewContainerRef.createEmbeddedView(this._templateRef); }
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ export class NgSwitchWhen {
|
|||||||
_view: SwitchView;
|
_view: SwitchView;
|
||||||
private _switch: NgSwitch;
|
private _switch: NgSwitch;
|
||||||
|
|
||||||
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef,
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,
|
||||||
@Host() ngSwitch: NgSwitch) {
|
@Host() ngSwitch: NgSwitch) {
|
||||||
this._switch = ngSwitch;
|
this._switch = ngSwitch;
|
||||||
this._view = new SwitchView(viewContainer, templateRef);
|
this._view = new SwitchView(viewContainer, templateRef);
|
||||||
@ -195,7 +196,7 @@ export class NgSwitchWhen {
|
|||||||
*/
|
*/
|
||||||
@Directive({selector: '[ngSwitchDefault]'})
|
@Directive({selector: '[ngSwitchDefault]'})
|
||||||
export class NgSwitchDefault {
|
export class NgSwitchDefault {
|
||||||
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef,
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>,
|
||||||
@Host() sswitch: NgSwitch) {
|
@Host() sswitch: NgSwitch) {
|
||||||
sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef));
|
sswitch._registerView(_WHEN_DEFAULT, new SwitchView(viewContainer, templateRef));
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
import {Directive, Input, ViewContainerRef, ViewRef, TemplateRef} from 'angular2/core';
|
import {Directive, Input, ViewContainerRef, ViewRef, TemplateRef} from '@angular/core';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from '../../src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and inserts an embedded view based on a prepared `TemplateRef`.
|
* Creates and inserts an embedded view based on a prepared `TemplateRef`.
|
||||||
@ -14,7 +14,7 @@ export class NgTemplateOutlet {
|
|||||||
constructor(private _viewContainerRef: ViewContainerRef) {}
|
constructor(private _viewContainerRef: ViewContainerRef) {}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set ngTemplateOutlet(templateRef: TemplateRef) {
|
set ngTemplateOutlet(templateRef: TemplateRef<Object>) {
|
||||||
if (isPresent(this._insertedViewRef)) {
|
if (isPresent(this._insertedViewRef)) {
|
||||||
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._insertedViewRef));
|
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._insertedViewRef));
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
// TS does not have Observables
|
// TS does not have Observables
|
||||||
|
|
||||||
// I need to be here to make TypeScript think this is a module.
|
// I need to be here to make TypeScript think this is a module.
|
||||||
import {} from 'angular2/src/facade/lang';
|
import {} from '../../src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module exists in Dart, but not in Typescript. This exported symbol
|
* This module exists in Dart, but not in Typescript. This exported symbol
|
1
modules/@angular/common/src/facade
Symbolic link
1
modules/@angular/common/src/facade
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../facade/src
|
@ -7,9 +7,8 @@
|
|||||||
* to read information
|
* to read information
|
||||||
* from the form DOM elements.
|
* from the form DOM elements.
|
||||||
*
|
*
|
||||||
* This module is not included in the `angular2` module; you must import the forms module
|
* Forms providers are not included in default providers; you must import these providers
|
||||||
* explicitly.
|
* explicitly.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model';
|
export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model';
|
||||||
|
|
||||||
@ -43,7 +42,7 @@ export {
|
|||||||
export {FormBuilder} from './forms/form_builder';
|
export {FormBuilder} from './forms/form_builder';
|
||||||
import {FormBuilder} from './forms/form_builder';
|
import {FormBuilder} from './forms/form_builder';
|
||||||
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
|
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
|
||||||
import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type} from '@angular/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shorthand set of providers used for building Angular forms.
|
* Shorthand set of providers used for building Angular forms.
|
||||||
@ -54,11 +53,11 @@ import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* bootstrap(MyApp, [FORM_PROVIDERS]);
|
* bootstrap(MyApp, [FORM_PROVIDERS]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const FORM_PROVIDERS: Type[] = CONST_EXPR([FormBuilder, RadioControlRegistry]);
|
export const FORM_PROVIDERS: Type[] = /*@ts2dart_const*/[FormBuilder, RadioControlRegistry];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link FORM_PROVIDERS} instead.
|
* See {@link FORM_PROVIDERS} instead.
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
export const FORM_BINDINGS = FORM_PROVIDERS;
|
export const FORM_BINDINGS = /*@ts2dart_const*/ FORM_PROVIDERS;
|
@ -1,4 +1,4 @@
|
|||||||
import {Type, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {Type} from '@angular/core';
|
||||||
import {NgControlName} from './directives/ng_control_name';
|
import {NgControlName} from './directives/ng_control_name';
|
||||||
import {NgFormControl} from './directives/ng_form_control';
|
import {NgFormControl} from './directives/ng_form_control';
|
||||||
import {NgModel} from './directives/ng_model';
|
import {NgModel} from './directives/ng_model';
|
||||||
@ -64,7 +64,7 @@ export {ControlValueAccessor} from './directives/control_value_accessor';
|
|||||||
* class MyApp {}
|
* class MyApp {}
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
export const FORM_DIRECTIVES: Type[] = /*@ts2dart_const*/[
|
||||||
NgControlName,
|
NgControlName,
|
||||||
NgControlGroup,
|
NgControlGroup,
|
||||||
|
|
||||||
@ -85,4 +85,4 @@ export const FORM_DIRECTIVES: Type[] = CONST_EXPR([
|
|||||||
MinLengthValidator,
|
MinLengthValidator,
|
||||||
MaxLengthValidator,
|
MaxLengthValidator,
|
||||||
PatternValidator
|
PatternValidator
|
||||||
]);
|
];
|
@ -1,6 +1,6 @@
|
|||||||
import {AbstractControl} from '../model';
|
import {AbstractControl} from '../model';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
import {unimplemented} from 'angular2/src/facade/exceptions';
|
import {unimplemented} from '../../../src/facade/exceptions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for control directives.
|
* Base class for control directives.
|
@ -1,10 +1,11 @@
|
|||||||
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, Renderer, ElementRef, Self, forwardRef, Provider} from '@angular/core';
|
||||||
|
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
const CHECKBOX_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const CHECKBOX_VALUE_ACCESSOR: any = /*@ts2dart_const*/ {
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true}));
|
provide: NG_VALUE_ACCESSOR,
|
||||||
|
useExisting: forwardRef(() => CheckboxControlValueAccessor),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The accessor for writing a value and listening to changes on a checkbox input element.
|
* The accessor for writing a value and listening to changes on a checkbox input element.
|
@ -1,5 +1,4 @@
|
|||||||
import {OpaqueToken} from 'angular2/core';
|
import {OpaqueToken} from '@angular/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bridge between a control and a native element.
|
* A bridge between a control and a native element.
|
||||||
@ -31,4 +30,5 @@ export interface ControlValueAccessor {
|
|||||||
*
|
*
|
||||||
* See {@link DefaultValueAccessor} for how to implement one.
|
* See {@link DefaultValueAccessor} for how to implement one.
|
||||||
*/
|
*/
|
||||||
export const NG_VALUE_ACCESSOR: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValueAccessor"));
|
export const NG_VALUE_ACCESSOR: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("NgValueAccessor");
|
@ -1,9 +1,13 @@
|
|||||||
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, ElementRef, Renderer, forwardRef} from '@angular/core';
|
||||||
|
import {isBlank} from '../../../src/facade/lang';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
const DEFAULT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => DefaultValueAccessor), multi: true}));
|
/* @ts2dart_Provider */ {
|
||||||
|
provide: NG_VALUE_ACCESSOR,
|
||||||
|
useExisting: forwardRef(() => DefaultValueAccessor),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default accessor for writing a value and listening to changes that is used by the
|
* The default accessor for writing a value and listening to changes that is used by the
|
@ -1,6 +1,7 @@
|
|||||||
|
import {unimplemented} from '../../../src/facade/exceptions';
|
||||||
|
|
||||||
import {ControlValueAccessor} from './control_value_accessor';
|
import {ControlValueAccessor} from './control_value_accessor';
|
||||||
import {AbstractControlDirective} from './abstract_control_directive';
|
import {AbstractControlDirective} from './abstract_control_directive';
|
||||||
import {unimplemented} from 'angular2/src/facade/exceptions';
|
|
||||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||||
|
|
||||||
/**
|
/**
|
@ -9,9 +9,7 @@ import {
|
|||||||
forwardRef,
|
forwardRef,
|
||||||
Provider,
|
Provider,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
|
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
|
||||||
import {ControlGroup} from '../model';
|
import {ControlGroup} from '../model';
|
||||||
@ -19,8 +17,11 @@ import {Form} from './form_interface';
|
|||||||
import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
import {AsyncValidatorFn, ValidatorFn} from './validators';
|
||||||
|
|
||||||
const controlGroupProvider =
|
export const controlGroupProvider: any =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgControlGroup)}));
|
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||||
|
provide: ControlContainer,
|
||||||
|
useExisting: forwardRef(() => NgControlGroup)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and binds a control group to a DOM element.
|
* Creates and binds a control group to a DOM element.
|
||||||
@ -35,7 +36,7 @@ const controlGroupProvider =
|
|||||||
* directives: [FORM_DIRECTIVES],
|
* directives: [FORM_DIRECTIVES],
|
||||||
* template: `
|
* template: `
|
||||||
* <div>
|
* <div>
|
||||||
* <h2>Angular2 Control & ControlGroup Example</h2>
|
* <h2>Angular Control & ControlGroup Example</h2>
|
||||||
* <form #f="ngForm">
|
* <form #f="ngForm">
|
||||||
* <div ngControlGroup="name" #cg-name="form">
|
* <div ngControlGroup="name" #cg-name="form">
|
||||||
* <h3>Enter your name:</h3>
|
* <h3>Enter your name:</h3>
|
@ -1,6 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
OnChanges,
|
OnChanges,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
@ -14,8 +11,9 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Optional,
|
Optional,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {EventEmitter, ObservableWrapper} from '../../../src/facade/async';
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||||
@ -31,8 +29,11 @@ import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
|||||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
|
|
||||||
const controlNameBinding =
|
export const controlNameBinding: any =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgControlName)}));
|
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||||
|
provide: NgControl,
|
||||||
|
useExisting: forwardRef(() => NgControlName)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and binds a control with a specified name to a DOM element.
|
* Creates and binds a control with a specified name to a DOM element.
|
@ -1,6 +1,6 @@
|
|||||||
import {Directive, Self} from 'angular2/core';
|
import {Directive, Self} from '@angular/core';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {isBlank, isPresent} from 'angular2/src/facade/lang';
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directive automatically applied to Angular forms that sets CSS classes
|
* Directive automatically applied to Angular forms that sets CSS classes
|
@ -1,22 +1,22 @@
|
|||||||
|
import {Directive, forwardRef, Provider, Optional, Inject, Self} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
PromiseWrapper,
|
PromiseWrapper,
|
||||||
ObservableWrapper,
|
ObservableWrapper,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
PromiseCompleter
|
PromiseCompleter
|
||||||
} from 'angular2/src/facade/async';
|
} from '../../../src/facade/async';
|
||||||
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from '../../../src/facade/collection';
|
||||||
import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
import {Directive, forwardRef, Provider, Optional, Inject, Self} from 'angular2/core';
|
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {Form} from './form_interface';
|
import {Form} from './form_interface';
|
||||||
import {NgControlGroup} from './ng_control_group';
|
import {NgControlGroup} from './ng_control_group';
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
import {AbstractControl, ControlGroup, Control} from '../model';
|
import {AbstractControl, ControlGroup, Control} from '../model';
|
||||||
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
||||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
|
|
||||||
const formDirectiveProvider =
|
export const formDirectiveProvider: any =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgForm)}));
|
/*@ts2dart_const*/ {provide: ControlContainer, useExisting: forwardRef(() => NgForm)};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If `NgForm` is bound in a component, `<form>` elements in that component will be
|
* If `NgForm` is bound in a component, `<form>` elements in that component will be
|
@ -1,6 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
|
||||||
import {
|
import {
|
||||||
OnChanges,
|
OnChanges,
|
||||||
SimpleChange,
|
SimpleChange,
|
||||||
@ -11,10 +8,14 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Optional,
|
Optional,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {StringMapWrapper} from '../../../src/facade/collection';
|
||||||
|
import {EventEmitter, ObservableWrapper} from '../../../src/facade/async';
|
||||||
|
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {Control} from '../model';
|
import {Control} from '../model';
|
||||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||||
import {
|
import {
|
||||||
setUpControl,
|
setUpControl,
|
||||||
@ -25,8 +26,11 @@ import {
|
|||||||
} from './shared';
|
} from './shared';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
const formControlBinding =
|
export const formControlBinding: any =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgFormControl)}));
|
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||||
|
provide: NgControl,
|
||||||
|
useExisting: forwardRef(() => NgFormControl)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds an existing {@link Control} to a DOM element.
|
* Binds an existing {@link Control} to a DOM element.
|
@ -1,7 +1,3 @@
|
|||||||
import {CONST_EXPR, isBlank} from 'angular2/src/facade/lang';
|
|
||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
|
||||||
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
|
||||||
import {
|
import {
|
||||||
SimpleChange,
|
SimpleChange,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
@ -11,7 +7,11 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Optional,
|
Optional,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
|
import {isBlank} from '../../../src/facade/lang';
|
||||||
|
import {ListWrapper, StringMapWrapper} from '../../../src/facade/collection';
|
||||||
|
import {BaseException} from '../../../src/facade/exceptions';
|
||||||
|
import {ObservableWrapper, EventEmitter} from '../../../src/facade/async';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {NgControlGroup} from './ng_control_group';
|
import {NgControlGroup} from './ng_control_group';
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
@ -20,8 +20,11 @@ import {Control, ControlGroup} from '../model';
|
|||||||
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
|
||||||
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
|
||||||
|
|
||||||
const formDirectiveProvider =
|
export const formDirectiveProvider: any =
|
||||||
CONST_EXPR(new Provider(ControlContainer, {useExisting: forwardRef(() => NgFormModel)}));
|
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||||
|
provide: ControlContainer,
|
||||||
|
useExisting: forwardRef(() => NgFormModel)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds an existing control group to a DOM element.
|
* Binds an existing control group to a DOM element.
|
@ -1,5 +1,3 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
|
||||||
import {
|
import {
|
||||||
OnChanges,
|
OnChanges,
|
||||||
SimpleChange,
|
SimpleChange,
|
||||||
@ -9,7 +7,8 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Optional,
|
Optional,
|
||||||
Self
|
Self
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
|
import {EventEmitter, ObservableWrapper} from '../../../src/facade/async';
|
||||||
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
import {Control} from '../model';
|
import {Control} from '../model';
|
||||||
@ -23,8 +22,11 @@ import {
|
|||||||
} from './shared';
|
} from './shared';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
import {ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
const formControlBinding =
|
export const formControlBinding: any =
|
||||||
CONST_EXPR(new Provider(NgControl, {useExisting: forwardRef(() => NgModel)}));
|
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
|
||||||
|
provide: NgControl,
|
||||||
|
useExisting: forwardRef(() => NgModel)
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Binds a domain model to a form control.
|
* Binds a domain model to a form control.
|
@ -1,4 +1,4 @@
|
|||||||
import {AbstractControl} from "../model";
|
import {AbstractControl} from '../model';
|
||||||
import {Validator, ValidatorFn, AsyncValidatorFn} from './validators';
|
import {Validator, ValidatorFn, AsyncValidatorFn} from './validators';
|
||||||
|
|
||||||
export function normalizeValidator(validator: ValidatorFn | Validator): ValidatorFn {
|
export function normalizeValidator(validator: ValidatorFn | Validator): ValidatorFn {
|
@ -1,9 +1,12 @@
|
|||||||
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from 'angular2/core';
|
import {Directive, ElementRef, Renderer, Self, forwardRef, Provider} from '@angular/core';
|
||||||
|
import {NumberWrapper} from '../../../src/facade/lang';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
import {isBlank, CONST_EXPR, NumberWrapper} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
const NUMBER_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => NumberValueAccessor), multi: true}));
|
provide: NG_VALUE_ACCESSOR,
|
||||||
|
useExisting: forwardRef(() => NumberValueAccessor),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The accessor for writing a number value and listening to changes that is used by the
|
* The accessor for writing a number value and listening to changes that is used by the
|
@ -2,27 +2,24 @@ import {
|
|||||||
Directive,
|
Directive,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
Renderer,
|
Renderer,
|
||||||
Self,
|
|
||||||
forwardRef,
|
forwardRef,
|
||||||
Provider,
|
Provider,
|
||||||
Attribute,
|
|
||||||
Input,
|
Input,
|
||||||
OnInit,
|
OnInit,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
Injector,
|
Injector,
|
||||||
Injectable
|
Injectable
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
NG_VALUE_ACCESSOR,
|
import {ListWrapper} from '../../../src/facade/collection';
|
||||||
ControlValueAccessor
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
} from 'angular2/src/common/forms/directives/control_value_accessor';
|
import {NgControl} from './ng_control';
|
||||||
import {NgControl} from 'angular2/src/common/forms/directives/ng_control';
|
|
||||||
import {CONST_EXPR, looseIdentical, isPresent} from 'angular2/src/facade/lang';
|
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
|
||||||
|
|
||||||
const RADIO_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => RadioControlValueAccessor), multi: true}));
|
|
||||||
|
|
||||||
|
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
|
provide: NG_VALUE_ACCESSOR,
|
||||||
|
useExisting: forwardRef(() => RadioControlValueAccessor),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal class used by Angular to uncheck radio buttons with the matching name.
|
* Internal class used by Angular to uncheck radio buttons with the matching name.
|
@ -8,21 +8,23 @@ import {
|
|||||||
Host,
|
Host,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
Optional
|
Optional
|
||||||
} from 'angular2/core';
|
} from '@angular/core';
|
||||||
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
|
||||||
import {
|
import {
|
||||||
CONST_EXPR,
|
|
||||||
StringWrapper,
|
StringWrapper,
|
||||||
isPrimitive,
|
isPrimitive,
|
||||||
isPresent,
|
isPresent,
|
||||||
isBlank,
|
isBlank,
|
||||||
looseIdentical
|
looseIdentical
|
||||||
} from 'angular2/src/facade/lang';
|
} from '../../../src/facade/lang';
|
||||||
|
import {MapWrapper} from '../../../src/facade/collection';
|
||||||
|
|
||||||
import {MapWrapper} from 'angular2/src/facade/collection';
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
|
|
||||||
const SELECT_VALUE_ACCESSOR = CONST_EXPR(new Provider(
|
export const SELECT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => SelectControlValueAccessor), multi: true}));
|
provide: NG_VALUE_ACCESSOR,
|
||||||
|
useExisting: forwardRef(() => SelectControlValueAccessor),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
function _buildValueString(id: string, value: any): string {
|
function _buildValueString(id: string, value: any): string {
|
||||||
if (isBlank(id)) return `${value}`;
|
if (isBlank(id)) return `${value}`;
|
@ -1,6 +1,6 @@
|
|||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from '../../../src/facade/collection';
|
||||||
import {isBlank, isPresent, looseIdentical, hasConstructor} from 'angular2/src/facade/lang';
|
import {isBlank, isPresent, looseIdentical, hasConstructor} from '../../../src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from '../../../src/facade/exceptions';
|
||||||
|
|
||||||
import {ControlContainer} from './control_container';
|
import {ControlContainer} from './control_container';
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
@ -1,5 +1,5 @@
|
|||||||
import {forwardRef, Provider, Attribute, Directive} from 'angular2/core';
|
import {forwardRef, Attribute, Directive} from '@angular/core';
|
||||||
import {CONST_EXPR, NumberWrapper} from 'angular2/src/facade/lang';
|
import {NumberWrapper} from '../../facade/lang';
|
||||||
import {Validators, NG_VALIDATORS} from '../validators';
|
import {Validators, NG_VALIDATORS} from '../validators';
|
||||||
import {AbstractControl} from '../model';
|
import {AbstractControl} from '../model';
|
||||||
import * as modelModule from '../model';
|
import * as modelModule from '../model';
|
||||||
@ -25,10 +25,13 @@ import * as modelModule from '../model';
|
|||||||
*/
|
*/
|
||||||
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }
|
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }
|
||||||
|
|
||||||
const REQUIRED = Validators.required;
|
const REQUIRED = /*@ts2dart_const*/ Validators.required;
|
||||||
|
|
||||||
const REQUIRED_VALIDATOR =
|
export const REQUIRED_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
CONST_EXPR(new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true}));
|
provide: NG_VALIDATORS,
|
||||||
|
useValue: REQUIRED,
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Directive that adds the `required` validator to any controls marked with the
|
* A Directive that adds the `required` validator to any controls marked with the
|
||||||
@ -59,8 +62,11 @@ export interface AsyncValidatorFn {
|
|||||||
*
|
*
|
||||||
* {@example common/forms/ts/validators/validators.ts region='min'}
|
* {@example common/forms/ts/validators/validators.ts region='min'}
|
||||||
*/
|
*/
|
||||||
const MIN_LENGTH_VALIDATOR = CONST_EXPR(
|
export const MIN_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MinLengthValidator), multi: true}));
|
provide: NG_VALIDATORS,
|
||||||
|
useExisting: forwardRef(() => MinLengthValidator),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A directive which installs the {@link MinLengthValidator} for any `ngControl`,
|
* A directive which installs the {@link MinLengthValidator} for any `ngControl`,
|
||||||
@ -87,8 +93,11 @@ export class MinLengthValidator implements Validator {
|
|||||||
*
|
*
|
||||||
* {@example common/forms/ts/validators/validators.ts region='max'}
|
* {@example common/forms/ts/validators/validators.ts region='max'}
|
||||||
*/
|
*/
|
||||||
const MAX_LENGTH_VALIDATOR = CONST_EXPR(
|
export const MAX_LENGTH_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => MaxLengthValidator), multi: true}));
|
provide: NG_VALIDATORS,
|
||||||
|
useExisting: forwardRef(() => MaxLengthValidator),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A directive which installs the {@link MaxLengthValidator} for any `ngControl, `ngFormControl`,
|
* A directive which installs the {@link MaxLengthValidator} for any `ngControl, `ngFormControl`,
|
||||||
@ -121,8 +130,11 @@ export class MaxLengthValidator implements Validator {
|
|||||||
* <input [ngControl]="fullName" pattern="[a-zA-Z ]*">
|
* <input [ngControl]="fullName" pattern="[a-zA-Z ]*">
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
const PATTERN_VALIDATOR = CONST_EXPR(
|
export const PATTERN_VALIDATOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
new Provider(NG_VALIDATORS, {useExisting: forwardRef(() => PatternValidator), multi: true}));
|
provide: NG_VALIDATORS,
|
||||||
|
useExisting: forwardRef(() => PatternValidator),
|
||||||
|
multi: true
|
||||||
|
};
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
|
selector: '[pattern][ngControl],[pattern][ngFormControl],[pattern][ngModel]',
|
||||||
providers: [PATTERN_VALIDATOR]
|
providers: [PATTERN_VALIDATOR]
|
@ -1,6 +1,6 @@
|
|||||||
import {Injectable} from 'angular2/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from '../../src/facade/collection';
|
||||||
import {isPresent, isArray, CONST_EXPR, Type} from 'angular2/src/facade/lang';
|
import {isPresent, isArray} from '../../src/facade/lang';
|
||||||
import * as modelModule from './model';
|
import * as modelModule from './model';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import {isPresent, isBlank, normalizeBool} from 'angular2/src/facade/lang';
|
import {isPresent, isBlank, normalizeBool} from '../../src/facade/lang';
|
||||||
import {Observable, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {Observable, EventEmitter, ObservableWrapper} from '../../src/facade/async';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper, ListWrapper} from '../../src/facade/collection';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,9 +1,9 @@
|
|||||||
import {isBlank, isPresent, CONST_EXPR, isString} from 'angular2/src/facade/lang';
|
import {OpaqueToken} from '@angular/core';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
|
||||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
|
||||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
|
|
||||||
import {OpaqueToken} from 'angular2/core';
|
|
||||||
|
|
||||||
|
import {isBlank, isPresent, isString} from '../../src/facade/lang';
|
||||||
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
|
import {ObservableWrapper} from '../../src/facade/async';
|
||||||
|
import {StringMapWrapper} from '../../src/facade/collection';
|
||||||
import * as modelModule from './model';
|
import * as modelModule from './model';
|
||||||
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
|
|||||||
*
|
*
|
||||||
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
* {@example core/forms/ts/ng_validators/ng_validators.ts region='ng_validators'}
|
||||||
*/
|
*/
|
||||||
export const NG_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValidators"));
|
export const NG_VALIDATORS: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken("NgValidators");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Providers for asynchronous validators to be used for {@link Control}s
|
* Providers for asynchronous validators to be used for {@link Control}s
|
||||||
@ -26,7 +26,8 @@ export const NG_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgValidato
|
|||||||
*
|
*
|
||||||
* See {@link NG_VALIDATORS} for more details.
|
* See {@link NG_VALIDATORS} for more details.
|
||||||
*/
|
*/
|
||||||
export const NG_ASYNC_VALIDATORS: OpaqueToken = CONST_EXPR(new OpaqueToken("NgAsyncValidators"));
|
export const NG_ASYNC_VALIDATORS: OpaqueToken =
|
||||||
|
/*@ts2dart_const*/ new OpaqueToken("NgAsyncValidators");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a set of validators used by form controls.
|
* Provides a set of validators used by form controls.
|
5
modules/@angular/common/src/location.ts
Normal file
5
modules/@angular/common/src/location.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export * from './location/platform_location';
|
||||||
|
export * from './location/location_strategy';
|
||||||
|
export * from './location/hash_location_strategy';
|
||||||
|
export * from './location/path_location_strategy';
|
||||||
|
export * from './location/location';
|
@ -1,8 +1,10 @@
|
|||||||
import {Injectable, Inject, Optional} from 'angular2/core';
|
import {Injectable, Inject, Optional} from '@angular/core';
|
||||||
|
import {isPresent} from '../../src/facade/lang';
|
||||||
|
|
||||||
import {LocationStrategy, APP_BASE_HREF} from './location_strategy';
|
import {LocationStrategy, APP_BASE_HREF} from './location_strategy';
|
||||||
import {Location} from './location';
|
import {Location} from './location';
|
||||||
import {UrlChangeListener, PlatformLocation} from './platform_location';
|
import {UrlChangeListener, PlatformLocation} from './platform_location';
|
||||||
import {isPresent} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `HashLocationStrategy` is a {@link LocationStrategy} used to configure the
|
* `HashLocationStrategy` is a {@link LocationStrategy} used to configure the
|
||||||
@ -16,17 +18,17 @@ import {isPresent} from 'angular2/src/facade/lang';
|
|||||||
* ### Example
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component, provide} from 'angular2/core';
|
* import {Component, provide} from '@angular/core';
|
||||||
* import {
|
* import {
|
||||||
* Location,
|
* Location,
|
||||||
* LocationStrategy,
|
* LocationStrategy,
|
||||||
* HashLocationStrategy
|
* HashLocationStrategy
|
||||||
* } from 'angular2/platform/common';
|
* } from '@angular/common';
|
||||||
* import {
|
* import {
|
||||||
* ROUTER_DIRECTIVES,
|
* ROUTER_DIRECTIVES,
|
||||||
* ROUTER_PROVIDERS,
|
* ROUTER_PROVIDERS,
|
||||||
* RouteConfig
|
* RouteConfig
|
||||||
* } from 'angular2/router';
|
* } from '@angular/router';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
@ -1,5 +1,6 @@
|
|||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {Injectable, Inject} from '@angular/core';
|
||||||
import {Injectable, Inject} from 'angular2/core';
|
import {EventEmitter, ObservableWrapper} from '../../src/facade/async';
|
||||||
|
|
||||||
import {LocationStrategy} from './location_strategy';
|
import {LocationStrategy} from './location_strategy';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,13 +22,13 @@ import {LocationStrategy} from './location_strategy';
|
|||||||
* ### Example
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component} from 'angular2/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {Location} from 'angular2/platform/common';
|
* import {Location} from '@angular/common';
|
||||||
* import {
|
* import {
|
||||||
* ROUTER_DIRECTIVES,
|
* ROUTER_DIRECTIVES,
|
||||||
* ROUTER_PROVIDERS,
|
* ROUTER_PROVIDERS,
|
||||||
* RouteConfig
|
* RouteConfig
|
||||||
* } from 'angular2/router';
|
* } from '@angular/router';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
@ -1,5 +1,4 @@
|
|||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
import {OpaqueToken} from '@angular/core';
|
||||||
import {OpaqueToken} from 'angular2/core';
|
|
||||||
import {UrlChangeListener} from './platform_location';
|
import {UrlChangeListener} from './platform_location';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,9 +40,9 @@ export abstract class LocationStrategy {
|
|||||||
* ### Example
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component} from 'angular2/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
|
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from '@angular/router';
|
||||||
* import {APP_BASE_HREF} from 'angular2/platform/common';
|
* import {APP_BASE_HREF} from '@angular/common';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
@ -59,4 +58,4 @@ export abstract class LocationStrategy {
|
|||||||
* ]);
|
* ]);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHref'));
|
export const APP_BASE_HREF: OpaqueToken = /*@ts2dart_const*/ new OpaqueToken('appBaseHref');
|
@ -1,6 +1,7 @@
|
|||||||
import {Injectable, Inject, Optional} from 'angular2/core';
|
import {Injectable, Inject, Optional} from '@angular/core';
|
||||||
import {isBlank} from 'angular2/src/facade/lang';
|
import {isBlank} from '../../src/facade/lang';
|
||||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
|
|
||||||
import {PlatformLocation, UrlChangeListener} from './platform_location';
|
import {PlatformLocation, UrlChangeListener} from './platform_location';
|
||||||
import {LocationStrategy, APP_BASE_HREF} from './location_strategy';
|
import {LocationStrategy, APP_BASE_HREF} from './location_strategy';
|
||||||
import {Location} from './location';
|
import {Location} from './location';
|
||||||
@ -25,17 +26,17 @@ import {Location} from './location';
|
|||||||
* ### Example
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component, provide} from 'angular2/core';
|
* import {Component, provide} from '@angular/core';
|
||||||
* import {bootstrap} from 'angular2/platform/browser';
|
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||||
* import {
|
* import {
|
||||||
* Location,
|
* Location,
|
||||||
* APP_BASE_HREF
|
* APP_BASE_HREF
|
||||||
* } from 'angular2/platform/common';
|
* } from '@angular/common';
|
||||||
* import {
|
* import {
|
||||||
* ROUTER_DIRECTIVES,
|
* ROUTER_DIRECTIVES,
|
||||||
* ROUTER_PROVIDERS,
|
* ROUTER_PROVIDERS,
|
||||||
* RouteConfig
|
* RouteConfig
|
||||||
* } from 'angular2/router';
|
* } from '@angular/router';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
@ -1,6 +1,7 @@
|
|||||||
import {isBlank, isPresent, isPromise, CONST} from 'angular2/src/facade/lang';
|
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from '@angular/core';
|
||||||
import {ObservableWrapper, Observable, EventEmitter} from 'angular2/src/facade/async';
|
|
||||||
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from 'angular2/core';
|
import {isBlank, isPresent, isPromise} from '../../src/facade/lang';
|
||||||
|
import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async';
|
||||||
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
@ -13,7 +13,6 @@ import {DecimalPipe, PercentPipe, CurrencyPipe} from './number_pipe';
|
|||||||
import {ReplacePipe} from './replace_pipe';
|
import {ReplacePipe} from './replace_pipe';
|
||||||
import {I18nPluralPipe} from './i18n_plural_pipe';
|
import {I18nPluralPipe} from './i18n_plural_pipe';
|
||||||
import {I18nSelectPipe} from './i18n_select_pipe';
|
import {I18nSelectPipe} from './i18n_select_pipe';
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of Angular core pipes that are likely to be used in each and every
|
* A collection of Angular core pipes that are likely to be used in each and every
|
||||||
@ -22,7 +21,7 @@ import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|||||||
* This collection can be used to quickly enumerate all the built-in pipes in the `pipes`
|
* This collection can be used to quickly enumerate all the built-in pipes in the `pipes`
|
||||||
* property of the `@Component` decorator.
|
* property of the `@Component` decorator.
|
||||||
*/
|
*/
|
||||||
export const COMMON_PIPES = CONST_EXPR([
|
export const COMMON_PIPES = /*@ts2dart_const*/[
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
UpperCasePipe,
|
UpperCasePipe,
|
||||||
LowerCasePipe,
|
LowerCasePipe,
|
||||||
@ -35,4 +34,4 @@ export const COMMON_PIPES = CONST_EXPR([
|
|||||||
ReplacePipe,
|
ReplacePipe,
|
||||||
I18nPluralPipe,
|
I18nPluralPipe,
|
||||||
I18nSelectPipe
|
I18nSelectPipe
|
||||||
]);
|
];
|
@ -1,16 +1,12 @@
|
|||||||
|
import {PipeTransform, Pipe, Injectable} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
isDate,
|
isDate,
|
||||||
isNumber,
|
isNumber,
|
||||||
isPresent,
|
|
||||||
Date,
|
|
||||||
DateWrapper,
|
DateWrapper,
|
||||||
CONST,
|
|
||||||
isBlank,
|
isBlank,
|
||||||
FunctionWrapper
|
} from '../../src/facade/lang';
|
||||||
} from 'angular2/src/facade/lang';
|
import {DateFormatter} from '../../src/facade/intl';
|
||||||
import {DateFormatter} from 'angular2/src/facade/intl';
|
import {StringMapWrapper} from '../../src/facade/collection';
|
||||||
import {PipeTransform, WrappedValue, Pipe, Injectable} from 'angular2/core';
|
|
||||||
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
|
||||||
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
@ -84,7 +80,6 @@ var defaultLocale: string = 'en-US';
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/date_pipe/date_pipe_example.ts region='DatePipe'}
|
* {@example core/pipes/ts/date_pipe/date_pipe_example.ts region='DatePipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'date', pure: true})
|
@Pipe({name: 'date', pure: true})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DatePipe implements PipeTransform {
|
export class DatePipe implements PipeTransform {
|
@ -1,11 +1,5 @@
|
|||||||
import {
|
import {Injectable, PipeTransform, Pipe} from '@angular/core';
|
||||||
CONST,
|
import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from '../../src/facade/lang';
|
||||||
isStringMap,
|
|
||||||
StringWrapper,
|
|
||||||
isPresent,
|
|
||||||
RegExpWrapper
|
|
||||||
} from 'angular2/src/facade/lang';
|
|
||||||
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
var interpolationExp: RegExp = RegExpWrapper.create('#');
|
var interpolationExp: RegExp = RegExpWrapper.create('#');
|
||||||
@ -41,7 +35,6 @@ var interpolationExp: RegExp = RegExpWrapper.create('#');
|
|||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'i18nPlural', pure: true})
|
@Pipe({name: 'i18nPlural', pure: true})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class I18nPluralPipe implements PipeTransform {
|
export class I18nPluralPipe implements PipeTransform {
|
@ -1,6 +1,6 @@
|
|||||||
import {CONST, isStringMap} from 'angular2/src/facade/lang';
|
import {Injectable, PipeTransform, Pipe} from '@angular/core';
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {isStringMap} from '../../src/facade/lang';
|
||||||
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
|
import {StringMapWrapper} from '../../src/facade/collection';
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +32,6 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
|||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'i18nSelect', pure: true})
|
@Pipe({name: 'i18nSelect', pure: true})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class I18nSelectPipe implements PipeTransform {
|
export class I18nSelectPipe implements PipeTransform {
|
@ -1,5 +1,5 @@
|
|||||||
import {CONST, Type, stringify} from 'angular2/src/facade/lang';
|
import {Type, stringify} from '../../src/facade/lang';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
|
|
||||||
export class InvalidPipeArgumentException extends BaseException {
|
export class InvalidPipeArgumentException extends BaseException {
|
||||||
constructor(type: Type, value: Object) {
|
constructor(type: Type, value: Object) {
|
@ -1,5 +1,6 @@
|
|||||||
import {isBlank, isPresent, Json, CONST} from 'angular2/src/facade/lang';
|
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
|
||||||
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
|
import {Json} from '../../src/facade/lang';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms any input value using `JSON.stringify`. Useful for debugging.
|
* Transforms any input value using `JSON.stringify`. Useful for debugging.
|
||||||
@ -7,7 +8,7 @@ import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
|
|||||||
* ### Example
|
* ### Example
|
||||||
* {@example core/pipes/ts/json_pipe/json_pipe_example.ts region='JsonPipe'}
|
* {@example core/pipes/ts/json_pipe/json_pipe_example.ts region='JsonPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
/* @ts2dart_const */
|
||||||
@Pipe({name: 'json', pure: false})
|
@Pipe({name: 'json', pure: false})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class JsonPipe implements PipeTransform {
|
export class JsonPipe implements PipeTransform {
|
@ -1,5 +1,5 @@
|
|||||||
import {isString, CONST, isBlank} from 'angular2/src/facade/lang';
|
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
|
||||||
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
|
import {isString, isBlank} from '../../src/facade/lang';
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,7 +9,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
|
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
/* @ts2dart_const */
|
||||||
@Pipe({name: 'lowercase'})
|
@Pipe({name: 'lowercase'})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LowerCasePipe implements PipeTransform {
|
export class LowerCasePipe implements PipeTransform {
|
@ -1,16 +1,15 @@
|
|||||||
|
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isNumber,
|
isNumber,
|
||||||
isPresent,
|
isPresent,
|
||||||
isBlank,
|
isBlank,
|
||||||
StringWrapper,
|
|
||||||
NumberWrapper,
|
NumberWrapper,
|
||||||
RegExpWrapper,
|
RegExpWrapper,
|
||||||
CONST,
|
} from '../../src/facade/lang';
|
||||||
FunctionWrapper
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
} from 'angular2/src/facade/lang';
|
import {NumberFormatter, NumberFormatStyle} from '../../src/facade/intl';
|
||||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
import {ListWrapper} from '../../src/facade/collection';
|
||||||
import {NumberFormatter, NumberFormatStyle} from 'angular2/src/facade/intl';
|
|
||||||
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
|
|
||||||
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
@ -20,7 +19,6 @@ var _re = RegExpWrapper.create('^(\\d+)?\\.((\\d+)(\\-(\\d+))?)?$');
|
|||||||
/**
|
/**
|
||||||
* Internal base class for numeric pipes.
|
* Internal base class for numeric pipes.
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class NumberPipe {
|
export class NumberPipe {
|
||||||
/** @internal */
|
/** @internal */
|
||||||
@ -82,7 +80,6 @@ export class NumberPipe {
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='NumberPipe'}
|
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='NumberPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'number'})
|
@Pipe({name: 'number'})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DecimalPipe extends NumberPipe implements PipeTransform {
|
export class DecimalPipe extends NumberPipe implements PipeTransform {
|
||||||
@ -107,7 +104,6 @@ export class DecimalPipe extends NumberPipe implements PipeTransform {
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='PercentPipe'}
|
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='PercentPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'percent'})
|
@Pipe({name: 'percent'})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PercentPipe extends NumberPipe implements PipeTransform {
|
export class PercentPipe extends NumberPipe implements PipeTransform {
|
||||||
@ -136,7 +132,6 @@ export class PercentPipe extends NumberPipe implements PipeTransform {
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='CurrencyPipe'}
|
* {@example core/pipes/ts/number_pipe/number_pipe_example.ts region='CurrencyPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'currency'})
|
@Pipe({name: 'currency'})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CurrencyPipe extends NumberPipe implements PipeTransform {
|
export class CurrencyPipe extends NumberPipe implements PipeTransform {
|
@ -1,3 +1,5 @@
|
|||||||
|
import {Injectable, PipeTransform, Pipe} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isBlank,
|
isBlank,
|
||||||
isString,
|
isString,
|
||||||
@ -5,8 +7,8 @@ import {
|
|||||||
isFunction,
|
isFunction,
|
||||||
RegExpWrapper,
|
RegExpWrapper,
|
||||||
StringWrapper
|
StringWrapper
|
||||||
} from 'angular2/src/facade/lang';
|
} from '../../src/facade/lang';
|
||||||
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,6 +1,9 @@
|
|||||||
import {isBlank, isString, isArray, StringWrapper, CONST} from 'angular2/src/facade/lang';
|
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
|
||||||
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
|
import {isBlank, isString, isArray, StringWrapper} from '../../src/facade/lang';
|
||||||
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
|
import {ListWrapper} from '../../src/facade/collection';
|
||||||
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,5 +1,5 @@
|
|||||||
import {isString, CONST, isBlank} from 'angular2/src/facade/lang';
|
import {PipeTransform, WrappedValue, Injectable, Pipe} from '@angular/core';
|
||||||
import {PipeTransform, WrappedValue, Injectable, Pipe} from 'angular2/core';
|
import {isString, isBlank} from '../../src/facade/lang';
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,7 +9,6 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
|||||||
*
|
*
|
||||||
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
|
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
|
||||||
*/
|
*/
|
||||||
@CONST()
|
|
||||||
@Pipe({name: 'uppercase'})
|
@Pipe({name: 'uppercase'})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UpperCasePipe implements PipeTransform {
|
export class UpperCasePipe implements PipeTransform {
|
@ -1,25 +1,22 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {ListWrapper, StringMapWrapper, SetWrapper} from 'angular2/src/facade/collection';
|
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
|
||||||
import {Component, provide} from 'angular2/core';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {NgFor} from 'angular2/common';
|
import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection';
|
||||||
import {NgClass} from 'angular2/src/common/directives/ng_class';
|
import {Component, provide} from '@angular/core';
|
||||||
|
import {NgFor, NgClass} from '@angular/common';
|
||||||
|
|
||||||
function detectChangesAndCheck(fixture: ComponentFixture, classes: string) {
|
function detectChangesAndCheck(fixture: ComponentFixture<any>, classes: string) {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(fixture.debugElement.children[0].nativeElement.className).toEqual(classes);
|
expect(fixture.debugElement.children[0].nativeElement.className).toEqual(classes);
|
||||||
}
|
}
|
@ -1,24 +1,23 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {expect} from '@angular/platform-browser/testing';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {ListWrapper} from '../../src/facade/collection';
|
||||||
import {IS_DART} from 'angular2/src/facade/lang';
|
import {IS_DART} from '../../src/facade/lang';
|
||||||
import {Component, TemplateRef, ContentChild} from 'angular2/core';
|
import {Component, TemplateRef, ContentChild} from '@angular/core';
|
||||||
import {NgFor} from 'angular2/src/common/directives/ng_for';
|
import {NgFor} from '@angular/common';
|
||||||
import {NgIf} from 'angular2/src/common/directives/ng_if';
|
import {NgIf} from '@angular/common';
|
||||||
import {By} from 'angular2/platform/common_dom';
|
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('ngFor', () => {
|
describe('ngFor', () => {
|
||||||
@ -512,7 +511,7 @@ class Foo {
|
|||||||
|
|
||||||
@Component({selector: 'test-cmp', directives: [NgFor, NgIf], template: ''})
|
@Component({selector: 'test-cmp', directives: [NgFor, NgIf], template: ''})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
@ContentChild(TemplateRef) contentTpl: TemplateRef;
|
@ContentChild(TemplateRef) contentTpl: TemplateRef<Object>;
|
||||||
items: any;
|
items: any;
|
||||||
constructor() { this.items = [1, 2]; }
|
constructor() { this.items = [1, 2]; }
|
||||||
trackById(index: number, item: any): string { return item['id']; }
|
trackById(index: number, item: any): string { return item['id']; }
|
@ -1,23 +1,22 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {expect} from '@angular/platform-browser/testing';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {Component} from '@angular/core';
|
||||||
import {NgIf} from 'angular2/common';
|
import {NgIf} from '@angular/common';
|
||||||
|
|
||||||
import {IS_DART} from 'angular2/src/facade/lang';
|
import {IS_DART} from '../../src/facade/lang';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('ngIf directive', () => {
|
describe('ngIf directive', () => {
|
||||||
@ -29,7 +28,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
async.done();
|
async.done();
|
||||||
@ -45,7 +45,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
|
||||||
async.done();
|
async.done();
|
||||||
@ -61,19 +62,22 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = true;
|
fixture.debugElement.componentInstance.booleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
@ -91,31 +95,36 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = true;
|
fixture.debugElement.componentInstance.booleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
|
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
|
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
@ -136,21 +145,24 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(3);
|
.toEqual(3);
|
||||||
expect(DOM.getText(fixture.debugElement.nativeElement))
|
expect(getDOM().getText(fixture.debugElement.nativeElement))
|
||||||
.toEqual('helloNumberhelloStringhelloFunction');
|
.toEqual('helloNumberhelloStringhelloFunction');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 0;
|
fixture.debugElement.componentInstance.numberCondition = 0;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
|
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 1;
|
fixture.debugElement.componentInstance.numberCondition = 1;
|
||||||
fixture.debugElement.componentInstance.stringCondition = "bar";
|
fixture.debugElement.componentInstance.stringCondition = "bar";
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
|
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
|
||||||
async.done();
|
async.done();
|
||||||
@ -167,13 +179,17 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 2;
|
fixture.debugElement.componentInstance.numberCondition = 2;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
@ -189,14 +205,14 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
DOM.addClass(DOM.querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
getDOM().addClass(
|
||||||
"foo");
|
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), "foo");
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 2;
|
fixture.debugElement.componentInstance.numberCondition = 2;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(
|
expect(getDOM().hasClass(
|
||||||
DOM.hasClass(DOM.querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
||||||
"foo"))
|
"foo"))
|
||||||
.toBe(true);
|
.toBe(true);
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -213,7 +229,9 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
expect(() => fixture.detectChanges()).toThrowError();
|
expect(() => fixture.detectChanges()).toThrowError();
|
||||||
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
async.done();
|
async.done();
|
@ -1,20 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
|
||||||
import {Component, Injectable, provide} from 'angular2/core';
|
import {Component, Injectable, provide} from '@angular/core';
|
||||||
import {NgPlural, NgPluralCase, NgLocalization} from 'angular2/common';
|
import {NgPlural, NgPluralCase, NgLocalization} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('switch', () => {
|
describe('switch', () => {
|
@ -1,25 +1,24 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
import {StringMapWrapper} from '../../src/facade/collection';
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {NgStyle} from 'angular2/src/common/directives/ng_style';
|
import {NgStyle} from '@angular/common/src/directives/ng_style';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('binding to CSS styles', () => {
|
describe('binding to CSS styles', () => {
|
||||||
@ -32,7 +31,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -50,13 +50,15 @@ export function main() {
|
|||||||
|
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
expr = fixture.debugElement.componentInstance.expr;
|
expr = fixture.debugElement.componentInstance.expr;
|
||||||
expr['max-width'] = '30%';
|
expr['max-width'] = '30%';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('30%');
|
.toEqual('30%');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -72,12 +74,14 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -93,16 +97,20 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -118,17 +126,21 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
@ -1,20 +1,18 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
import {Component} from '@angular/core';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
|
||||||
|
|
||||||
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/src/common/directives/ng_switch';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('switch', () => {
|
describe('switch', () => {
|
@ -1,20 +1,17 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
import {Component, Directive, TemplateRef, ContentChildren, QueryList} from 'angular2/core';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
import {Component, Directive, TemplateRef, ContentChildren, QueryList} from '@angular/core';
|
||||||
import {NgTemplateOutlet} from 'angular2/src/common/directives/ng_template_outlet';
|
import {NgTemplateOutlet} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('insert', () => {
|
describe('insert', () => {
|
||||||
@ -43,7 +40,7 @@ export function main() {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(fixture.nativeElement).toHaveText('');
|
expect(fixture.nativeElement).toHaveText('');
|
||||||
|
|
||||||
var refs = fixture.debugElement.children[0].getLocal('refs');
|
var refs = fixture.debugElement.children[0].references['refs'];
|
||||||
|
|
||||||
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -62,7 +59,7 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
var refs = fixture.debugElement.children[0].getLocal('refs');
|
var refs = fixture.debugElement.children[0].references['refs'];
|
||||||
|
|
||||||
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -84,7 +81,7 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
var refs = fixture.debugElement.children[0].getLocal('refs');
|
var refs = fixture.debugElement.children[0].references['refs'];
|
||||||
|
|
||||||
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
fixture.componentInstance.currentTplRef = refs.tplRefs.first;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -104,10 +101,10 @@ export function main() {
|
|||||||
|
|
||||||
@Directive({selector: 'tpl-refs', exportAs: 'tplRefs'})
|
@Directive({selector: 'tpl-refs', exportAs: 'tplRefs'})
|
||||||
class CaptureTplRefs {
|
class CaptureTplRefs {
|
||||||
@ContentChildren(TemplateRef) tplRefs: QueryList<TemplateRef>;
|
@ContentChildren(TemplateRef) tplRefs: QueryList<TemplateRef<any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({selector: 'test-cmp', directives: [NgTemplateOutlet, CaptureTplRefs], template: ''})
|
@Component({selector: 'test-cmp', directives: [NgTemplateOutlet, CaptureTplRefs], template: ''})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
currentTplRef: TemplateRef;
|
currentTplRef: TemplateRef<any>;
|
||||||
}
|
}
|
@ -1,19 +1,18 @@
|
|||||||
import {
|
import {
|
||||||
AsyncTestCompleter,
|
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
import {Component, Directive} from 'angular2/core';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {ElementRef} from 'angular2/src/core/linker/element_ref';
|
import {Component, Directive} from '@angular/core';
|
||||||
|
import {ElementRef} from '@angular/core/src/linker/element_ref';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('non-bindable', () => {
|
describe('non-bindable', () => {
|
||||||
@ -37,10 +36,10 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
// We must use DOM.querySelector instead of fixture.query here
|
// We must use getDOM().querySelector instead of fixture.query here
|
||||||
// since the elements inside are not compiled.
|
// since the elements inside are not compiled.
|
||||||
var span = DOM.querySelector(fixture.debugElement.nativeElement, '#child');
|
var span = getDOM().querySelector(fixture.debugElement.nativeElement, '#child');
|
||||||
expect(DOM.hasClass(span, 'compiled')).toBeFalsy();
|
expect(getDOM().hasClass(span, 'compiled')).toBeFalsy();
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
@ -52,8 +51,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
var span = DOM.querySelector(fixture.debugElement.nativeElement, '#child');
|
var span = getDOM().querySelector(fixture.debugElement.nativeElement, '#child');
|
||||||
expect(DOM.hasClass(span, 'compiled')).toBeTruthy();
|
expect(getDOM().hasClass(span, 'compiled')).toBeTruthy();
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
@ -62,7 +61,7 @@ export function main() {
|
|||||||
|
|
||||||
@Directive({selector: '[test-dec]'})
|
@Directive({selector: '[test-dec]'})
|
||||||
class TestDirective {
|
class TestDirective {
|
||||||
constructor(el: ElementRef) { DOM.addClass(el.nativeElement, 'compiled'); }
|
constructor(el: ElementRef) { getDOM().addClass(el.nativeElement, 'compiled'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({selector: 'test-cmp', directives: [TestDirective], template: ''})
|
@Component({selector: 'test-cmp', directives: [TestDirective], template: ''})
|
@ -1,19 +1,21 @@
|
|||||||
import {
|
import {
|
||||||
ddescribe,
|
ddescribe,
|
||||||
describe,
|
describe,
|
||||||
fakeAsync,
|
|
||||||
flushMicrotasks,
|
|
||||||
it,
|
it,
|
||||||
iit,
|
iit,
|
||||||
xit,
|
xit,
|
||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
el,
|
inject
|
||||||
AsyncTestCompleter,
|
} from '@angular/core/testing/testing_internal';
|
||||||
inject,
|
|
||||||
tick
|
import {
|
||||||
} from 'angular2/testing_internal';
|
fakeAsync,
|
||||||
|
flushMicrotasks,
|
||||||
|
Log,
|
||||||
|
tick,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
import {SpyNgControl, SpyValueAccessor} from '../spies';
|
import {SpyNgControl, SpyValueAccessor} from '../spies';
|
||||||
|
|
||||||
@ -33,13 +35,13 @@ import {
|
|||||||
CheckboxControlValueAccessor,
|
CheckboxControlValueAccessor,
|
||||||
SelectControlValueAccessor,
|
SelectControlValueAccessor,
|
||||||
Validator
|
Validator
|
||||||
} from 'angular2/common';
|
} from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
import {selectValueAccessor, composeValidators} from 'angular2/src/common/forms/directives/shared';
|
import {selectValueAccessor, composeValidators} from '@angular/common/src/forms/directives/shared';
|
||||||
import {TimerWrapper} from 'angular2/src/facade/async';
|
import {TimerWrapper} from '../../src/facade/async';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {SimpleChange} from 'angular2/src/core/change_detection';
|
import {SimpleChange} from '@angular/core/src/change_detection';
|
||||||
|
|
||||||
class DummyControlValueAccessor implements ControlValueAccessor {
|
class DummyControlValueAccessor implements ControlValueAccessor {
|
||||||
writtenValue;
|
writtenValue;
|
||||||
@ -69,7 +71,7 @@ function asyncValidator(expected, timeout = 0) {
|
|||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("Form Directives", () => {
|
describe("Form Directives", () => {
|
||||||
var defaultAccessor;
|
var defaultAccessor: DefaultValueAccessor;
|
||||||
|
|
||||||
beforeEach(() => { defaultAccessor = new DefaultValueAccessor(null, null); });
|
beforeEach(() => { defaultAccessor = new DefaultValueAccessor(null, null); });
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ export function main() {
|
|||||||
it("should return custom accessor when provided", () => {
|
it("should return custom accessor when provided", () => {
|
||||||
var customAccessor = new SpyValueAccessor();
|
var customAccessor = new SpyValueAccessor();
|
||||||
var checkboxAccessor = new CheckboxControlValueAccessor(null, null);
|
var checkboxAccessor = new CheckboxControlValueAccessor(null, null);
|
||||||
expect(selectValueAccessor(dir, [defaultAccessor, customAccessor, checkboxAccessor]))
|
expect(selectValueAccessor(dir, <any>[defaultAccessor, customAccessor, checkboxAccessor]))
|
||||||
.toEqual(customAccessor);
|
.toEqual(customAccessor);
|
||||||
});
|
});
|
||||||
|
|
@ -6,11 +6,10 @@ import {
|
|||||||
xit,
|
xit,
|
||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach
|
||||||
el
|
} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {Control, FormBuilder} from '@angular/common';
|
||||||
import {Control, FormBuilder} from 'angular2/common';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
function syncValidator(_) { return null; }
|
function syncValidator(_) { return null; }
|
File diff suppressed because it is too large
Load Diff
@ -7,19 +7,17 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
el,
|
inject,
|
||||||
AsyncTestCompleter,
|
} from '@angular/core/testing/testing_internal';
|
||||||
fakeAsync,
|
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
|
||||||
tick,
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
inject
|
import {ControlGroup, Control, ControlArray, Validators} from '@angular/common';
|
||||||
} from 'angular2/testing_internal';
|
import {IS_DART, isPresent} from '../../src/facade/lang';
|
||||||
import {ControlGroup, Control, ControlArray, Validators} from 'angular2/common';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {IS_DART, isPresent, CONST_EXPR} from 'angular2/src/facade/lang';
|
import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
|
||||||
import {TimerWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
function asyncValidator(expected, timeouts = CONST_EXPR({})) {
|
function asyncValidator(expected, timeouts = /*@ts2dart_const*/ {}) {
|
||||||
return (c) => {
|
return (c) => {
|
||||||
var completer = PromiseWrapper.completer();
|
var completer = PromiseWrapper.completer();
|
||||||
var t = isPresent(timeouts[c.value]) ? timeouts[c.value] : 0;
|
var t = isPresent(timeouts[c.value]) ? timeouts[c.value] : 0;
|
@ -6,15 +6,12 @@ import {
|
|||||||
xit,
|
xit,
|
||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach
|
||||||
fakeAsync,
|
} from '@angular/core/testing/testing_internal';
|
||||||
tick,
|
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
|
||||||
el
|
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common';
|
||||||
} from 'angular2/testing_internal';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from 'angular2/common';
|
import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/promise';
|
|
||||||
import {EventEmitter, ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
|
||||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
function validator(key: string, error: any) {
|
function validator(key: string, error: any) {
|
@ -7,23 +7,22 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
AsyncTestCompleter,
|
|
||||||
inject,
|
inject,
|
||||||
browserDetection
|
} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {SpyChangeDetectorRef} from '../spies';
|
import {SpyChangeDetectorRef} from '../spies';
|
||||||
|
import {isBlank} from '../../src/facade/lang';
|
||||||
import {isBlank} from 'angular2/src/facade/lang';
|
import {AsyncPipe} from '@angular/common';
|
||||||
import {AsyncPipe} from 'angular2/common';
|
import {WrappedValue} from '@angular/core';
|
||||||
import {WrappedValue} from 'angular2/core';
|
|
||||||
import {
|
import {
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
ObservableWrapper,
|
ObservableWrapper,
|
||||||
PromiseWrapper,
|
PromiseWrapper,
|
||||||
TimerWrapper
|
TimerWrapper
|
||||||
} from 'angular2/src/facade/async';
|
} from '../../src/facade/async';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {PromiseCompleter} from 'angular2/src/facade/promise';
|
import {PromiseCompleter} from '../../src/facade/promise';
|
||||||
|
import {browserDetection} from '@angular/platform-browser/testing';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("AsyncPipe", () => {
|
describe("AsyncPipe", () => {
|
||||||
@ -121,7 +120,7 @@ export function main() {
|
|||||||
var completer: PromiseCompleter<any>;
|
var completer: PromiseCompleter<any>;
|
||||||
var ref: SpyChangeDetectorRef;
|
var ref: SpyChangeDetectorRef;
|
||||||
// adds longer timers for passing tests in IE
|
// adds longer timers for passing tests in IE
|
||||||
var timer = (!isBlank(DOM) && browserDetection.isIE) ? 50 : 10;
|
var timer = (!isBlank(getDOM()) && browserDetection.isIE) ? 50 : 10;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
completer = PromiseWrapper.completer();
|
completer = PromiseWrapper.completer();
|
@ -6,13 +6,13 @@ import {
|
|||||||
xit,
|
xit,
|
||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach
|
||||||
browserDetection
|
} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {browserDetection} from '@angular/platform-browser/testing';
|
||||||
|
|
||||||
import {DatePipe} from 'angular2/common';
|
import {DatePipe} from '@angular/common';
|
||||||
import {DateWrapper} from 'angular2/src/facade/lang';
|
import {DateWrapper} from '../../src/facade/lang';
|
||||||
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
|
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("DatePipe", () => {
|
describe("DatePipe", () => {
|
@ -7,10 +7,10 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach
|
afterEach
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {I18nPluralPipe} from 'angular2/common';
|
import {I18nPluralPipe} from '@angular/common';
|
||||||
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
|
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("I18nPluralPipe", () => {
|
describe("I18nPluralPipe", () => {
|
@ -7,10 +7,10 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach
|
afterEach
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {I18nSelectPipe} from 'angular2/common';
|
import {I18nSelectPipe} from '@angular/common';
|
||||||
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
|
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("I18nSelectPipe", () => {
|
describe("I18nSelectPipe", () => {
|
@ -7,15 +7,14 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
AsyncTestCompleter,
|
|
||||||
inject,
|
inject,
|
||||||
proxy,
|
} from '@angular/core/testing/testing_internal';
|
||||||
TestComponentBuilder
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
import {Json, RegExp, NumberWrapper, StringWrapper} from 'angular2/src/facade/lang';
|
import {Json, RegExp, NumberWrapper, StringWrapper} from '../../src/facade/lang';
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {Component} from '@angular/core';
|
||||||
import {JsonPipe} from 'angular2/common';
|
import {JsonPipe} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("JsonPipe", () => {
|
describe("JsonPipe", () => {
|
@ -7,9 +7,9 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach
|
afterEach
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {LowerCasePipe} from 'angular2/common';
|
import {LowerCasePipe} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("LowerCasePipe", () => {
|
describe("LowerCasePipe", () => {
|
@ -7,10 +7,10 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
browserDetection
|
} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {browserDetection} from '@angular/platform-browser/testing';
|
||||||
|
|
||||||
import {DecimalPipe, PercentPipe, CurrencyPipe} from 'angular2/common';
|
import {DecimalPipe, PercentPipe, CurrencyPipe} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('Number pipes', () => {
|
describe('Number pipes', () => {
|
@ -7,14 +7,12 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
browserDetection,
|
|
||||||
inject,
|
inject,
|
||||||
TestComponentBuilder,
|
} from '@angular/core/testing/testing_internal';
|
||||||
AsyncTestCompleter
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
|
||||||
|
|
||||||
import {ReplacePipe} from 'angular2/common';
|
import {ReplacePipe} from '@angular/common';
|
||||||
import {RegExpWrapper, StringJoiner} from 'angular2/src/facade/lang';
|
import {RegExpWrapper, StringJoiner} from '../../src/facade/lang';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("ReplacePipe", () => {
|
describe("ReplacePipe", () => {
|
@ -7,14 +7,15 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach,
|
afterEach,
|
||||||
browserDetection,
|
|
||||||
inject,
|
inject,
|
||||||
TestComponentBuilder,
|
} from '@angular/core/testing/testing_internal';
|
||||||
AsyncTestCompleter
|
import {} from '@angular/core/testing/testing_internal';
|
||||||
} from 'angular2/testing_internal';
|
import {browserDetection} from '@angular/platform-browser/testing';
|
||||||
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {Component} from 'angular2/core';
|
import {Component} from '@angular/core';
|
||||||
import {SlicePipe} from 'angular2/common';
|
import {SlicePipe} from '@angular/common';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("SlicePipe", () => {
|
describe("SlicePipe", () => {
|
@ -7,9 +7,8 @@ import {
|
|||||||
expect,
|
expect,
|
||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach
|
afterEach
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
import {UpperCasePipe} from '@angular/common';
|
||||||
import {UpperCasePipe} from 'angular2/common';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe("UpperCasePipe", () => {
|
describe("UpperCasePipe", () => {
|
@ -1,5 +1,5 @@
|
|||||||
import {ChangeDetectorRef} from 'angular2/src/core/change_detection/change_detector_ref';
|
import {ChangeDetectorRef} from '@angular/core/src/change_detection/change_detector_ref';
|
||||||
import {SpyObject, proxy} from 'angular2/testing_internal';
|
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
export class SpyChangeDetectorRef extends SpyObject {
|
export class SpyChangeDetectorRef extends SpyObject {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -10,4 +10,4 @@ export class SpyChangeDetectorRef extends SpyObject {
|
|||||||
|
|
||||||
export class SpyNgControl extends SpyObject {}
|
export class SpyNgControl extends SpyObject {}
|
||||||
|
|
||||||
export class SpyValueAccessor extends SpyObject {}
|
export class SpyValueAccessor extends SpyObject { writeValue: any; }
|
2
modules/@angular/common/testing.ts
Normal file
2
modules/@angular/common/testing.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export {MockLocationStrategy} from './testing/mock_location_strategy';
|
||||||
|
export {SpyLocation} from './testing/location_mock';
|
@ -1,7 +1,6 @@
|
|||||||
import {Injectable} from 'angular2/src/core/di';
|
import {Injectable, EventEmitter} from '@angular/core';
|
||||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
import {ObservableWrapper} from '../src/facade/async';
|
||||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
import {Location} from '../index';
|
||||||
import {Location} from 'angular2/platform/common';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A spy for {@link Location} that allows tests to fire simulated location events.
|
* A spy for {@link Location} that allows tests to fire simulated location events.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user