diff --git a/.travis.yml b/.travis.yml
index c8c12208bc..4be0d614e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ env:
- DISPLAY=:99.0
- CHROME_BIN=chromium-browser
# using SHA instead of version to fix build-compile issue
- - LATEST_RELEASE=cfc12c653970c9ad6d807a6a8ebff58edbc568a0
+ - LATEST_RELEASE=2.1.0
- TASK_FLAGS="--dgeni-log=warn"
matrix:
- TASK=lint
diff --git a/firebase.json b/firebase.json
index 069b61f208..90419f857a 100644
--- a/firebase.json
+++ b/firebase.json
@@ -4,7 +4,7 @@
"rewrites": [
{
"source": "/docs/dart/latest/testing",
- "destination": "/docs/dart/latest/index.html"
+ "destination":"/docs/dart/latest/guide/testing.html"
},
{
"source": "/docs/dart/latest/tutorial",
@@ -12,7 +12,7 @@
},
{
"source": "/docs/js/latest/testing",
- "destination": "/docs/js/latest/index.html"
+ "destination": "/docs/js/latest/guide/testing.html"
},
{
"source": "/docs/js/latest/tutorial",
diff --git a/gulpfile.js b/gulpfile.js
index 0d137ded2e..b4ff433065 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -37,7 +37,7 @@ var TEMP_PATH = './_temp';
var DOCS_PATH = path.join(PUBLIC_PATH, 'docs');
var EXAMPLES_PATH = path.join(DOCS_PATH, '_examples');
-var EXAMPLES_PROTRACTOR_PATH = path.join(EXAMPLES_PATH, '_protractor');
+var BOILERPLATE_PATH = path.join(EXAMPLES_PATH, '_boilerplate');
var EXAMPLES_TESTING_PATH = path.join(EXAMPLES_PATH, 'testing/ts');
var NOT_API_DOCS_GLOB = path.join(PUBLIC_PATH, './{docs/*/latest/!(api),!(docs)}/**/*.*');
var RESOURCES_PATH = path.join(PUBLIC_PATH, 'resources');
@@ -50,6 +50,8 @@ var regularPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/regularPl
var embeddedPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/embeddedPlunker'));
var fsUtils = require(path.resolve(TOOLS_PATH, 'fs-utils/fsUtils'));
+const WWW = argv.page ? 'www-pages' : 'www'
+
const isSilent = !!argv.silent;
if (isSilent) gutil.log = gutil.noop;
const _dgeniLogLevel = argv.dgeniLog || (isSilent ? 'error' : 'info');
@@ -77,7 +79,7 @@ var _apiShredOptions = {
const relDartDocApiDir = path.join('doc', 'api');
var _apiShredOptionsForDart = {
lang: 'dart',
- examplesDir: path.resolve(ngPathFor('dart'), 'example'),
+ examplesDir: path.resolve(ANGULAR_PROJECT_PATH + '2_api_examples'),
fragmentsDir: path.join(DOCS_PATH, '_fragments/_api'),
zipDir: path.join(RESOURCES_PATH, 'zips/api'),
logLevel: _dgeniLogLevel
@@ -90,22 +92,16 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){
});
var _exampleBoilerplateFiles = [
- '.editorconfig',
'a2docs.css',
'package.json',
'styles.css',
'systemjs.config.js',
'tsconfig.json',
- 'tslint.json',
- 'typings.json'
+ 'tslint.json'
];
var _exampleDartWebBoilerPlateFiles = ['a2docs.css', 'styles.css'];
-var _exampleProtractorBoilerplateFiles = [
- 'tsconfig.json'
-];
-
var _exampleUnitTestingBoilerplateFiles = [
'karma-test-shim.js',
'karma.conf.js'
@@ -203,18 +199,13 @@ function runE2e() {
});
*/
// Not 'fast'; do full setup
- gutil.log('runE2e: install _protractor stuff');
- var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PROTRACTOR_PATH});
+ gutil.log('runE2e: install _examples stuff');
+ var spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH});
promise = spawnInfo.promise
- .then(function() {
- gutil.log('runE2e: install _examples stuff');
- spawnInfo = spawnExt('npm', ['install'], { cwd: EXAMPLES_PATH})
- return spawnInfo.promise;
- })
.then(function() {
buildStyles(copyExampleBoilerplate, _.noop);
gutil.log('runE2e: update webdriver');
- spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PROTRACTOR_PATH});
+ spawnInfo = spawnExt('npm', ['run', 'webdriver:update'], {cwd: EXAMPLES_PATH});
return spawnInfo.promise;
});
};
@@ -249,11 +240,10 @@ function findAndRunE2eTests(filter, outputFile) {
fs.writeFileSync(outputFile, header);
// create an array of combos where each
- // combo consists of { examplePath: ... , protractorConfigFilename: ... }
+ // combo consists of { examplePath: ... }
var examplePaths = [];
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
e2eSpecPaths.forEach(function(specPath) {
- var destConfig = path.join(specPath, 'protractor.config.js');
// get all of the examples under each dir where a pcFilename is found
localExamplePaths = getExamplePaths(specPath, true);
// Filter by language
@@ -306,7 +296,12 @@ function runE2eTsTests(appDir, outputFile) {
var appBuildSpawnInfo = spawnExt('npm', ['run', config.build], { cwd: appDir });
var appRunSpawnInfo = spawnExt('npm', ['run', config.run, '--', '-s'], { cwd: appDir });
- return runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
+ var run = runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile);
+
+ if (fs.existsSync(appDir + '/aot/index.html')) {
+ run = run.then(() => runProtractorAoT(appDir, outputFile));
+ }
+ return run;
}
function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
@@ -324,7 +319,7 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
// start protractor
var spawnInfo = spawnExt('npm', [ 'run', 'protractor', '--', 'protractor.config.js',
- `--specs=${specFilename}`, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: EXAMPLES_PROTRACTOR_PATH });
+ `--specs=${specFilename}`, '--params.appDir=' + appDir, '--params.outputFile=' + outputFile], { cwd: EXAMPLES_PATH });
spawnInfo.proc.stderr.on('data', function (data) {
transpileError = transpileError || /npm ERR! Exit status 100/.test(data.toString());
@@ -351,6 +346,20 @@ function runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile) {
}
}
+function runProtractorAoT(appDir, outputFile) {
+ fs.appendFileSync(outputFile, '++ AoT version ++\n');
+ var aotBuildSpawnInfo = spawnExt('npm', ['run', 'build:aot'], { cwd: appDir });
+ var promise = aotBuildSpawnInfo.promise;
+
+ var copyFileCmd = 'copy-dist-files.js';
+ if (fs.existsSync(appDir + '/' + copyFileCmd)) {
+ promise = promise.then(() =>
+ spawnExt('node', [copyFileCmd], { cwd: appDir }).promise );
+ }
+ var aotRunSpawnInfo = spawnExt('npm', ['run', 'http-server:e2e', 'aot', '--', '-s'], { cwd: appDir });
+ return runProtractor(promise, appDir, aotRunSpawnInfo, outputFile);
+}
+
// start the server in appDir/build/web; then run protractor with the specified
// fileName; then shut down the example. All protractor output is appended
// to the outputFile.
@@ -475,7 +484,7 @@ gulp.task('_copy-example-boilerplate', function (done) {
function buildStyles(cb, done){
gulp.src(path.join(STYLES_SOURCE_PATH, _styleLessName))
.pipe(less())
- .pipe(gulp.dest(EXAMPLES_PATH)).on('end', function(){
+ .pipe(gulp.dest(BOILERPLATE_PATH)).on('end', function(){
cb().then(function() { done(); });
});
}
@@ -486,12 +495,12 @@ function buildStyles(cb, done){
function copyExampleBoilerplate() {
gutil.log('Copying example boilerplate files');
var sourceFiles = _exampleBoilerplateFiles.map(function(fn) {
- return path.join(EXAMPLES_PATH, fn);
+ return path.join(BOILERPLATE_PATH, fn);
});
var examplePaths = excludeDartPaths(getExamplePaths(EXAMPLES_PATH));
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
- return path.join(EXAMPLES_PATH, fn);
+ return path.join(BOILERPLATE_PATH, fn);
});
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
@@ -501,14 +510,6 @@ function copyExampleBoilerplate() {
.then(function() {
return copyFiles(dartWebSourceFiles, dartExampleWebPaths, destFileMode);
})
- // copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
- .then(function() {
- var protractorSourceFiles =
- _exampleProtractorBoilerplateFiles
- .map(function(name) {return path.join(EXAMPLES_PROTRACTOR_PATH, name); });
- var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
- return copyFiles(protractorSourceFiles, e2eSpecPaths, destFileMode);
- })
// copy the unit test boilerplate
.then(function() {
var unittestSourceFiles =
@@ -516,6 +517,10 @@ function copyExampleBoilerplate() {
.map(function(name) { return path.join(EXAMPLES_TESTING_PATH, name); });
var unittestPaths = getUnitTestingPaths(EXAMPLES_PATH);
return copyFiles(unittestSourceFiles, unittestPaths, destFileMode);
+ })
+ .catch(function(err) {
+ gutil.log(err);
+ throw err;
});
}
@@ -594,11 +599,6 @@ function deleteExampleBoilerPlate() {
return deleteFiles(_exampleBoilerplateFiles, examplePaths)
.then(function() {
return deleteFiles(_exampleDartWebBoilerPlateFiles, dartExampleWebPaths);
- })
- .then(function() {
- var protractorFiles = _exampleProtractorBoilerplateFiles;
- var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
- return deleteFiles(protractorFiles, e2eSpecPaths);
});
}
@@ -747,7 +747,7 @@ gulp.task('harp-serve', () => {
gulp.task('serve-www', () => {
// Serve generated site.
- return execPromise('npm run live-server ./www');
+ return execPromise(`npm run live-server ${WWW}`);
});
gulp.task('build-compile', ['build-docs'], function() {
@@ -758,7 +758,7 @@ gulp.task('check-deploy', ['build-docs'], function() {
return harpCompile().then(function() {
gutil.log('compile ok');
gutil.log('running live server ...');
- execPromise('npm run live-server ./www');
+ execPromise(`npm run live-server ${WWW}`);
return askDeploy();
}).then(function(shouldDeploy) {
if (shouldDeploy) {
@@ -818,7 +818,7 @@ gulp.task('_harp-compile', function() {
gulp.task('_shred-devguide-examples', ['_shred-clean-devguide', '_copy-example-boilerplate'], function() {
// Split big shredding task into partials 2016-06-14
- var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/', '_protractor/']});
+ var examplePaths = globby.sync(EXAMPLES_PATH+'/*/', {ignore: ['/node_modules', 'typings/']});
var promise = Promise.resolve(true);
examplePaths.forEach(function (examplePath) {
promise = promise.then(() => docShredder.shredSingleExampleDir(_devguideShredOptions, examplePath));
@@ -877,7 +877,6 @@ gulp.task('lint', function() {
'!./public/docs/_examples/**/ts-snippets/*.ts',
'!./public/docs/_examples/style-guide/ts/**/*.avoid.ts',
'!./public/docs/_examples/**/node_modules/**/*',
- '!./public/docs/_examples/_protractor/**/*',
'!./public/docs/_examples/**/typings/**/*',
'!./public/docs/_examples/**/typings-ng1/**/*',
'!./public/docs/_examples/**/build/**/*',
@@ -902,11 +901,13 @@ function harpCompile() {
env({ vars: { NODE_ENV: "production" } });
gutil.log("NODE_ENV: " + process.env.NODE_ENV);
- if(skipLangs && fs.existsSync('www') && backupApiHtmlFilesExist('www')) {
+ if(argv.page) harpJsonSetJade2NgTo(true);
+
+ if(skipLangs && fs.existsSync(WWW) && backupApiHtmlFilesExist(WWW)) {
gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`);
- gutil.log(`API docs will be copied from existing www folder.`)
- del.sync('www-backup'); // remove existing backup if it exists
- renameIfExistsSync('www', 'www-backup');
+ gutil.log(`API docs will be copied from existing ${WWW} folder.`)
+ del.sync(`${WWW}-backup`); // remove existing backup if it exists
+ renameIfExistsSync(WWW, `${WWW}-backup`);
} else {
gutil.log(`Harp full site compile, including API docs for all languages.`);
if (skipLangs)
@@ -918,11 +919,12 @@ function harpCompile() {
gutil.log('running harp compile...');
showHideExampleNodeModules('hide');
showHideApiDir('hide');
- var spawnInfo = spawnExt('npm',['run','harp', '--', 'compile', '.', './www' ]);
+ var spawnInfo = spawnExt('npm',['run','harp', '--', 'compile', '.', WWW ]);
spawnInfo.promise.then(function(x) {
gutil.log("NODE_ENV: " + process.env.NODE_ENV);
showHideExampleNodeModules('show');
showHideApiDir('show');
+ harpJsonSetJade2NgTo(false);
if (x !== 0) {
deferred.reject(x)
} else {
@@ -933,6 +935,7 @@ function harpCompile() {
gutil.log("NODE_ENV: " + process.env.NODE_ENV);
showHideExampleNodeModules('show');
showHideApiDir('show');
+ harpJsonSetJade2NgTo(false);
deferred.reject(e);
});
return deferred.promise;
@@ -1050,21 +1053,21 @@ function _showHideApiDir(lang, showOrHide) {
renameIfExistsSync(...args);
}
-// For each lang in skipLangs, copy the API dir from www-backup to www.
+// For each lang in skipLangs, copy the API dir from ${WWW}-backup to WWW.
function restoreApiHtml() {
const vers = 'latest';
skipLangs.forEach(lang => {
const relApiDir = path.join('docs', lang, vers, 'api');
- const wwwApiSubdir = path.join('www', relApiDir);
- const backupApiSubdir = path.join('www-backup', relApiDir);
+ const apiSubdir = path.join(WWW, relApiDir);
+ const backupApiSubdir = path.join(`${WWW}-backup`, relApiDir);
if (fs.existsSync(backupApiSubdir) || argv.forceSkipApi !== true) {
- gutil.log(`cp ${backupApiSubdir} ${wwwApiSubdir}`)
- fs.copySync(backupApiSubdir, wwwApiSubdir);
+ gutil.log(`cp ${backupApiSubdir} ${apiSubdir}`)
+ fs.copySync(backupApiSubdir, apiSubdir);
}
});
}
-// For each lang in skipLangs, ensure API dir exists in www-backup
+// For each lang in skipLangs, ensure API dir exists in folderName
function backupApiHtmlFilesExist(folderName) {
const vers = 'latest';
var result = 1;
@@ -1079,6 +1082,14 @@ function backupApiHtmlFilesExist(folderName) {
return result;
}
+function harpJsonSetJade2NgTo(v) {
+ const execSync = require('child_process').execSync;
+ const harpJsonPath = path.join(ANGULAR_IO_PROJECT_PATH, 'harp.json');
+ execSync(`perl -pi -e 's/("jade2ng": *)\\w+/$1${v}/' ${harpJsonPath}`);
+ const harpJson = require(harpJsonPath);
+ gutil.log(`jade2ng: ${harpJson.globals.jade2ng}`);
+}
+
// Copies fileNames into destPaths, setting the mode of the
// files at the destination as optional_destFileMode if given.
// returns a promise
@@ -1138,7 +1149,7 @@ function getTypingsPaths(basePath) {
function getExamplePaths(basePath, includeBase) {
// includeBase defaults to false
- return getPaths(basePath, _exampleConfigFilename, includeBase)
+ return getPaths(basePath, _exampleConfigFilename, includeBase);
}
function getDartExampleWebPaths(basePath) {
@@ -1169,6 +1180,8 @@ function getFilenames(basePath, filename, includeBase) {
// ignore (skip) the top level version.
includePatterns.push("!" + path.join(basePath, "/" + filename));
}
+ // ignore (skip) the files in BOILERPLATE_PATH.
+ includePatterns.push("!" + path.join(BOILERPLATE_PATH, "/" + filename));
var nmPattern = path.join(basePath, "**/node_modules/**");
var filenames = globby.sync(includePatterns, {ignore: [nmPattern]});
return filenames;
diff --git a/harp.json b/harp.json
index 0f38b0cec0..a4a2f0c878 100644
--- a/harp.json
+++ b/harp.json
@@ -4,8 +4,9 @@
"description": "Angular是用于构建移动应用和桌面Web应用的开发平台",
"keywords": "Angular, 中文, 中文版, AngularJS, AngularDart, Javscript, Dart, Framework, JavaScript MVC, Google",
"siteURL": "https://angular.cn",
- "jsLatest": "2.0.0-RC.4",
- "dartLatest": "2.0.0-RC.4",
+ "jsLatest": "2.0.0-beta.02",
+ "dartLatest": "2.0.0-beta.02",
+ "jade2ng": false,
"bios": {
"misko": {
diff --git a/package.json b/package.json
index 5ab4ceea6d..c15d92ecb3 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
"q": "^1.4.1",
"tree-kill": "^1.0.0",
"tslint": "^3.15.1",
+ "typescript": "^2.0.3",
"yargs": "^4.7.1"
},
"dependencies": {
diff --git a/public/_includes/_hero-home.jade b/public/_includes/_hero-home.jade
index 86426e4725..fc592781b2 100644
--- a/public/_includes/_hero-home.jade
+++ b/public/_includes/_hero-home.jade
@@ -7,6 +7,6 @@ header(class="background-sky l-relative")
announcement-bar
.announcement-bar-slide.clearfix
- img(src="/resources/images/logos/angular2/angular-logo-banner.png")
- p Angular 2.0正式发布啦!
- a(href="/translate/cn/blog.html" class="button " + "md-button") 了解更多
\ No newline at end of file
+ img(src="/resources/images/logos/anglebrackets/anglebrackets.png" width="64")
+ p 参加十月25号到28号的洛杉矶的Anglebrackets大会!
+ a(href="https://anglebrackets.org/#!/" target="_blank" class="button md-button") 立即注册
diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade
index 5624ad9cff..87e6f96a5c 100644
--- a/public/_includes/_hero.jade
+++ b/public/_includes/_hero.jade
@@ -1,4 +1,4 @@
-// template: public/_includes/_hero
+//- template: public/_includes/_hero
//- Refer to jade.template.html and addJadeDataDocsProcessor to figure out where the context of this jade file originates
- var textFormat = '';
- var headerTitle = title + (typeof varType !== 'undefined' ? (': ' + varType) : '');
@@ -24,16 +24,14 @@ header.hero.background-sky
span(class="badge is-deprecated").
安全风险
- //CLEAR FLOAT ELEMENTS
+ //- CLEAR FLOAT ELEMENTS
.clear
if subtitle
h2.hero-subtitle #{subtitle}
-
else if docType
h2.hero-subtitle #{renamer(capitalize(docType))}
-
-if current.path[3] == 'api' && current.path[1] == 'dart'
- block breadcrumbs
+ if current.path[3] == 'api' && current.path[1] == 'dart'
+ block breadcrumbs
diff --git a/public/_includes/_scripts-include.jade b/public/_includes/_scripts-include.jade
index 44dd1eccb6..af71717825 100644
--- a/public/_includes/_scripts-include.jade
+++ b/public/_includes/_scripts-include.jade
@@ -39,12 +39,3 @@ script(src="/resources/js/directives/if-docs.js")
script(src="/resources/js/directives/live-example.js")
script(src="/resources/js/directives/ngio-ex-path.js")
script(src="/resources/js/directives/scroll-y-offset-element.js")
-
-script.
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-80456300-1', 'auto');
- ga('send', 'pageview');
diff --git a/public/_includes/_scripts-minimum.jade b/public/_includes/_scripts-minimum.jade
new file mode 100644
index 0000000000..a568f88d15
--- /dev/null
+++ b/public/_includes/_scripts-minimum.jade
@@ -0,0 +1,27 @@
+
+script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-8594346-15', 'auto');
+ ga('send', 'pageview')
+
+
+if current.path[0] == "docs" || current.path[0] == "search"
+script.
+ (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
+ (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
+ e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
+ })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
+
+ _st('install','VsuU7kH5Hnnj9tfyNvfK','2.0.0');
+
+
+
+script(src="//www.gstatic.com/feedback/api.js" type="text/javascript")
+
+
+script.
+ (function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}})(document,"script","twitter-wjs");
diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade
index 7ccb87f237..29639891e5 100644
--- a/public/_includes/_util-fns.jade
+++ b/public/_includes/_util-fns.jade
@@ -302,7 +302,7 @@ if !jade2ng
- } else {
- // ``` gets translated to
.....
and we need
- // to remove this from the fragment prefix is 11 long and suffix is 13 long
-- frag = jade2ng ? frag : frag.substring(11, frag.length-13);
+- frag = frag.substring(11, frag.length-13);
- // Uncomment next line for debugging.
- // frag = "FileName: " + fullFileName + " Current path: " + current.path + " PathToDocs: " + getPathToDocs() + "\n" + frag;
- return frag;
diff --git a/public/_layout.jade b/public/_layout.jade
index aef7728caa..358f4c1ccd 100644
--- a/public/_layout.jade
+++ b/public/_layout.jade
@@ -19,4 +19,5 @@ html(lang="en" ng-app="angularIOApp" itemscope itemtype="http://schema.org/Frame
!= yield
!= partial("/_includes/_footer")
- != partial("/_includes/_scripts-include")
\ No newline at end of file
+ != partial("/_includes/_scripts-include")
+ != partial("/_includes/_scripts-minimum")
\ No newline at end of file
diff --git a/public/docs/_examples/.gitignore b/public/docs/_examples/.gitignore
index 768c5e9d97..3e900ec40a 100644
--- a/public/docs/_examples/.gitignore
+++ b/public/docs/_examples/.gitignore
@@ -10,7 +10,6 @@ tslint.json
typings.json
wallaby.js
-protractor.config.js
_test-output
**/ts/**/*.js
**/ts-snippets/**/*.js
@@ -18,3 +17,5 @@ _test-output
!**/*e2e-spec.js
!systemjs.config.1.js
+!_boilerplate/*
+_boilerplate/a2docs.css
diff --git a/public/docs/_examples/example-config.json b/public/docs/_examples/_boilerplate/example-config.json
similarity index 100%
rename from public/docs/_examples/example-config.json
rename to public/docs/_examples/_boilerplate/example-config.json
diff --git a/public/docs/_examples/_boilerplate/package.json b/public/docs/_examples/_boilerplate/package.json
new file mode 100644
index 0000000000..758ff6f182
--- /dev/null
+++ b/public/docs/_examples/_boilerplate/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "angular-examples",
+ "version": "1.0.0",
+ "description": "Example package.json, only contains needed scripts for examples. See _examples/package.json for master package.json.",
+ "scripts": {
+ "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
+ "e2e": "tsc && concurrently \"http-server\" \"protractor protractor.config.js\"",
+ "http-server": "tsc && http-server",
+ "http-server:e2e": "http-server",
+ "http-server:cli": "http-server dist/",
+ "lite": "lite-server",
+ "lite:aot": "lite-server -c aot/bs-config.json",
+ "postinstall": "typings install",
+ "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
+ "tsc": "tsc",
+ "tsc:w": "tsc -w",
+ "start:webpack": "webpack-dev-server --inline --progress --port 8080",
+ "test:webpack": "karma start karma.webpack.conf.js",
+ "build:webpack": "rimraf dist && webpack --config config/webpack.prod.js --bail",
+ "build:cli": "ng build",
+ "build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
+ "copy-dist-files": "node ./copy-dist-files.js",
+ "i18n": "ng-xi18n"
+ },
+ "keywords": [],
+ "author": "",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/angular/angular.io/blob/master/LICENSE"
+ }
+ ],
+ "dependencies": {},
+ "devDependencies": {},
+ "repository": {}
+}
diff --git a/public/docs/_examples/plunker.README.md b/public/docs/_examples/_boilerplate/plunker.README.md
similarity index 100%
rename from public/docs/_examples/plunker.README.md
rename to public/docs/_examples/_boilerplate/plunker.README.md
diff --git a/public/docs/_examples/styles.css b/public/docs/_examples/_boilerplate/styles.css
similarity index 100%
rename from public/docs/_examples/styles.css
rename to public/docs/_examples/_boilerplate/styles.css
diff --git a/public/docs/_examples/systemjs.config.js b/public/docs/_examples/_boilerplate/systemjs.config.js
similarity index 100%
rename from public/docs/_examples/systemjs.config.js
rename to public/docs/_examples/_boilerplate/systemjs.config.js
diff --git a/public/docs/_examples/systemjs.config.plunker.build.js b/public/docs/_examples/_boilerplate/systemjs.config.plunker.build.js
similarity index 100%
rename from public/docs/_examples/systemjs.config.plunker.build.js
rename to public/docs/_examples/_boilerplate/systemjs.config.plunker.build.js
diff --git a/public/docs/_examples/systemjs.config.plunker.js b/public/docs/_examples/_boilerplate/systemjs.config.plunker.js
similarity index 100%
rename from public/docs/_examples/systemjs.config.plunker.js
rename to public/docs/_examples/_boilerplate/systemjs.config.plunker.js
diff --git a/public/docs/_examples/_protractor/tsconfig.json b/public/docs/_examples/_boilerplate/tsconfig.json
similarity index 64%
rename from public/docs/_examples/_protractor/tsconfig.json
rename to public/docs/_examples/_boilerplate/tsconfig.json
index 8c87ff4f20..48dda0636f 100644
--- a/public/docs/_examples/_protractor/tsconfig.json
+++ b/public/docs/_examples/_boilerplate/tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
- "target": "es6",
+ "target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
@@ -8,9 +8,11 @@
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
- "suppressImplicitAnyIndexErrors": true
+ "suppressImplicitAnyIndexErrors": true,
+ "types": []
},
- "files": [
- "e2e-spec.ts"
+ "exclude": [
+ "node_modules/*",
+ "**/*-aot.ts"
]
}
diff --git a/public/docs/_examples/tslint.json b/public/docs/_examples/_boilerplate/tslint.json
similarity index 100%
rename from public/docs/_examples/tslint.json
rename to public/docs/_examples/_boilerplate/tslint.json
diff --git a/public/docs/_examples/_protractor/e2e.d.ts b/public/docs/_examples/_protractor/e2e.d.ts
deleted file mode 100644
index ab91658443..0000000000
--- a/public/docs/_examples/_protractor/e2e.d.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-///
-
-// Defined in protractor.config.js
-declare function setProtractorToNg1Mode(): void;
-declare function sendKeys(element: protractor.ElementFinder, str: string): webdriver.promise.Promise;
-declare function describeIf(cond: boolean, name: string, func: Function): void;
-declare function itIf(cond: boolean, name: string, func: Function): void;
-
-declare namespace protractor {
- interface IBrowser {
- appIsTs: boolean;
- appIsJs: boolean;
- }
-}
diff --git a/public/docs/_examples/_protractor/package.json b/public/docs/_examples/_protractor/package.json
deleted file mode 100644
index 1e12742c38..0000000000
--- a/public/docs/_examples/_protractor/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "angular2-examples-protractor",
- "version": "1.0.0",
- "description": "Manage _protractor folder installations",
- "scripts": {
- "postinstall": "typings install",
- "typings": "typings",
- "protractor": "protractor",
- "webdriver:update": "webdriver-manager update"
- },
- "keywords": [],
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "protractor": "^3.3.0",
- "typings": "^1.0.4",
- "ts-node": "^1.3.0",
- "typescript": "^2.0.2"
- },
- "repository": {}
-}
diff --git a/public/docs/_examples/_protractor/typings.json b/public/docs/_examples/_protractor/typings.json
deleted file mode 100644
index a8a5da9134..0000000000
--- a/public/docs/_examples/_protractor/typings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "globalDependencies": {
- "angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459",
- "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
- "node": "registry:dt/node#6.0.0+20160621231320",
- "selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654"
- }
-}
diff --git a/public/docs/_examples/animations/e2e-spec.ts b/public/docs/_examples/animations/e2e-spec.ts
index 31eefbf345..9e5d72a015 100644
--- a/public/docs/_examples/animations/e2e-spec.ts
+++ b/public/docs/_examples/animations/e2e-spec.ts
@@ -1,5 +1,8 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { logging, promise } from 'selenium-webdriver';
+
/**
* The tests here basically just checking that the end styles
* of each animation are in effect.
@@ -23,7 +26,7 @@ describe('Animation Tests', () => {
describe('basic states', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-basic'));
@@ -52,7 +55,7 @@ describe('Animation Tests', () => {
describe('styles inline in transitions', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(function() {
host = element(by.css('hero-list-inline-styles'));
@@ -73,7 +76,7 @@ describe('Animation Tests', () => {
describe('combined transition syntax', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-combined-transitions'));
@@ -102,7 +105,7 @@ describe('Animation Tests', () => {
describe('two-way transition syntax', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-twoway'));
@@ -131,7 +134,7 @@ describe('Animation Tests', () => {
describe('enter & leave', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-enter-leave'));
@@ -151,7 +154,7 @@ describe('Animation Tests', () => {
describe('enter & leave & states', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(function() {
host = element(by.css('hero-list-enter-leave-states'));
@@ -180,7 +183,7 @@ describe('Animation Tests', () => {
describe('auto style calc', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(function() {
host = element(by.css('hero-list-auto'));
@@ -200,7 +203,7 @@ describe('Animation Tests', () => {
describe('different timings', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-timings'));
@@ -221,7 +224,7 @@ describe('Animation Tests', () => {
describe('multiple keyframes', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-multistep'));
@@ -242,7 +245,7 @@ describe('Animation Tests', () => {
describe('parallel groups', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-groups'));
@@ -263,7 +266,7 @@ describe('Animation Tests', () => {
describe('adding active heroes', () => {
- let host: protractor.ElementFinder;
+ let host: ElementFinder;
beforeEach(() => {
host = element(by.css('hero-list-basic'));
@@ -292,13 +295,14 @@ describe('Animation Tests', () => {
describe('callbacks', () => {
it('fires a callback on start and done', () => {
addActiveHero();
- browser.manage().logs().get('browser').then((logs) => {
- const animationMessages = logs.filter((log) => {
- return log.message.indexOf('Animation') !== -1 ? true : false;
- });
+ browser.manage().logs().get(logging.Type.BROWSER)
+ .then((logs: webdriver.logging.Entry[]) => {
+ const animationMessages = logs.filter((log) => {
+ return log.message.indexOf('Animation') !== -1 ? true : false;
+ });
- expect(animationMessages.length).toBeGreaterThan(0);
- });
+ expect(animationMessages.length).toBeGreaterThan(0);
+ });
});
});
@@ -320,8 +324,8 @@ describe('Animation Tests', () => {
browser.driver.sleep(sleep);
}
- function getScaleX(el: protractor.ElementFinder) {
- return protractor.promise.all([
+ function getScaleX(el: ElementFinder) {
+ return Promise.all([
getBoundingClientWidth(el),
getOffsetWidth(el)
]).then(function(promiseResolutions) {
@@ -331,18 +335,17 @@ describe('Animation Tests', () => {
});
}
- function getBoundingClientWidth(el: protractor.ElementFinder): protractor.promise.Promise {
+ function getBoundingClientWidth(el: ElementFinder): promise.Promise {
return browser.executeScript(
'return arguments[0].getBoundingClientRect().width',
el.getWebElement()
);
}
- function getOffsetWidth(el: protractor.ElementFinder): protractor.promise.Promise {
+ function getOffsetWidth(el: ElementFinder): promise.Promise {
return browser.executeScript(
'return arguments[0].offsetWidth',
el.getWebElement()
);
}
-
});
diff --git a/public/docs/_examples/architecture/e2e-spec.ts b/public/docs/_examples/architecture/e2e-spec.ts
index 0bdcdd0069..c1ee8cf00d 100644
--- a/public/docs/_examples/architecture/e2e-spec.ts
+++ b/public/docs/_examples/architecture/e2e-spec.ts
@@ -1,5 +1,6 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { protractor, browser, element, by, ElementFinder } from 'protractor';
const nameSuffix = 'X';
@@ -20,7 +21,7 @@ describe('Architecture', () => {
});
it(`has h2 '${expectedH2}'`, () => {
- let h2 = element.all(by.css('h2')).map((elt) => elt.getText());
+ let h2 = element.all(by.css('h2')).map((elt: any) => elt.getText());
expect(h2).toEqual(expectedH2);
});
@@ -52,7 +53,7 @@ function heroTests() {
it(`shows updated hero name in details`, async () => {
let input = element.all(by.css('input')).first();
- await sendKeys(input, nameSuffix);
+ input.sendKeys(nameSuffix);
let page = getPageElts();
let hero = await heroFromDetail(page.heroDetail);
let newName = targetHero.name + nameSuffix;
@@ -69,7 +70,7 @@ function salesTaxTests() {
it('shows sales tax', async function () {
let page = getPageElts();
- await sendKeys(page.salesTaxAmountInput, '10');
+ page.salesTaxAmountInput.sendKeys('10', protractor.Key.ENTER);
// Note: due to Dart bug USD is shown instead of $
let re = /The sales tax is (\$|USD)1.00/;
expect(page.salesTaxDetail.getText()).toMatch(re);
@@ -87,10 +88,12 @@ function getPageElts() {
};
}
-async function heroFromDetail(detail: protractor.ElementFinder): Promise {
+async function heroFromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
+ // let _id = await detail.all(by.css('div')).first().getText();
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
+ // let _name = await detail.element(by.css('h4')).getText();
let _name = await detail.element(by.css('h4')).getText();
return {
id: +_id.substr(_id.indexOf(' ') + 1),
diff --git a/public/docs/_examples/attribute-directives/e2e-spec.ts b/public/docs/_examples/attribute-directives/e2e-spec.ts
index bf63294648..25a0cf258e 100644
--- a/public/docs/_examples/attribute-directives/e2e-spec.ts
+++ b/public/docs/_examples/attribute-directives/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Attribute directives', function () {
let _title = 'My First Attribute Directive';
diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts
index 9af9b3f21d..8dac46ddd5 100644
--- a/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts
+++ b/public/docs/_examples/cb-a1-a2-quick-reference/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Angular 1 to 2 Quick Reference Tests', function () {
beforeAll(function () {
@@ -100,15 +102,14 @@ describe('Angular 1 to 2 Quick Reference Tests', function () {
let resultLabel = movieListComp.element(by.css('span > p'));
heroInput.clear().then(function () {
- sendKeys(heroInput, heroName || '').then(function () {
- expect(resultLabel.getText()).toBe(expectedLabel);
- if (heroName) {
- expect(favoriteHeroLabel.isDisplayed()).toBe(true);
- expect(favoriteHeroLabel.getText()).toContain(heroName);
- } else {
- expect(favoriteHeroLabel.isDisplayed()).toBe(false);
- }
- });
+ heroInput.sendKeys(heroName || '');
+ expect(resultLabel.getText()).toBe(expectedLabel);
+ if (heroName) {
+ expect(favoriteHeroLabel.isDisplayed()).toBe(true);
+ expect(favoriteHeroLabel.getText()).toContain(heroName);
+ } else {
+ expect(favoriteHeroLabel.isDisplayed()).toBe(false);
+ }
});
}
});
diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app-routing.module.ts
similarity index 63%
rename from public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts
rename to public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app-routing.module.ts
index fb042725eb..a7cbe8a74d 100644
--- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.routing.ts
+++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app-routing.module.ts
@@ -1,5 +1,5 @@
// #docregion
-import { ModuleWithProviders } from '@angular/core';
+import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MovieListComponent } from './movie-list.component';
@@ -9,4 +9,8 @@ const routes: Routes = [
{ path: 'movies', component: MovieListComponent }
];
-export const routing: ModuleWithProviders = RouterModule.forRoot(routes);
+@NgModule({
+ imports: [RouterModule.forRoot(routes)],
+ exports: [RouterModule]
+})
+export class AppRoutingModule {}
diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts
index dec4a4e223..1dc46ad17c 100644
--- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts
+++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.module.ts
@@ -5,13 +5,13 @@ import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { MovieListComponent } from './movie-list.component';
-import { routing } from './app.routing';
+import { AppRoutingModule } from './app-routing.module';
@NgModule({
imports: [
BrowserModule,
FormsModule,
- routing
+ AppRoutingModule
],
declarations: [
AppComponent,
diff --git a/public/docs/_examples/cb-aot-compiler/e2e-spec.ts b/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
index fe72681ee3..b03a771faf 100644
--- a/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
+++ b/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
/* tslint:disable:quotemark */
describe('AOT Compilation', function () {
diff --git a/public/docs/_examples/cb-aot-compiler/ts/.gitignore b/public/docs/_examples/cb-aot-compiler/ts/.gitignore
index f2e297bbd3..2d0d839865 100644
--- a/public/docs/_examples/cb-aot-compiler/ts/.gitignore
+++ b/public/docs/_examples/cb-aot-compiler/ts/.gitignore
@@ -2,4 +2,4 @@
**/*.metadata.json
dist
!app/tsconfig.json
-!rollup.js
\ No newline at end of file
+!rollup-config.js
\ No newline at end of file
diff --git a/public/docs/_examples/cb-aot-compiler/ts/app/app.component.ts b/public/docs/_examples/cb-aot-compiler/ts/app/app.component.ts
index 8352eb83f3..8a86e7d213 100644
--- a/public/docs/_examples/cb-aot-compiler/ts/app/app.component.ts
+++ b/public/docs/_examples/cb-aot-compiler/ts/app/app.component.ts
@@ -13,5 +13,4 @@ export class AppComponent {
toggleHeading() {
this.showHeading = !this.showHeading;
}
-
}
diff --git a/public/docs/_examples/cb-aot-compiler/ts/index.html b/public/docs/_examples/cb-aot-compiler/ts/index.html
index 5d3d6b68c4..3444e6bc45 100644
--- a/public/docs/_examples/cb-aot-compiler/ts/index.html
+++ b/public/docs/_examples/cb-aot-compiler/ts/index.html
@@ -9,7 +9,6 @@
-
diff --git a/public/docs/_examples/cb-aot-compiler/ts/rollup.js b/public/docs/_examples/cb-aot-compiler/ts/rollup-config.js
similarity index 100%
rename from public/docs/_examples/cb-aot-compiler/ts/rollup.js
rename to public/docs/_examples/cb-aot-compiler/ts/rollup-config.js
diff --git a/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json b/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json
index 50cd4b53be..fd8b0617cc 100644
--- a/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json
+++ b/public/docs/_examples/cb-aot-compiler/ts/tsconfig-aot.json
@@ -8,7 +8,8 @@
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
- "suppressImplicitAnyIndexErrors": true
+ "suppressImplicitAnyIndexErrors": true,
+ "types": []
},
"files": [
diff --git a/public/docs/_examples/cb-component-communication/e2e-spec.ts b/public/docs/_examples/cb-component-communication/e2e-spec.ts
index 586dfc94b7..75e319827e 100644
--- a/public/docs/_examples/cb-component-communication/e2e-spec.ts
+++ b/public/docs/_examples/cb-component-communication/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Component Communication Cookbook Tests', function () {
diff --git a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts
index f3db3774e1..13e1636f2e 100644
--- a/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts
+++ b/public/docs/_examples/cb-component-relative-paths/e2e-spec.ts
@@ -1,11 +1,13 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+
describe('Cookbook: component-relative paths', function () {
interface Page {
- title: protractor.ElementFinder;
- absComp: protractor.ElementFinder;
- relComp: protractor.ElementFinder;
+ title: ElementFinder;
+ absComp: ElementFinder;
+ relComp: ElementFinder;
}
function getPageStruct() {
diff --git a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts
index d7ea6d4832..8c9d163d5e 100644
--- a/public/docs/_examples/cb-dependency-injection/e2e-spec.ts
+++ b/public/docs/_examples/cb-dependency-injection/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Dependency Injection Cookbook', function () {
beforeAll(function () {
@@ -71,7 +73,7 @@ describe('Dependency Injection Cookbook', function () {
let yellow = 'rgba(255, 255, 0, 1)';
expect(target.getCssValue('background-color')).not.toEqual(yellow);
- browser.actions().mouseMove(target as any as webdriver.WebElement).perform();
+ browser.actions().mouseMove(target.getWebElement()).perform();
expect(target.getCssValue('background-color')).toEqual(yellow);
});
diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app-routing.module.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app-routing.module.ts
new file mode 100644
index 0000000000..09a0592d00
--- /dev/null
+++ b/public/docs/_examples/cb-dependency-injection/ts/app/app-routing.module.ts
@@ -0,0 +1,11 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+const routes: Routes = [];
+
+@NgModule({
+ imports: [RouterModule.forRoot(routes)],
+ providers: [],
+ exports: [RouterModule]
+})
+export class AppRoutingModule {}
diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts
index 5d7ca6ab97..a240e21f7c 100644
--- a/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts
+++ b/public/docs/_examples/cb-dependency-injection/ts/app/app.module.ts
@@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
-/* import { routing } from './app.routing';*/
+// import { AppRoutingModule } from './app-routing.module';
import { LocationStrategy,
HashLocationStrategy } from '@angular/common';
import { NgModule } from '@angular/core';
@@ -56,7 +56,7 @@ const c_components = [
FormsModule,
HttpModule,
InMemoryWebApiModule.forRoot(HeroData)
- // routing TODO: add routes
+ // AppRoutingModule TODO: add routes
],
declarations: [
declarations,
diff --git a/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts b/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts
deleted file mode 100644
index 2d3556371d..0000000000
--- a/public/docs/_examples/cb-dependency-injection/ts/app/app.routing.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { ModuleWithProviders } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-const routes: Routes = [];
-
-export const routing: ModuleWithProviders = RouterModule.forRoot(routes);
-
-export const appRoutingProviders: any[] = [
-
-];
diff --git a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts
index b6c4a35e0a..408ac75766 100644
--- a/public/docs/_examples/cb-dynamic-form/e2e-spec.ts
+++ b/public/docs/_examples/cb-dynamic-form/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
/* tslint:disable:quotemark */
describe('Dynamic Form', function () {
diff --git a/public/docs/_examples/cb-form-validation/e2e-spec.ts b/public/docs/_examples/cb-form-validation/e2e-spec.ts
index bbd4a7ff03..8ffc01e250 100644
--- a/public/docs/_examples/cb-form-validation/e2e-spec.ts
+++ b/public/docs/_examples/cb-form-validation/e2e-spec.ts
@@ -1,8 +1,10 @@
-///
'use strict'; // necessary for node!
+import { browser, element, by, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
+import { appLang, describeIf } from '../protractor-helpers';
+
// THESE TESTS ARE INCOMPLETE
-describeIf(browser.appIsTs || browser.appIsJs, 'Form Validation Tests', function () {
+describeIf(appLang.appIsTs || appLang.appIsJs, 'Form Validation Tests', function () {
beforeAll(function () {
browser.get('');
@@ -41,15 +43,15 @@ describeIf(browser.appIsTs || browser.appIsJs, 'Form Validation Tests', function
const testName = 'Test Name';
let page: {
- section: protractor.ElementFinder,
- form: protractor.ElementFinder,
- title: protractor.ElementFinder,
- nameInput: protractor.ElementFinder,
- alterEgoInput: protractor.ElementFinder,
- powerSelect: protractor.ElementFinder,
- errorMessages: protractor.ElementArrayFinder,
- heroFormButtons: protractor.ElementArrayFinder,
- heroSubmitted: protractor.ElementFinder
+ section: ElementFinder,
+ form: ElementFinder,
+ title: ElementFinder,
+ nameInput: ElementFinder,
+ alterEgoInput: ElementFinder,
+ powerSelect: ElementFinder,
+ errorMessages: ElementArrayFinder,
+ heroFormButtons: ElementArrayFinder,
+ heroSubmitted: ElementFinder
};
function getPage(sectionTag: string) {
diff --git a/public/docs/_examples/cb-i18n/e2e-spec.ts b/public/docs/_examples/cb-i18n/e2e-spec.ts
index 6606ca8878..f3249272af 100644
--- a/public/docs/_examples/cb-i18n/e2e-spec.ts
+++ b/public/docs/_examples/cb-i18n/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('i18n E2E Tests', () => {
beforeEach(function () {
diff --git a/public/docs/_examples/cb-i18n/ts/app/i18n-providers.ts b/public/docs/_examples/cb-i18n/ts/app/i18n-providers.ts
index c27afc88d7..84328f0d22 100644
--- a/public/docs/_examples/cb-i18n/ts/app/i18n-providers.ts
+++ b/public/docs/_examples/cb-i18n/ts/app/i18n-providers.ts
@@ -9,13 +9,13 @@ export function getTranslationProviders(): Promise