repackaging: all the repackaging changes squashed

This commit is contained in:
Igor Minar 2016-04-28 17:50:03 -07:00 committed by Misko Hevery
parent 505da6c0a8
commit a66cdb469f
860 changed files with 7869 additions and 4985 deletions

3
.gitignore vendored
View File

@ -52,3 +52,6 @@ npm-debug.log
# built dart payload tests
/modules_dart/payload/**/build
# rollup-test output
/modules/rollup-test/dist/

View File

@ -3,132 +3,190 @@ sudo: false
node_js:
- '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:
except:
- g3_v2_0
cache:
directories:
- $HOME/.pub-cache
- $HOME/.chrome/chromium
- ./node_modules
- ./.chrome/chromium
# - $HOME/.pub-cache
before_cache:
# 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
#before_cache:
# # 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="
# - KARMA_JS_BROWSERS=ChromeNoSandbox
# - E2E_BROWSERS=ChromeOnTravis
# - LOGS_DIR=/tmp/angular-build/logs
# - ARCH=linux-x64
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
- CI_MODE=js
# - CI_MODE=dart
- CI_MODE=build_only
- CI_MODE=saucelabs_required
- CI_MODE=browserstack_required
matrix:
allow_failures:
- env: "MODE=saucelabs_optional"
- env: "MODE=browserstack_optional"
#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
- ./scripts/ci-lite/install.sh
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
- ./scripts/ci-lite/build.sh && ./scripts/ci-lite/test.sh
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
- ./scripts/ci-lite/cleanup.sh
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=
#branches:
# except:
# - g3_v2_0
#
#cache:
# directories:
# - $HOME/.pub-cache
# - $HOME/.chrome/chromium
#
#before_cache:
# # 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=

View File

@ -38,7 +38,7 @@ var customLaunchers = {
'SL_CHROME': {
base: 'SauceLabs',
browserName: 'chrome',
version: '46'
version: '50'
},
'SL_CHROMEBETA': {
base: 'SauceLabs',
@ -53,7 +53,7 @@ var customLaunchers = {
'SL_FIREFOX': {
base: 'SauceLabs',
browserName: 'firefox',
version: '42'
version: '45'
},
'SL_FIREFOXBETA': {
base: 'SauceLabs',
@ -299,12 +299,7 @@ module.exports = {
customLaunchers: customLaunchers,
sauceAliases: sauceAliases,
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) {
return Object.keys(CIconfiguration)

75
build.sh Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env bash
set -e -o pipefail
cd `dirname $0`
TSCONFIG=./modules/tsconfig.json
echo "====== (all)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
rm -rf ./dist/all/
$(npm bin)/tsc -p ${TSCONFIG}
rm -rf ./dist/packages-dist
for PACKAGE in \
core \
compiler \
common \
platform-browser \
platform-browser-dynamic \
platform-server \
http \
router \
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)/tsc -p ${SRCDIR}/tsconfig.json ====="
$(npm bin)/tsc -p ${SRCDIR}/tsconfig.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'
else
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
fi
echo "====== (esm)COMPILING: \$(npm bin)/tsc -p ${SRCDIR}/tsconfig-es2015.json ====="
$(npm bin)/tsc -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

View File

@ -923,7 +923,7 @@ gulp.task('test.unit.cjs/ci', function(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); });
gulp.task('test.unit.cjs', ['build/clean.js', 'build.tools'], function(neverDone) {
@ -1566,6 +1566,10 @@ process.on('beforeExit', function() {
var firstTask = true;
gulp.on('task_start', (e) => {
if (firstTask) {
firstTask = false;

View File

@ -11,7 +11,8 @@ module.exports = function(config) {
files: [
// Sources and specs.
// 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',
// include Angular v1 for upgrade module testing
@ -24,16 +25,23 @@ module.exports = function(config) {
'node_modules/zone.js/dist/fake-async-test.js',
// 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',
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
'node_modules/reflect-metadata/Reflect.js',
'tools/build/file2modulename.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,
@ -54,6 +62,7 @@ module.exports = function(config) {
reporters: ['internal-angular'],
sauceLabs: {
testName: 'Angular2',
retryLimit: 3,
startConnect: false,
recordVideo: false,
recordScreenshots: false,
@ -68,7 +77,7 @@ module.exports = function(config) {
browserStack: {
project: 'Angular2',
startTunnel: false,
retryLimit: 1,
retryLimit: 3,
timeout: 600,
pollingTimeout: 10000
},
@ -80,7 +89,7 @@ module.exports = function(config) {
if (process.env.TRAVIS) {
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.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
@ -90,7 +99,7 @@ module.exports = function(config) {
config.transports = ['polling'];
}
if (process.env.MODE.startsWith('browserstack')) {
if (process.env.CI_MODE.startsWith('browserstack')) {
config.browserStack.build = buildId;
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
}

View File

@ -0,0 +1 @@
export 'index.dart';

View File

@ -0,0 +1,6 @@
export * from './src/pipes';
export * from './src/directives';
export * from './src/forms';
export * from './src/common_directives';
export * from './src/location';

View 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$$"
}
}

View 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 }),
]
}

View File

@ -1,5 +1,4 @@
import {Type} from 'angular2/src/facade/lang';
import {Type} from '@angular/core';
import {FORM_DIRECTIVES} from './forms';
import {CORE_DIRECTIVES} from './directives';
@ -17,7 +16,7 @@ import {CORE_DIRECTIVES} from './directives';
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
* 'angular2/common';
* '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
@ -33,7 +32,7 @@ import {CORE_DIRECTIVES} from './directives';
* one could import all the common directives at once:
*
* ```typescript
* import {COMMON_DIRECTIVES} from 'angular2/common';
* import {COMMON_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({

View File

@ -1,4 +1,4 @@
import {Type} from 'angular2/src/facade/lang';
import {Type} from '../../src/facade/lang';
import {NgClass} from './ng_class';
import {NgFor} from './ng_for';
import {NgIf} from './ng_if';
@ -19,7 +19,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
* Instead of writing:
*
* ```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';
*
* @Component({
@ -34,7 +34,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
* one could import all the core directives at once:
*
* ```typescript
* import {CORE_DIRECTIVES} from 'angular2/common';
* import {CORE_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({

View File

@ -1,4 +1,3 @@
import {isPresent, isString, isArray} from 'angular2/src/facade/lang';
import {
DoCheck,
OnDestroy,
@ -11,8 +10,9 @@ import {
KeyValueDiffer,
CollectionChangeRecord,
KeyValueChangeRecord
} from 'angular2/core';
import {StringMapWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
} from '@angular/core';
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
@ -33,8 +33,8 @@ import {StringMapWrapper, isListLikeIterable} from 'angular2/src/facade/collecti
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
*
* ```
* import {Component} from 'angular2/core';
* import {NgClass} from 'angular2/common';
* import {Component} from '@angular/core';
* import {NgClass} from '@angular/common';
*
* @Component({
* selector: 'toggle-button',

View File

@ -7,14 +7,12 @@ import {
ViewContainerRef,
TemplateRef,
EmbeddedViewRef,
TrackByFn
} from 'angular2/core';
import {isPresent, isBlank, stringify, getTypeNameForDebugging} from 'angular2/src/facade/lang';
import {
TrackByFn,
DefaultIterableDiffer,
CollectionChangeRecord
} from "../../core/change_detection/differs/default_iterable_differ";
import {BaseException} from "../../facade/exceptions";
} from '@angular/core';
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) {}

View File

@ -1,5 +1,5 @@
import {Directive, ViewContainerRef, TemplateRef} from 'angular2/core';
import {isBlank} from 'angular2/src/facade/lang';
import {Directive, ViewContainerRef, TemplateRef} from '@angular/core';
import {isBlank} from '../../src/facade/lang';
/**
* Removes or recreates a portion of the DOM tree based on an {expression}.

View File

@ -7,9 +7,10 @@ import {
Attribute,
AfterContentInit,
Input
} from 'angular2/core';
import {isPresent, NumberWrapper} from 'angular2/src/facade/lang';
import {Map} from 'angular2/src/facade/collection';
} from '@angular/core';
import {isPresent, NumberWrapper} from '../../src/facade/lang';
import {Map} from '../../src/facade/collection';
import {SwitchView} from './ng_switch';
const _CATEGORY_DEFAULT = 'other';

View File

@ -1,3 +1,4 @@
import {KeyValueChangeRecord} from '@angular/core';
import {
DoCheck,
KeyValueDiffer,
@ -5,9 +6,8 @@ import {
ElementRef,
Directive,
Renderer
} from 'angular2/core';
import {isPresent, isBlank, print} from 'angular2/src/facade/lang';
import {KeyValueChangeRecord} from "../../core/change_detection/differs/default_keyvalue_differ";
} from '@angular/core';
import {isPresent, isBlank} from '../../src/facade/lang';
/**
* 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)):
*
* ```
* import {Component} from 'angular2/core';
* import {NgStyle} from 'angular2/common';
* import {Component} from '@angular/core';
* import {NgStyle} from '@angular/common';
*
* @Component({
* selector: 'ngStyle-example',

View File

@ -1,6 +1,6 @@
import {Directive, Host, ViewContainerRef, TemplateRef} from 'angular2/core';
import {isPresent, isBlank, normalizeBlank} from 'angular2/src/facade/lang';
import {ListWrapper, Map} from 'angular2/src/facade/collection';
import {Directive, Host, ViewContainerRef, TemplateRef} from '@angular/core';
import {isPresent, isBlank, normalizeBlank} from '../../src/facade/lang';
import {ListWrapper, Map} from '../../src/facade/collection';
const _WHEN_DEFAULT = /*@ts2dart_const*/ new Object();

View File

@ -1,5 +1,5 @@
import {Directive, Input, ViewContainerRef, ViewRef, TemplateRef} from 'angular2/core';
import {isPresent} from 'angular2/src/facade/lang';
import {Directive, Input, ViewContainerRef, ViewRef, TemplateRef} from '@angular/core';
import {isPresent} from '../../src/facade/lang';
/**
* Creates and inserts an embedded view based on a prepared `TemplateRef`.

View File

@ -1,7 +1,7 @@
// TS does not have Observables
// 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

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -7,9 +7,7 @@
* to read information
* from the form DOM elements.
*
* This module is not included in the `angular2` module; you must import the forms module
* explicitly.
*
* Forms providers are not included in default providers; you must import these providers explicitly.
*/
export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model';
@ -43,7 +41,7 @@ export {
export {FormBuilder} from './forms/form_builder';
import {FormBuilder} from './forms/form_builder';
import {RadioControlRegistry} from './forms/directives/radio_control_value_accessor';
import {Type} from 'angular2/src/facade/lang';
import {Type} from '@angular/core';
/**
* Shorthand set of providers used for building Angular forms.

View File

@ -1,4 +1,4 @@
import {Type} from 'angular2/src/facade/lang';
import {Type} from '@angular/core';
import {NgControlName} from './directives/ng_control_name';
import {NgFormControl} from './directives/ng_form_control';
import {NgModel} from './directives/ng_model';

View File

@ -1,6 +1,6 @@
import {AbstractControl} from '../model';
import {isPresent} from 'angular2/src/facade/lang';
import {unimplemented} from 'angular2/src/facade/exceptions';
import {isPresent} from '../../../src/facade/lang';
import {unimplemented} from '../../../src/facade/exceptions';
/**
* Base class for control directives.

View File

@ -1,5 +1,4 @@
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';
export const CHECKBOX_VALUE_ACCESSOR: any = /*@ts2dart_const*/ {

View File

@ -1,4 +1,4 @@
import {OpaqueToken} from 'angular2/core';
import {OpaqueToken} from '@angular/core';
/**
* A bridge between a control and a native element.

View File

@ -1,6 +1,6 @@
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 {isBlank} from 'angular2/src/facade/lang';
export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/
/* @ts2dart_Provider */ {

View File

@ -42,4 +42,4 @@ export interface Form {
* Update the model for a particular control with a new value.
*/
updateModel(dir: NgControl, value: any): void;
}
}

View File

@ -1,6 +1,7 @@
import {unimplemented} from '../../../src/facade/exceptions';
import {ControlValueAccessor} from './control_value_accessor';
import {AbstractControlDirective} from './abstract_control_directive';
import {unimplemented} from 'angular2/src/facade/exceptions';
import {AsyncValidatorFn, ValidatorFn} from './validators';
/**

View File

@ -9,8 +9,7 @@ import {
forwardRef,
Provider,
Self
} from 'angular2/core';
} from '@angular/core';
import {ControlContainer} from './control_container';
import {controlPath, composeValidators, composeAsyncValidators} from './shared';
import {ControlGroup} from '../model';
@ -37,7 +36,7 @@ export const controlGroupProvider: any =
* directives: [FORM_DIRECTIVES],
* template: `
* <div>
* <h2>Angular2 Control &amp; ControlGroup Example</h2>
* <h2>Angular Control &amp; ControlGroup Example</h2>
* <form #f="ngForm">
* <div ngControlGroup="name" #cg-name="form">
* <h3>Enter your name:</h3>

View File

@ -1,5 +1,3 @@
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {
OnChanges,
OnDestroy,
@ -13,8 +11,9 @@ import {
Inject,
Optional,
Self
} from 'angular2/core';
} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../../src/facade/async';
import {ControlContainer} from './control_container';
import {NgControl} from './ng_control';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';

View File

@ -1,6 +1,6 @@
import {Directive, Self} from 'angular2/core';
import {Directive, Self} from '@angular/core';
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

View File

@ -1,25 +1,22 @@
import {Directive, forwardRef, Provider, Optional, Inject, Self} from '@angular/core';
import {
PromiseWrapper,
ObservableWrapper,
EventEmitter,
PromiseCompleter
} from 'angular2/src/facade/async';
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import {isPresent, isBlank} from 'angular2/src/facade/lang';
import {Directive, forwardRef, Provider, Optional, Inject, Self} from 'angular2/core';
} from '../../../src/facade/async';
import {ListWrapper} from '../../../src/facade/collection';
import {isPresent} from '../../../src/facade/lang';
import {NgControl} from './ng_control';
import {Form} from './form_interface';
import {NgControlGroup} from './ng_control_group';
import {ControlContainer} from './control_container';
import {AbstractControl, ControlGroup, Control} from '../model';
import {setUpControl, setUpControlGroup, composeValidators, composeAsyncValidators} from './shared';
import {Validators, NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
import {NG_VALIDATORS, NG_ASYNC_VALIDATORS} from '../validators';
export const formDirectiveProvider: any =
/*@ts2dart_const*/ /* @ts2dart_Provider */ {
provide: 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

View File

@ -1,5 +1,3 @@
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {
OnChanges,
SimpleChange,
@ -10,10 +8,14 @@ import {
Inject,
Optional,
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 {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 {
setUpControl,

View File

@ -1,7 +1,3 @@
import {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 {
SimpleChange,
OnChanges,
@ -11,7 +7,11 @@ import {
Inject,
Optional,
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 {NgControlGroup} from './ng_control_group';
import {ControlContainer} from './control_container';

View File

@ -1,4 +1,3 @@
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {
OnChanges,
SimpleChange,
@ -8,7 +7,8 @@ import {
Inject,
Optional,
Self
} from 'angular2/core';
} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../../src/facade/async';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
import {NgControl} from './ng_control';
import {Control} from '../model';

View File

@ -1,4 +1,4 @@
import {AbstractControl} from "../model";
import {AbstractControl} from '../model';
import {Validator, ValidatorFn, AsyncValidatorFn} from './validators';
export function normalizeValidator(validator: ValidatorFn | Validator): ValidatorFn {

View File

@ -1,6 +1,6 @@
import {Directive, ElementRef, Renderer, Self, forwardRef} 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 {isBlank, NumberWrapper} from 'angular2/src/facade/lang';
export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
provide: NG_VALUE_ACCESSOR,

View File

@ -2,23 +2,21 @@ import {
Directive,
ElementRef,
Renderer,
Self,
forwardRef,
Provider,
Attribute,
Input,
OnInit,
OnDestroy,
Injector,
Injectable
} from 'angular2/core';
} from '@angular/core';
import {isPresent} from '../../../src/facade/lang';
import {ListWrapper} from '../../../src/facade/collection';
import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from 'angular2/src/common/forms/directives/control_value_accessor';
import {NgControl} from 'angular2/src/common/forms/directives/ng_control';
import {looseIdentical, isPresent} from 'angular2/src/facade/lang';
import {ListWrapper} from 'angular2/src/facade/collection';
} from './control_value_accessor';
import {NgControl} from './ng_control';
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
provide: NG_VALUE_ACCESSOR,

View File

@ -8,17 +8,17 @@ import {
Host,
OnDestroy,
Optional
} from 'angular2/core';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
} from '@angular/core';
import {
StringWrapper,
isPrimitive,
isPresent,
isBlank,
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';
export const SELECT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
provide: NG_VALUE_ACCESSOR,

View File

@ -1,6 +1,6 @@
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collection';
import {isBlank, isPresent, looseIdentical, hasConstructor} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {ListWrapper, StringMapWrapper} from '../../../src/facade/collection';
import {isBlank, isPresent, looseIdentical, hasConstructor} from '../../../src/facade/lang';
import {BaseException} from '../../../src/facade/exceptions';
import {ControlContainer} from './control_container';
import {NgControl} from './ng_control';

View File

@ -1,5 +1,5 @@
import {forwardRef, Attribute, Directive} from 'angular2/core';
import {NumberWrapper} from 'angular2/src/facade/lang';
import {forwardRef, Attribute, Directive} from '@angular/core';
import {NumberWrapper} from '../../facade/lang';
import {Validators, NG_VALIDATORS} from '../validators';
import {AbstractControl} from '../model';
import * as modelModule from '../model';

View File

@ -1,6 +1,6 @@
import {Injectable} from 'angular2/core';
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {isPresent, isArray, Type} from 'angular2/src/facade/lang';
import {Injectable} from '@angular/core';
import {StringMapWrapper} from '../../src/facade/collection';
import {isPresent, isArray} from '../../src/facade/lang';
import * as modelModule from './model';
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';

View File

@ -1,7 +1,7 @@
import {isPresent, isBlank, normalizeBool} from 'angular2/src/facade/lang';
import {Observable, EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {PromiseWrapper} from 'angular2/src/facade/promise';
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import {isPresent, isBlank, normalizeBool} from '../../src/facade/lang';
import {Observable, EventEmitter, ObservableWrapper} from '../../src/facade/async';
import {PromiseWrapper} from '../../src/facade/promise';
import {StringMapWrapper, ListWrapper} from '../../src/facade/collection';
import {ValidatorFn, AsyncValidatorFn} from './directives/validators';
/**

View File

@ -1,9 +1,9 @@
import {isBlank, isPresent, isString} from 'angular2/src/facade/lang';
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 {OpaqueToken} from '@angular/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 {ValidatorFn, AsyncValidatorFn} from './directives/validators';

View File

@ -1,5 +1,5 @@
export * from './browser/location/platform_location';
export * from './browser/location/location_strategy';
export * from './browser/location/hash_location_strategy';
export * from './browser/location/path_location_strategy';
export * from './browser/location/location';
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';

View File

@ -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 {Location} from './location';
import {UrlChangeListener, PlatformLocation} from './platform_location';
import {isPresent} from 'angular2/src/facade/lang';
/**
* `HashLocationStrategy` is a {@link LocationStrategy} used to configure the
@ -16,17 +18,17 @@ import {isPresent} from 'angular2/src/facade/lang';
* ### Example
*
* ```
* import {Component, provide} from 'angular2/core';
* import {Component, provide} from '@angular/core';
* import {
* Location,
* LocationStrategy,
* HashLocationStrategy
* } from 'angular2/platform/common';
* } from '@angular/common';
* import {
* ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS,
* RouteConfig
* } from 'angular2/router';
* } from '@angular/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([

View File

@ -1,5 +1,6 @@
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {Injectable, Inject} from 'angular2/core';
import {Injectable, Inject} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../src/facade/async';
import {LocationStrategy} from './location_strategy';
/**
@ -21,13 +22,13 @@ import {LocationStrategy} from './location_strategy';
* ### Example
*
* ```
* import {Component} from 'angular2/core';
* import {Location} from 'angular2/platform/common';
* import {Component} from '@angular/core';
* import {Location} from '@angular/common';
* import {
* ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS,
* RouteConfig
* } from 'angular2/router';
* } from '@angular/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([

View File

@ -1,4 +1,4 @@
import {OpaqueToken} from 'angular2/core';
import {OpaqueToken} from '@angular/core';
import {UrlChangeListener} from './platform_location';
/**
@ -40,9 +40,9 @@ export abstract class LocationStrategy {
* ### Example
*
* ```
* import {Component} from 'angular2/core';
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router';
* import {APP_BASE_HREF} from 'angular2/platform/common';
* import {Component} from '@angular/core';
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from '@angular/router';
* import {APP_BASE_HREF} from '@angular/common';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([

View File

@ -1,6 +1,7 @@
import {Injectable, Inject, Optional} from 'angular2/core';
import {isBlank} from 'angular2/src/facade/lang';
import {BaseException} from 'angular2/src/facade/exceptions';
import {Injectable, Inject, Optional} from '@angular/core';
import {isBlank} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import {PlatformLocation, UrlChangeListener} from './platform_location';
import {LocationStrategy, APP_BASE_HREF} from './location_strategy';
import {Location} from './location';
@ -25,17 +26,17 @@ import {Location} from './location';
* ### Example
*
* ```
* import {Component, provide} from 'angular2/core';
* import {bootstrap} from 'angular2/platform/browser';
* import {Component, provide} from '@angular/core';
* import {bootstrap} from '@angular/platform-browser/browser';
* import {
* Location,
* APP_BASE_HREF
* } from 'angular2/platform/common';
* } from '@angular/common';
* import {
* ROUTER_DIRECTIVES,
* ROUTER_PROVIDERS,
* RouteConfig
* } from 'angular2/router';
* } from '@angular/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @RouteConfig([

View File

@ -1,6 +1,13 @@
import {isBlank, isPresent, isPromise} from 'angular2/src/facade/lang';
import {ObservableWrapper, Observable, EventEmitter} from 'angular2/src/facade/async';
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from 'angular2/core';
import {
Pipe,
Injectable,
ChangeDetectorRef,
OnDestroy,
WrappedValue
} from '@angular/core';
import {isBlank, isPresent, isPromise} from '../../src/facade/lang';
import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';

View File

@ -1,15 +1,12 @@
import {PipeTransform, Pipe, Injectable} from '@angular/core';
import {
isDate,
isNumber,
isPresent,
Date,
DateWrapper,
isBlank,
FunctionWrapper
} from 'angular2/src/facade/lang';
import {DateFormatter} from 'angular2/src/facade/intl';
import {PipeTransform, WrappedValue, Pipe, Injectable} from 'angular2/core';
import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
} from '../../src/facade/lang';
import {DateFormatter} from '../../src/facade/intl';
import {StringMapWrapper} from '../../src/facade/collection';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';

View File

@ -1,5 +1,10 @@
import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
import {Injectable, PipeTransform, Pipe} from '@angular/core';
import {
isStringMap,
StringWrapper,
isPresent,
RegExpWrapper
} from '../../src/facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
var interpolationExp: RegExp = RegExpWrapper.create('#');

View File

@ -1,6 +1,6 @@
import {isStringMap} from 'angular2/src/facade/lang';
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
import {Injectable, PipeTransform, Pipe} from '@angular/core';
import {isStringMap} from '../../src/facade/lang';
import {StringMapWrapper} from '../../src/facade/collection';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
/**

View File

@ -1,5 +1,5 @@
import {Type, stringify} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {Type, stringify} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
export class InvalidPipeArgumentException extends BaseException {
constructor(type: Type, value: Object) {

View File

@ -1,5 +1,6 @@
import {isBlank, isPresent, Json} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
import {Json} from '../../src/facade/lang';
/**
* Transforms any input value using `JSON.stringify`. Useful for debugging.

View File

@ -1,5 +1,5 @@
import {isString, isBlank} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
import {isString, isBlank} from '../../src/facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
/**
@ -9,6 +9,7 @@ import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
*
* {@example core/pipes/ts/lowerupper_pipe/lowerupper_pipe_example.ts region='LowerUpperPipe'}
*/
/* @ts2dart_const */
@Pipe({name: 'lowercase'})
@Injectable()
export class LowerCasePipe implements PipeTransform {

View File

@ -1,15 +1,15 @@
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/core';
import {
isNumber,
isPresent,
isBlank,
StringWrapper,
NumberWrapper,
RegExpWrapper,
FunctionWrapper
} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {NumberFormatter, NumberFormatStyle} from 'angular2/src/facade/intl';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import {NumberFormatter, NumberFormatStyle} from '../../src/facade/intl';
import {ListWrapper} from '../../src/facade/collection';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';

View File

@ -1,3 +1,5 @@
import {Injectable, PipeTransform, Pipe} from '@angular/core';
import {
isBlank,
isString,
@ -5,8 +7,8 @@ import {
isFunction,
RegExpWrapper,
StringWrapper
} from 'angular2/src/facade/lang';
import {Injectable, PipeTransform, Pipe} from 'angular2/core';
} from '../../src/facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
/**

View File

@ -1,6 +1,9 @@
import {isBlank, isString, isArray, StringWrapper} from 'angular2/src/facade/lang';
import {ListWrapper} from 'angular2/src/facade/collection';
import {Injectable, PipeTransform, WrappedValue, Pipe} from 'angular2/core';
import {Injectable, PipeTransform, WrappedValue, Pipe} from '@angular/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';
/**

View File

@ -1,5 +1,5 @@
import {isString, isBlank} from 'angular2/src/facade/lang';
import {PipeTransform, WrappedValue, Injectable, Pipe} from 'angular2/core';
import {PipeTransform, WrappedValue, Injectable, Pipe} from '@angular/core';
import {isString, isBlank} from '../../src/facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
/**

View File

@ -1,23 +1,20 @@
import {
ComponentFixture,
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
beforeEachProviders,
ddescribe,
xdescribe,
describe,
el,
expect,
iit,
inject,
it,
xit,
} from 'angular2/testing_internal';
import {ListWrapper, StringMapWrapper, SetWrapper} from 'angular2/src/facade/collection';
import {Component, provide} from 'angular2/core';
import {NgFor} from 'angular2/common';
import {NgClass} from 'angular2/src/common/directives/ng_class';
} from '@angular/core/testing/testing_internal';
import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection';
import {Component, provide} from '@angular/core';
import {NgFor, NgClass} from '@angular/common';
function detectChangesAndCheck(fixture: ComponentFixture<any>, classes: string) {
fixture.detectChanges();

View File

@ -1,24 +1,23 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
beforeEachProviders,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
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 {IS_DART} from 'angular2/src/facade/lang';
import {Component, TemplateRef, ContentChild} from 'angular2/core';
import {NgFor} from 'angular2/src/common/directives/ng_for';
import {NgIf} from 'angular2/src/common/directives/ng_if';
import {By} from 'angular2/platform/common_dom';
import {ListWrapper} from '../../src/facade/collection';
import {IS_DART} from '../../src/facade/lang';
import {Component, TemplateRef, ContentChild} from '@angular/core';
import {NgFor} from '@angular/common';
import {NgIf} from '@angular/common';
import {By} from '@angular/platform-browser/src/dom/debug/by';
export function main() {
describe('ngFor', () => {

View File

@ -1,23 +1,22 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
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 {NgIf} from 'angular2/common';
import {Component} from '@angular/core';
import {NgIf} from '@angular/common';
import {IS_DART} from 'angular2/src/facade/lang';
import {IS_DART} from '../../src/facade/lang';
export function main() {
describe('ngIf directive', () => {
@ -29,7 +28,7 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
async.done();
@ -45,7 +44,7 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
async.done();
@ -61,19 +60,19 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.booleanCondition = true;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
@ -91,31 +90,31 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.booleanCondition = true;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
@ -136,21 +135,21 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(3);
expect(DOM.getText(fixture.debugElement.nativeElement))
expect(getDOM().getText(fixture.debugElement.nativeElement))
.toEqual('helloNumberhelloStringhelloFunction');
fixture.debugElement.componentInstance.numberCondition = 0;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
fixture.debugElement.componentInstance.numberCondition = 1;
fixture.debugElement.componentInstance.stringCondition = "bar";
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
async.done();
@ -167,13 +166,13 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.numberCondition = 2;
fixture.detectChanges();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
@ -189,13 +188,13 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
DOM.addClass(DOM.querySelector(fixture.debugElement.nativeElement, 'copy-me'),
getDOM().addClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
"foo");
fixture.debugElement.componentInstance.numberCondition = 2;
fixture.detectChanges();
expect(
DOM.hasClass(DOM.querySelector(fixture.debugElement.nativeElement, 'copy-me'),
getDOM().hasClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
"foo"))
.toBe(true);
@ -213,7 +212,7 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
expect(() => fixture.detectChanges()).toThrowError();
expect(DOM.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
async.done();

View File

@ -1,20 +1,19 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEachProviders,
beforeEach,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
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 {NgPlural, NgPluralCase, NgLocalization} from 'angular2/common';
import {Component, Injectable, provide} from '@angular/core';
import {NgPlural, NgPluralCase, NgLocalization} from '@angular/common';
export function main() {
describe('switch', () => {

View File

@ -1,25 +1,24 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
beforeEachProviders,
ddescribe,
xdescribe,
describe,
el,
expect,
iit,
inject,
it,
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 {NgStyle} from 'angular2/src/common/directives/ng_style';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {NgStyle} from '@angular/common/src/directives/ng_style';
export function main() {
describe('binding to CSS styles', () => {
@ -32,7 +31,7 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
async.done();
@ -50,13 +49,13 @@ export function main() {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expr = fixture.debugElement.componentInstance.expr;
expr['max-width'] = '30%';
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('30%');
async.done();
@ -72,12 +71,12 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
async.done();
@ -93,16 +92,16 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
async.done();
@ -118,17 +117,17 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
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');
fixture.detectChanges();
expect(DOM.getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
async.done();

View File

@ -1,20 +1,18 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
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 'angular2/src/common/directives/ng_switch';
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
export function main() {
describe('switch', () => {

View File

@ -1,20 +1,17 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
xit,
} from 'angular2/testing_internal';
import {Component, Directive, TemplateRef, ContentChildren, QueryList} from 'angular2/core';
import {NgTemplateOutlet} from 'angular2/src/common/directives/ng_template_outlet';
} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {Component, Directive, TemplateRef, ContentChildren, QueryList} from '@angular/core';
import {NgTemplateOutlet} from '@angular/common';
export function main() {
describe('insert', () => {

View File

@ -1,19 +1,18 @@
import {
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
el,
expect,
iit,
inject,
it,
xit,
} from 'angular2/testing_internal';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {Component, Directive} from 'angular2/core';
import {ElementRef} from 'angular2/src/core/linker/element_ref';
} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
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() {
describe('non-bindable', () => {
@ -37,10 +36,10 @@ export function main() {
.then((fixture) => {
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.
var span = DOM.querySelector(fixture.debugElement.nativeElement, '#child');
expect(DOM.hasClass(span, 'compiled')).toBeFalsy();
var span = getDOM().querySelector(fixture.debugElement.nativeElement, '#child');
expect(getDOM().hasClass(span, 'compiled')).toBeFalsy();
async.done();
});
}));
@ -52,8 +51,8 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
var span = DOM.querySelector(fixture.debugElement.nativeElement, '#child');
expect(DOM.hasClass(span, 'compiled')).toBeTruthy();
var span = getDOM().querySelector(fixture.debugElement.nativeElement, '#child');
expect(getDOM().hasClass(span, 'compiled')).toBeTruthy();
async.done();
});
}));
@ -62,7 +61,7 @@ export function main() {
@Directive({selector: '[test-dec]'})
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: ''})

View File

@ -1,19 +1,21 @@
import {
ddescribe,
describe,
fakeAsync,
flushMicrotasks,
it,
iit,
xit,
expect,
beforeEach,
afterEach,
el,
AsyncTestCompleter,
inject,
tick
} from 'angular2/testing_internal';
inject
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
flushMicrotasks,
Log,
tick,
} from '@angular/core/testing';
import {SpyNgControl, SpyValueAccessor} from '../spies';
@ -33,13 +35,13 @@ import {
CheckboxControlValueAccessor,
SelectControlValueAccessor,
Validator
} from 'angular2/common';
} from '@angular/common';
import {selectValueAccessor, composeValidators} from 'angular2/src/common/forms/directives/shared';
import {TimerWrapper} from 'angular2/src/facade/async';
import {PromiseWrapper} from 'angular2/src/facade/promise';
import {SimpleChange} from 'angular2/src/core/change_detection';
import {selectValueAccessor, composeValidators} from '@angular/common/src/forms/directives/shared';
import {TimerWrapper} from '../../src/facade/async';
import {PromiseWrapper} from '../../src/facade/promise';
import {SimpleChange} from '@angular/core/src/change_detection';
class DummyControlValueAccessor implements ControlValueAccessor {
writtenValue;
@ -69,7 +71,7 @@ function asyncValidator(expected, timeout = 0) {
export function main() {
describe("Form Directives", () => {
var defaultAccessor;
var defaultAccessor: DefaultValueAccessor;
beforeEach(() => { defaultAccessor = new DefaultValueAccessor(null, null); });
@ -106,7 +108,7 @@ export function main() {
it("should return custom accessor when provided", () => {
var customAccessor = new SpyValueAccessor();
var checkboxAccessor = new CheckboxControlValueAccessor(null, null);
expect(selectValueAccessor(dir, [defaultAccessor, customAccessor, checkboxAccessor]))
expect(selectValueAccessor(dir, <any>[defaultAccessor, customAccessor, checkboxAccessor]))
.toEqual(customAccessor);
});

View File

@ -6,11 +6,10 @@ import {
xit,
expect,
beforeEach,
afterEach,
el
} from 'angular2/testing_internal';
import {Control, FormBuilder} from 'angular2/common';
import {PromiseWrapper} from 'angular2/src/facade/promise';
afterEach
} from '@angular/core/testing/testing_internal';
import {Control, FormBuilder} from '@angular/common';
import {PromiseWrapper} from '../../src/facade/promise';
export function main() {
function syncValidator(_) { return null; }

View File

@ -1,33 +1,24 @@
import {Component, Directive, Output, EventEmitter} from '@angular/core';
import {
Component,
Directive,
Output,
EventEmitter,
Provider,
forwardRef,
Input
} from 'angular2/core';
import {
ComponentFixture,
afterEach,
AsyncTestCompleter,
TestComponentBuilder,
beforeEach,
ddescribe,
describe,
dispatchEvent,
fakeAsync,
tick,
flushMicrotasks,
expect,
it,
inject,
iit,
xit,
browserDetection
} from 'angular2/testing_internal';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
xit
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
tick,
flushMicrotasks
} from '@angular/core/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder} from '@angular/compiler/testing';
import {ComponentFixture} from '@angular/compiler/testing';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {
Control,
ControlGroup,
@ -42,11 +33,14 @@ import {
Validators,
Validator,
RadioButtonState
} from 'angular2/common';
import {By} from 'angular2/platform/browser';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
import {PromiseWrapper} from "angular2/src/facade/promise";
} from '@angular/common';
import {Provider, forwardRef, Input} from '@angular/core';
import {By} from '@angular/platform-browser/src/dom/debug/by';
import {ListWrapper} from '../../src/facade/collection';
import {ObservableWrapper, TimerWrapper} from '../../src/facade/async';
import {PromiseWrapper} from '../../src/facade/promise';
import {browserDetection} from '@angular/platform-browser/testing';
import {dispatchEvent} from '@angular/platform-browser/testing';
export function main() {
describe("integration tests", () => {
@ -57,7 +51,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"login": new Control("loginValue")});
fixture.detectChanges();
@ -74,7 +68,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
expect(() => fixture.detectChanges())
.toThrowError(new RegExp(`ngFormModel expects a form. Please pass one in.`));
async.done();
@ -89,7 +83,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
@ -110,7 +104,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
@ -132,7 +126,7 @@ export function main() {
<span>{{name}}</span>
</div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.form = new ControlGroup({});
@ -153,7 +147,7 @@ export function main() {
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = control;
fixture.detectChanges();
@ -174,7 +168,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"login": new Control("oldValue")});
fixture.detectChanges();
@ -198,7 +192,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -221,7 +215,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -243,7 +237,7 @@ export function main() {
<input type="text" ngControl="text">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control("old")});
fixture.detectChanges();
@ -265,7 +259,7 @@ export function main() {
<input ngControl="text">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control("old")});
fixture.detectChanges();
@ -286,7 +280,7 @@ export function main() {
<textarea ngControl="text"></textarea>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"text": new Control('old')});
fixture.detectChanges();
@ -308,7 +302,7 @@ export function main() {
<input type="checkbox" ngControl="checkbox">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"checkbox": new Control(true)});
fixture.detectChanges();
@ -330,7 +324,7 @@ export function main() {
<input type="number" ngControl="num">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"num": new Control(10)});
fixture.detectChanges();
@ -352,7 +346,7 @@ export function main() {
<input type="number" ngControl="num" required>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"num": new Control(10)});
fixture.detectChanges();
@ -381,7 +375,7 @@ export function main() {
<input type="number" ngControl="num" [(ngModel)]="data">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.debugElement.componentInstance.data = null;
fixture.detectChanges();
@ -400,7 +394,7 @@ export function main() {
<input type="radio" ngControl="foodFish" name="food">
</form>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = new ControlGroup({
"foodChicken": new Control(new RadioButtonState(false, 'chicken')),
"foodFish": new Control(new RadioButtonState(true, 'fish'))
@ -429,7 +423,7 @@ export function main() {
<option value="NYC"></option>
</select>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.detectChanges();
var select = fixture.debugElement.query(By.css("select"));
@ -450,7 +444,7 @@ export function main() {
</option>
</select>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp = fixture.debugElement.componentInstance;
testComp.list = [{"id": "0", "name": "SF"}, {"id": "1", "name": "NYC"}];
fixture.detectChanges();
@ -475,7 +469,7 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"city": new Control("SF")});
fixture.detectChanges();
@ -505,7 +499,7 @@ export function main() {
</div>`;
var fixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((compFixture) => fixture =
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((compFixture) => fixture =
compFixture);
tick();
@ -529,7 +523,7 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp = fixture.debugElement.componentInstance;
testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "Buffalo"}];
@ -561,9 +555,9 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp: MyComp = fixture.debugElement.componentInstance;
var testComp: MyComp8 = fixture.debugElement.componentInstance;
testComp.list = [{"name": "SF"}, {"name": "NYC"}];
testComp.selectedCity = testComp.list[1];
fixture.detectChanges();
@ -588,9 +582,9 @@ export function main() {
<option *ngFor="let c of list" [ngValue]="c">{{c}}</option>
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp: MyComp = fixture.debugElement.componentInstance;
var testComp: MyComp8 = fixture.debugElement.componentInstance;
testComp.list = [{"name": "SF"}, {"name": "NYC"}];
testComp.selectedCity = testComp.list[1];
fixture.detectChanges();
@ -615,7 +609,7 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp = fixture.debugElement.componentInstance;
@ -645,7 +639,7 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp = fixture.debugElement.componentInstance;
@ -674,7 +668,7 @@ export function main() {
</select>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
var testComp = fixture.debugElement.componentInstance;
testComp.list = [{"name": "SF"}, {"name": "NYC"}, {"name": "NYC"}];
@ -700,7 +694,7 @@ export function main() {
<input type="text" ngControl="name" wrapped-value>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"name": new Control("aa")});
fixture.detectChanges();
@ -721,7 +715,7 @@ export function main() {
<my-input ngControl="name"></my-input>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form =
new ControlGroup({"name": new Control("aa")});
fixture.detectChanges();
@ -751,7 +745,7 @@ export function main() {
<input type="text" ngControl="max" maxlength="3">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -794,7 +788,7 @@ export function main() {
</div>`;
var rootTC;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((root) => rootTC = root);
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((root) => rootTC = root);
tick();
rootTC.debugElement.componentInstance.form = form;
@ -822,7 +816,7 @@ export function main() {
<input type="text" ngControl="login">
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
expect(form.valid).toEqual(true);
@ -847,7 +841,7 @@ export function main() {
</div>`;
var fixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((root) => fixture = root);
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((root) => fixture = root);
tick();
fixture.debugElement.componentInstance.form = form;
@ -884,7 +878,7 @@ export function main() {
</div>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -905,7 +899,7 @@ export function main() {
</div>
</div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
var input = fixture.debugElement.query(By.css("input"));
@ -926,7 +920,7 @@ export function main() {
var t =
`<div [ngFormModel]="form"><input type="text" ngControl="name" [(ngModel)]="name"></div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = 'oldValue';
@ -949,7 +943,7 @@ export function main() {
var t = `<div><input type="text" [ngFormControl]="form" [(ngModel)]="name"></div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.form = form;
fixture.debugElement.componentInstance.name = "oldValue";
@ -974,7 +968,7 @@ export function main() {
</div>
</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = null;
fixture.detectChanges();
@ -992,7 +986,7 @@ export function main() {
fakeAsync(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
var t = `<div><form (ngSubmit)="name='updated'"></form></div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = 'old';
var form = fixture.debugElement.query(By.css("form"));
@ -1008,7 +1002,7 @@ export function main() {
var t = `<form ngNoForm>
</form>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.name = null;
fixture.detectChanges();
@ -1025,7 +1019,7 @@ export function main() {
</div>
</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = 'show';
fixture.detectChanges();
@ -1051,7 +1045,7 @@ export function main() {
</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = 'show';
fixture.detectChanges();
@ -1073,7 +1067,7 @@ export function main() {
<input type="text" ngControl="name" [(ngModel)]="name">
</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = "oldValue";
fixture.detectChanges();
@ -1094,7 +1088,7 @@ export function main() {
fakeAsync(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
var t = `<div><input type="text" [(ngModel)]="name"></div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = "oldValue";
fixture.detectChanges();
@ -1121,7 +1115,7 @@ export function main() {
<input type="radio" name="food" ngControl="fish" [(ngModel)]="data['fish2']">
</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.data = {
@ -1157,7 +1151,7 @@ export function main() {
var t = `<div><input type="text" [ngFormControl]="form"></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -1184,7 +1178,7 @@ export function main() {
var t = `<form [ngFormModel]="form"><input type="text" ngControl="name"></form>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -1209,7 +1203,7 @@ export function main() {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var t = `<div><input [(ngModel)]="name" required></div>`;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
fixture.debugElement.componentInstance.name = "";
fixture.detectChanges();
@ -1237,7 +1231,7 @@ export function main() {
var form = new Control("");
var t = `<div><input type="text" [ngFormControl]="form" [(ngModel)]="name"></div>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.form = form;
fixture.detectChanges();
@ -1245,8 +1239,8 @@ export function main() {
// In Firefox, effective text selection in the real DOM requires an actual focus
// of the field. This is not an issue in a new HTML document.
if (browserDetection.isFirefox) {
var fakeDoc = DOM.createHtmlDocument();
DOM.appendChild(fakeDoc.body, fixture.debugElement.nativeElement);
var fakeDoc = getDOM().createHtmlDocument();
getDOM().appendChild(fakeDoc.body, fixture.debugElement.nativeElement);
}
var input = fixture.debugElement.query(By.css("input")).nativeElement;
@ -1264,7 +1258,7 @@ export function main() {
it("should update the view when the model is set back to what used to be in the view",
fakeAsync(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
var t = `<input type="text" [(ngModel)]="name">`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.debugElement.componentInstance.name = "";
fixture.detectChanges();
@ -1298,7 +1292,7 @@ export function main() {
// fixed.
var t = `<form><div ngControlGroup="x" #x="ngForm">
<input type="text" ngControl="test"></div>{{x.valid}}</form>`;
let fixture = tcb.overrideTemplate(MyComp, t).createFakeAsync(MyComp);
let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
tick();
fixture.detectChanges();
})));
@ -1394,7 +1388,7 @@ class UniqLoginValidator implements Validator {
UniqLoginValidator
]
})
class MyComp {
class MyComp8 {
form: any;
name: string;
data: any;
@ -1404,7 +1398,7 @@ class MyComp {
}
function sortedClassList(el) {
var l = DOM.classList(el);
var l = getDOM().classList(el);
ListWrapper.sort(l);
return l;
}

View File

@ -7,16 +7,19 @@ import {
expect,
beforeEach,
afterEach,
el,
AsyncTestCompleter,
inject,
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
tick,
inject
} from 'angular2/testing_internal';
import {ControlGroup, Control, ControlArray, Validators} from 'angular2/common';
import {IS_DART, isPresent} from 'angular2/src/facade/lang';
import {PromiseWrapper} from 'angular2/src/facade/promise';
import {TimerWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
flushMicrotasks,
Log,
tick
} from '@angular/core/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {ControlGroup, Control, ControlArray, Validators} from '@angular/common';
import {IS_DART, isPresent} from '../../src/facade/lang';
import {PromiseWrapper} from '../../src/facade/promise';
import {TimerWrapper, ObservableWrapper, EventEmitter} from '../../src/facade/async';
export function main() {
function asyncValidator(expected, timeouts = /*@ts2dart_const*/ {}) {

View File

@ -6,14 +6,17 @@ import {
xit,
expect,
beforeEach,
afterEach,
afterEach
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
tick,
el
} from 'angular2/testing_internal';
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from 'angular2/common';
import {PromiseWrapper} from 'angular2/src/facade/promise';
import {EventEmitter, ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
flushMicrotasks,
Log,
tick
} from '@angular/core/testing';
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common';
import {PromiseWrapper} from '../../src/facade/promise';
import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async';
export function main() {
function validator(key: string, error: any) {

View File

@ -7,23 +7,22 @@ import {
expect,
beforeEach,
afterEach,
AsyncTestCompleter,
inject,
browserDetection
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {SpyChangeDetectorRef} from '../spies';
import {isBlank} from 'angular2/src/facade/lang';
import {AsyncPipe} from 'angular2/common';
import {WrappedValue} from 'angular2/core';
import {isBlank} from '../../src/facade/lang';
import {AsyncPipe} from '@angular/common';
import {WrappedValue} from '@angular/core';
import {
EventEmitter,
ObservableWrapper,
PromiseWrapper,
TimerWrapper
} from 'angular2/src/facade/async';
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
import {PromiseCompleter} from 'angular2/src/facade/promise';
} from '../../src/facade/async';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {PromiseCompleter} from '../../src/facade/promise';
import {browserDetection} from '@angular/platform-browser/testing';
export function main() {
describe("AsyncPipe", () => {
@ -121,7 +120,7 @@ export function main() {
var completer: PromiseCompleter<any>;
var ref: SpyChangeDetectorRef;
// 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(() => {
completer = PromiseWrapper.completer();

View File

@ -6,13 +6,13 @@ import {
xit,
expect,
beforeEach,
afterEach,
browserDetection
} from 'angular2/testing_internal';
afterEach
} from '@angular/core/testing/testing_internal';
import {browserDetection} from '@angular/platform-browser/testing';
import {DatePipe} from 'angular2/common';
import {DateWrapper} from 'angular2/src/facade/lang';
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
import {DatePipe} from '@angular/common';
import {DateWrapper} from '../../src/facade/lang';
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("DatePipe", () => {

View File

@ -7,10 +7,10 @@ import {
expect,
beforeEach,
afterEach
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {I18nPluralPipe} from 'angular2/common';
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
import {I18nPluralPipe} from '@angular/common';
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("I18nPluralPipe", () => {

View File

@ -7,10 +7,10 @@ import {
expect,
beforeEach,
afterEach
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {I18nSelectPipe} from 'angular2/common';
import {PipeResolver} from 'angular2/src/compiler/pipe_resolver';
import {I18nSelectPipe} from '@angular/common';
import {PipeResolver} from '@angular/compiler/src/pipe_resolver';
export function main() {
describe("I18nSelectPipe", () => {

View File

@ -7,14 +7,14 @@ import {
expect,
beforeEach,
afterEach,
AsyncTestCompleter,
inject,
TestComponentBuilder
} from 'angular2/testing_internal';
import {Json, RegExp, NumberWrapper, StringWrapper} from 'angular2/src/facade/lang';
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {Json, RegExp, NumberWrapper, StringWrapper} from '../../src/facade/lang';
import {Component} from 'angular2/core';
import {JsonPipe} from 'angular2/common';
import {Component} from '@angular/core';
import {JsonPipe} from '@angular/common';
export function main() {
describe("JsonPipe", () => {

View File

@ -7,9 +7,9 @@ import {
expect,
beforeEach,
afterEach
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {LowerCasePipe} from 'angular2/common';
import {LowerCasePipe} from '@angular/common';
export function main() {
describe("LowerCasePipe", () => {

View File

@ -7,10 +7,10 @@ import {
expect,
beforeEach,
afterEach,
browserDetection
} from 'angular2/testing_internal';
} from '@angular/core/testing/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() {
describe('Number pipes', () => {

View File

@ -7,14 +7,12 @@ import {
expect,
beforeEach,
afterEach,
browserDetection,
inject,
TestComponentBuilder,
AsyncTestCompleter
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {ReplacePipe} from 'angular2/common';
import {RegExpWrapper, StringJoiner} from 'angular2/src/facade/lang';
import {ReplacePipe} from '@angular/common';
import {RegExpWrapper, StringJoiner} from '../../src/facade/lang';
export function main() {
describe("ReplacePipe", () => {

View File

@ -7,14 +7,15 @@ import {
expect,
beforeEach,
afterEach,
browserDetection,
inject,
TestComponentBuilder,
AsyncTestCompleter
} from 'angular2/testing_internal';
} from '@angular/core/testing/testing_internal';
import {} from '@angular/core/testing/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 {SlicePipe} from 'angular2/common';
import {Component} from '@angular/core';
import {SlicePipe} from '@angular/common';
export function main() {
describe("SlicePipe", () => {

View File

@ -7,9 +7,8 @@ import {
expect,
beforeEach,
afterEach
} from 'angular2/testing_internal';
import {UpperCasePipe} from 'angular2/common';
} from '@angular/core/testing/testing_internal';
import {UpperCasePipe} from '@angular/common';
export function main() {
describe("UpperCasePipe", () => {

View File

@ -1,5 +1,5 @@
import {ChangeDetectorRef} from 'angular2/src/core/change_detection/change_detector_ref';
import {SpyObject, proxy} from 'angular2/testing_internal';
import {ChangeDetectorRef} from '@angular/core/src/change_detection/change_detector_ref';
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';
export class SpyChangeDetectorRef extends SpyObject {
constructor() {
@ -10,4 +10,6 @@ export class SpyChangeDetectorRef extends SpyObject {
export class SpyNgControl extends SpyObject {}
export class SpyValueAccessor extends SpyObject {}
export class SpyValueAccessor extends SpyObject {
writeValue: any;
}

View File

@ -0,0 +1,2 @@
export {MockLocationStrategy} from './testing/mock_location_strategy';
export {SpyLocation} from './testing/location_mock';

View File

@ -1,7 +1,6 @@
import {Injectable} from 'angular2/src/core/di';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {ListWrapper} from 'angular2/src/facade/collection';
import {Location} from 'angular2/platform/common';
import {Injectable, EventEmitter} from '@angular/core';
import {ObservableWrapper} from '../src/facade/async';
import {Location} from '../index';
/**
* A spy for {@link Location} that allows tests to fire simulated location events.

View File

@ -1,6 +1,6 @@
import {Injectable} from 'angular2/src/core/di';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {LocationStrategy} from 'angular2/platform/common';
import {Injectable} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../src/facade/async';
import {LocationStrategy} from '../index';
/**

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/esm",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core"]
},
"rootDir": ".",
"sourceMap": true,
"sourceRoot": ".",
"target": "es2015"
},
"files": [
"index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
]
}

View File

@ -0,0 +1,27 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core/"]
},
"rootDir": ".",
"sourceMap": true,
"sourceRoot": ".",
"target": "es5"
},
"files": [
"index.ts",
"testing.ts",
"../typings/es6-collections/es6-collections.d.ts",
"../typings/es6-promise/es6-promise.d.ts",
"../manual_typings/globals.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
]
}

View File

@ -3,9 +3,8 @@
* @description
* Starting point to import all compiler APIs.
*/
export {ElementSchemaRegistry} from './src/schema/element_schema_registry';
export {
PLATFORM_DIRECTIVES,
PLATFORM_PIPES,
COMPILER_PROVIDERS,
TEMPLATE_TRANSFORMS,
CompilerConfig,
@ -32,6 +31,7 @@ export {
CompileTemplateMetadata,
CompileDirectiveMetadata,
CompilePipeMetadata
} from 'angular2/src/compiler/compiler';
} from './src/compiler';
export * from 'angular2/src/compiler/template_ast';
export * from './src/template_ast';
export * from './private_export';

View File

@ -0,0 +1 @@
export '../core/private_export.dart';

View File

@ -0,0 +1,52 @@
import {__core_private__ as r, __core_private_types__ as t} from '@angular/core';
export var isDefaultChangeDetectionStrategy: typeof t.isDefaultChangeDetectionStrategy = r.isDefaultChangeDetectionStrategy;
export type ChangeDetectorState = t.ChangeDetectorState;
export var ChangeDetectorState: typeof t.ChangeDetectorState = r.ChangeDetectorState;
export var CHANGE_DETECTION_STRATEGY_VALUES: typeof t.CHANGE_DETECTION_STRATEGY_VALUES = r.CHANGE_DETECTION_STRATEGY_VALUES;
export var constructDependencies: typeof t.constructDependencies = r.constructDependencies;
export type LifecycleHooks = t.LifecycleHooks;
export var LifecycleHooks: typeof t.LifecycleHooks = r.LifecycleHooks;
export var LIFECYCLE_HOOKS_VALUES: typeof t.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
export type ReflectorReader = t.ReflectorReader;
export var ReflectorReader: typeof t.ReflectorReader = r.ReflectorReader;
export var ReflectorComponentResolver: typeof t.ReflectorComponentResolver = r.ReflectorComponentResolver;
export type AppElement = t.AppElement;
export var AppElement: typeof t.AppElement = r.AppElement;
export var AppView: typeof t.AppView = r.AppView;
export type DebugAppView<T> = t.DebugAppView<T>;
export var DebugAppView: typeof t.DebugAppView = r.DebugAppView;
export type ViewType = t.ViewType;
export var ViewType: typeof t.ViewType = r.ViewType;
export var MAX_INTERPOLATION_VALUES: typeof t.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES;
export var checkBinding: typeof t.checkBinding = r.checkBinding;
export var flattenNestedViewRenderNodes: typeof t.flattenNestedViewRenderNodes = r.flattenNestedViewRenderNodes;
export var interpolate: typeof t.interpolate = r.interpolate;
export var ViewUtils: typeof t.ViewUtils = r.ViewUtils;
export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES;
export var DebugContext: typeof t.DebugContext = r.DebugContext;
export var StaticNodeDebugInfo: typeof t.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
export var devModeEqual: typeof t.devModeEqual = r.devModeEqual;
export var uninitialized: typeof t.uninitialized = r.uninitialized;
export var ValueUnwrapper: typeof t.ValueUnwrapper = r.ValueUnwrapper;
export var TemplateRef_: typeof t.TemplateRef_ = r.TemplateRef_;
export type RenderDebugInfo = t.RenderDebugInfo;
export var RenderDebugInfo: typeof t.RenderDebugInfo = r.RenderDebugInfo;
export var createProvider: typeof t.createProvider = r.createProvider;
export var isProviderLiteral: typeof t.isProviderLiteral = r.isProviderLiteral;
export var EMPTY_ARRAY: typeof t.EMPTY_ARRAY = r.EMPTY_ARRAY;
export var EMPTY_MAP: typeof t.EMPTY_MAP = r.EMPTY_MAP;
export var pureProxy1: typeof t.pureProxy1 = r.pureProxy1;
export var pureProxy2: typeof t.pureProxy2 = r.pureProxy2;
export var pureProxy3: typeof t.pureProxy3 = r.pureProxy3;
export var pureProxy4: typeof t.pureProxy4 = r.pureProxy4;
export var pureProxy5: typeof t.pureProxy5 = r.pureProxy5;
export var pureProxy6: typeof t.pureProxy6 = r.pureProxy6;
export var pureProxy7: typeof t.pureProxy7 = r.pureProxy7;
export var pureProxy8: typeof t.pureProxy8 = r.pureProxy8;
export var pureProxy9: typeof t.pureProxy9 = r.pureProxy9;
export var pureProxy10: typeof t.pureProxy10 = r.pureProxy10;
export var castByValue: typeof t.castByValue = r.castByValue;
export type Console = t.Console;
export var Console: typeof t.Console = r.Console;

View File

@ -0,0 +1 @@
export * from './compiler';

View File

@ -0,0 +1,13 @@
{
"name": "@angular/compiler",
"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$$"
}
}

View File

@ -0,0 +1 @@
export './src/core/change_detection/constants.dart' show SelectorMatcher, CssSelector;

View File

@ -0,0 +1,9 @@
import * as selector from './src/selector';
export namespace __compiler_private__ {
export type SelectorMatcher = selector.SelectorMatcher;
export var SelectorMatcher = selector.SelectorMatcher;
export type CssSelector = selector.CssSelector;
export var CssSelector = selector.CssSelector;
}

View File

@ -0,0 +1,18 @@
export default {
entry: '../../../dist/packages-dist/compiler/esm/index.js',
dest: '../../../dist/packages-dist/compiler/esm/compiler.umd.js',
sourceMap: true,
format: 'umd',
moduleName: 'ng.compiler',
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 }),
]
}

View File

@ -1,5 +1,5 @@
import {isArray, isString, isBlank, assertionsEnabled} from '../facade/lang';
import {BaseException} from '../facade/exceptions';
import {isArray, isString, isBlank, assertionsEnabled} from '../src/facade/lang';
import {BaseException} from '../src/facade/exceptions';
export function assertArrayOfStrings(identifier: string, value: any) {
if (!assertionsEnabled() || isBlank(value)) {

View File

@ -1,3 +1,11 @@
import {ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {
CHANGE_DETECTION_STRATEGY_VALUES,
VIEW_ENCAPSULATION_VALUES,
LifecycleHooks,
LIFECYCLE_HOOKS_VALUES
} from '../core_private';
import {
isPresent,
isBlank,
@ -9,24 +17,14 @@ import {
Type,
isString,
RegExpWrapper,
StringWrapper,
isArray
} from 'angular2/src/facade/lang';
import {unimplemented, BaseException} from 'angular2/src/facade/exceptions';
} from '../src/facade/lang';
import {unimplemented, BaseException} from '../src/facade/exceptions';
import {
StringMapWrapper,
MapWrapper,
SetWrapper,
ListWrapper
} from 'angular2/src/facade/collection';
import {
ChangeDetectionStrategy,
CHANGE_DETECTION_STRATEGY_VALUES
} from 'angular2/src/core/change_detection/change_detection';
import {ViewEncapsulation, VIEW_ENCAPSULATION_VALUES} from 'angular2/src/core/metadata/view';
import {CssSelector} from 'angular2/src/compiler/selector';
} from '../src/facade/collection';
import {CssSelector} from './selector';
import {splitAtColon, sanitizeIdentifier} from './util';
import {LifecycleHooks, LIFECYCLE_HOOKS_VALUES} from 'angular2/src/core/metadata/lifecycle_hooks';
import {getUrlScheme} from './url_resolver';
// group 1: "property" from "[property]"
@ -318,9 +316,7 @@ export class CompileTokenMetadata implements CompileMetadataWithIdentifier {
(isPresent(ak) && ak == token2.assetCacheKey);
}
get name(): string {
return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name;
}
get name(): string { return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name; }
}
export class CompileTokenMap<VALUE> {

Some files were not shown because too many files have changed in this diff Show More