diff --git a/gulpfile.js b/gulpfile.js
index c851ffa5a0..36936b6222 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');
@@ -92,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'
@@ -205,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;
});
};
@@ -251,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
@@ -326,7 +314,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());
@@ -477,7 +465,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(); });
});
}
@@ -488,12 +476,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);
@@ -503,14 +491,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 =
@@ -518,6 +498,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;
});
}
@@ -596,11 +580,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);
});
}
@@ -820,7 +799,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));
@@ -879,7 +858,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/**/*',
@@ -1152,7 +1130,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) {
@@ -1183,6 +1161,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/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/docs/_examples/.gitignore b/public/docs/_examples/.gitignore
index 768c5e9d97..26c5801eb8 100644
--- a/public/docs/_examples/.gitignore
+++ b/public/docs/_examples/.gitignore
@@ -9,8 +9,8 @@ tsconfig.json
tslint.json
typings.json
wallaby.js
+_boilerplate/a2docs.css
-protractor.config.js
_test-output
**/ts/**/*.js
**/ts-snippets/**/*.js
@@ -18,3 +18,4 @@ _test-output
!**/*e2e-spec.js
!systemjs.config.1.js
+!_boilerplate/*
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..74b692d1f0
--- /dev/null
+++ b/public/docs/_examples/_boilerplate/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "angular2-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",
+ "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.js",
+ "i18n": "ng-xi18n"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "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 69%
rename from public/docs/_examples/_protractor/tsconfig.json
rename to public/docs/_examples/_boilerplate/tsconfig.json
index 8c87ff4f20..64548f5b12 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,7 @@
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
- "suppressImplicitAnyIndexErrors": true
- },
- "files": [
- "e2e-spec.ts"
- ]
+ "suppressImplicitAnyIndexErrors": true,
+ "types": []
+ }
}
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-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/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 47d8c47e05..b83589cc32 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 () {
// Note: '?e2e' which app can read to know it is running in protractor
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-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-set-document-title/e2e-spec.ts b/public/docs/_examples/cb-set-document-title/e2e-spec.ts
index 135bfb1a88..801b732995 100644
--- a/public/docs/_examples/cb-set-document-title/e2e-spec.ts
+++ b/public/docs/_examples/cb-set-document-title/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+
// gulp run-e2e-tests --filter=cb-set-document-title
describe('Set Document Title', function () {
@@ -16,7 +18,7 @@ describe('Set Document Title', function () {
];
element.all( by.css( 'ul li a' ) ).each(
- function iterator( element, i ) {
+ function iterator( element: ElementFinder, i: number ) {
element.click();
expect( browser.getTitle() ).toEqual( titles[ i ] );
diff --git a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts
index 1fc5641bd3..5862beeebf 100644
--- a/public/docs/_examples/cb-ts-to-js/e2e-spec.ts
+++ b/public/docs/_examples/cb-ts-to-js/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('TypeScript to Javascript tests', function () {
beforeAll(function () {
@@ -54,7 +56,7 @@ describe('TypeScript to Javascript tests', function () {
expect(h1.getAttribute('class')).toBe('active');
h1.click();
- browser.actions().doubleClick(h1 as any as webdriver.WebElement).perform();
+ browser.actions().doubleClick(h1.getWebElement()).perform();
expect(h1.getAttribute('class')).toBe('active');
});
diff --git a/public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled b/public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled
index ef30b01ec1..fb133ce7ab 100644
--- a/public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled
+++ b/public/docs/_examples/cli-quickstart/e2e-spec.ts.disabled
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('cli-quickstart App', () => {
beforeEach(() => {
return browser.get('/');
diff --git a/public/docs/_examples/component-styles/e2e-spec.ts b/public/docs/_examples/component-styles/e2e-spec.ts
index 6a26fe0d67..28a44221a4 100644
--- a/public/docs/_examples/component-styles/e2e-spec.ts
+++ b/public/docs/_examples/component-styles/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 Style Tests', function () {
beforeAll(function () {
diff --git a/public/docs/_examples/dependency-injection/e2e-spec.ts b/public/docs/_examples/dependency-injection/e2e-spec.ts
index 4c702f8801..28fe22a9cb 100644
--- a/public/docs/_examples/dependency-injection/e2e-spec.ts
+++ b/public/docs/_examples/dependency-injection/e2e-spec.ts
@@ -1,7 +1,8 @@
-///
-'use strict';
-describe('Dependency Injection Tests', function () {
+'use strict'; // necessary for es6 output in node
+import { browser, element, by, ElementFinder } from 'protractor';
+
+describe('Dependency Injection Tests', function () {
let expectedMsg: string;
let expectedMsgRx: RegExp;
@@ -147,14 +148,13 @@ describe('Dependency Injection Tests', function () {
let heroes = element.all(by.css('#unauthorized hero-list div'));
expect(heroes.count()).toBeGreaterThan(0);
- heroes.filter(function(elem, index){
- return elem.getText().then(function(text) {
+ let filteredHeroes = heroes.filter((elem: ElementFinder, index: number) => {
+ return elem.getText().then((text: string) => {
return /secret/.test(text);
});
- }).then(function(filteredElements) {
- // console.log("******Secret heroes count: "+filteredElements.length);
- expect(filteredElements.length).toEqual(0);
});
+
+ expect(filteredHeroes.count()).toEqual(0);
});
it('unauthorized user should have no authorized heroes listed', function () {
@@ -182,14 +182,13 @@ describe('Dependency Injection Tests', function () {
let heroes = element.all(by.css('#authorized hero-list div'));
expect(heroes.count()).toBeGreaterThan(0);
- heroes.filter(function(elem, index){
- return elem.getText().then(function(text) {
+ let filteredHeroes = heroes.filter(function(elem: ElementFinder, index: number){
+ return elem.getText().then(function(text: string) {
return /secret/.test(text);
});
- }).then(function(filteredElements) {
- // console.log("******Secret heroes count: "+filteredElements.length);
- expect(filteredElements.length).toBeGreaterThan(0);
});
+
+ expect(filteredHeroes.count()).toBeGreaterThan(0);
});
it('authorized user should have no unauthorized heroes listed', function () {
diff --git a/public/docs/_examples/displaying-data/e2e-spec.ts b/public/docs/_examples/displaying-data/e2e-spec.ts
index 5a2bd1c5ca..96c52c5d00 100644
--- a/public/docs/_examples/displaying-data/e2e-spec.ts
+++ b/public/docs/_examples/displaying-data/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Displaying Data Tests', function () {
let _title = 'Tour of Heroes';
let _defaultHero = 'Windstorm';
diff --git a/public/docs/_examples/forms/e2e-spec.ts b/public/docs/_examples/forms/e2e-spec.ts
index 87ab6ef904..2afd370103 100644
--- a/public/docs/_examples/forms/e2e-spec.ts
+++ b/public/docs/_examples/forms/e2e-spec.ts
@@ -1,6 +1,7 @@
-///
-'use strict';
-describeIf(browser.appIsTs || browser.appIsJs, 'Forms Tests', function () {
+import { browser, element, by } from 'protractor';
+import { appLang, describeIf } from '../protractor-helpers';
+
+describeIf(appLang.appIsTs || appLang.appIsJs, 'Forms Tests', function () {
beforeEach(function () {
browser.get('');
@@ -45,12 +46,10 @@ describeIf(browser.appIsTs || browser.appIsJs, 'Forms Tests', function () {
let test = 'testing 1 2 3';
let newValue: string;
let alterEgoEle = element.all(by.css('input[name=alterEgo]')).get(0);
- alterEgoEle.getAttribute('value').then(function(value) {
- // alterEgoEle.sendKeys(test);
- sendKeys(alterEgoEle, test);
+ alterEgoEle.getAttribute('value').then(function(value: string) {
+ alterEgoEle.sendKeys(test);
newValue = value + test;
expect(alterEgoEle.getAttribute('value')).toEqual(newValue);
- }).then(function() {
let b = element.all(by.css('button[type=submit]')).get(0);
return b.click();
}).then(function() {
diff --git a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts
index 224d649cad..738e304d1b 100644
--- a/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts
+++ b/public/docs/_examples/hierarchical-dependency-injection/e2e-spec.ts
@@ -1,5 +1,5 @@
-///
-'use strict';
+import { browser, element, by } from 'protractor';
+
describe('Hierarchical dependency injection', function () {
beforeEach(function () {
@@ -38,8 +38,7 @@ describe('Hierarchical dependency injection', function () {
let editButtonEle = heroEle.element(by.cssContainingText('button', 'edit'));
editButtonEle.click().then(function() {
let inputEle = heroEle.element(by.css('hero-editor input'));
- // return inputEle.sendKeys("foo");
- return sendKeys(inputEle, 'foo');
+ return inputEle.sendKeys('foo');
}).then(function() {
let buttonName = shouldSave ? 'save' : 'cancel';
let buttonEle = heroEle.element(by.cssContainingText('button', buttonName));
diff --git a/public/docs/_examples/homepage-hello-world/e2e-spec.ts b/public/docs/_examples/homepage-hello-world/e2e-spec.ts
index 54d8f79532..c4c6464937 100644
--- a/public/docs/_examples/homepage-hello-world/e2e-spec.ts
+++ b/public/docs/_examples/homepage-hello-world/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Homepage Hello World', function () {
beforeAll(function () {
@@ -15,9 +17,8 @@ describe('Homepage Hello World', function () {
it('should display entered name', function () {
let testName = 'Bobby Joe';
let nameEle = element.all(by.css('input')).get(0);
- nameEle.getAttribute('value').then(function(value) {
- // nameEle.sendKeys(testName); // should work but doesn't
- sendKeys(nameEle, testName); // utility that does work
+ nameEle.getAttribute('value').then(function(value: string) {
+ nameEle.sendKeys(testName);
let newValue = value + testName; // old input box value + new name
expect(nameEle.getAttribute('value')).toEqual(newValue);
}).then(function() {
diff --git a/public/docs/_examples/homepage-tabs/e2e-spec.ts b/public/docs/_examples/homepage-tabs/e2e-spec.ts
index 2ac27b289f..2131d75906 100644
--- a/public/docs/_examples/homepage-tabs/e2e-spec.ts
+++ b/public/docs/_examples/homepage-tabs/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Homepage Tabs', function () {
beforeAll(function () {
diff --git a/public/docs/_examples/homepage-todo/e2e-spec.ts b/public/docs/_examples/homepage-todo/e2e-spec.ts
index f1dae917c6..fb74e4e70f 100644
--- a/public/docs/_examples/homepage-todo/e2e-spec.ts
+++ b/public/docs/_examples/homepage-todo/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Homepage Todo', function () {
beforeAll(function () {
diff --git a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts
index 156ea3c3a9..8e9acb1c76 100644
--- a/public/docs/_examples/lifecycle-hooks/e2e-spec.ts
+++ b/public/docs/_examples/lifecycle-hooks/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Lifecycle hooks', function () {
beforeAll(function () {
@@ -41,18 +43,13 @@ describe('Lifecycle hooks', function () {
expect(titleEle.getText()).toContain('Windstorm can sing');
expect(changeLogEles.count()).toEqual(2, 'should start with 2 messages');
- // heroNameInputEle.sendKeys('-foo-').then(function () {
- sendKeys(heroNameInputEle, '-foo-').then(function () {
- expect(titleEle.getText()).toContain('Windstorm-foo- can sing');
- expect(changeLogEles.count()).toEqual(2, 'should still have 2 messages');
- // protractor bug with sendKeys means that line below does not work.
- // return powerInputEle.sendKeys('-bar-');
- return sendKeys(powerInputEle, '-bar-');
- }).then(function () {
- expect(titleEle.getText()).toContain('Windstorm-foo- can sing-bar-');
- // 7 == 2 previously + length of '-bar-'
- expect(changeLogEles.count()).toEqual(7, 'should have 7 messages now');
- });
+ heroNameInputEle.sendKeys('-foo-');
+ expect(titleEle.getText()).toContain('Windstorm-foo- can sing');
+ expect(changeLogEles.count()).toEqual(2, 'should still have 2 messages');
+ powerInputEle.sendKeys('-bar-');
+ expect(titleEle.getText()).toContain('Windstorm-foo- can sing-bar-');
+ // 7 == 2 previously + length of '-bar-'
+ expect(changeLogEles.count()).toEqual(7, 'should have 7 messages now');
});
it('should support DoCheck hook', function () {
@@ -65,21 +62,19 @@ describe('Lifecycle hooks', function () {
let logCount: number;
expect(titleEle.getText()).toContain('Windstorm can sing');
- changeLogEles.count().then(function(count) {
+ changeLogEles.count().then(function(count: number) {
// 3 messages to start
expect(count).toEqual(3, 'should start with 3 messages');
logCount = count;
- // heroNameInputEle.sendKeys('-foo-').then(function () {
- return sendKeys(heroNameInputEle, '-foo-');
+ return heroNameInputEle.sendKeys('-foo-');
}).then(function () {
expect(titleEle.getText()).toContain('Windstorm-foo- can sing');
return changeLogEles.count();
- }).then(function (count) {
+ }).then(function(count: number) {
// one more for each keystroke
expect(count).toEqual(logCount + 5, 'should add 5 more messages');
logCount = count;
- // return powerInputEle.sendKeys('-bar-');
- return sendKeys(powerInputEle, '-bar-');
+ return powerInputEle.sendKeys('-bar-');
}).then(function () {
expect(titleEle.getText()).toContain('Windstorm-foo- can sing-bar-');
expect(changeLogEles.count()).toEqual(logCount + 6, 'should add 6 more messages');
@@ -97,16 +92,16 @@ describe('Lifecycle hooks', function () {
expect(childViewInputEle.getAttribute('value')).toContain('Magneta');
expect(commentEle.isPresent()).toBe(false, 'comment should not be in DOM');
- logEles.count().then(function(count) {
+ logEles.count().then(function(count: number) {
logCount = count;
- return sendKeys(childViewInputEle, '-test-');
+ return childViewInputEle.sendKeys('-test-');
}).then(function() {
expect(childViewInputEle.getAttribute('value')).toContain('-test-');
expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars');
expect(commentEle.getText()).toContain('long name');
return logEles.count();
- }).then(function(count) {
- expect(logCount + 6).toEqual(count, '6 additional log messages should have been added');
+ }).then(function(count: number) {
+ expect(logCount + 7).toEqual(count, '7 additional log messages should have been added');
logCount = count;
return buttonEle.click();
}).then(function() {
@@ -126,15 +121,15 @@ describe('Lifecycle hooks', function () {
expect(childViewInputEle.getAttribute('value')).toContain('Magneta');
expect(commentEle.isPresent()).toBe(false, 'comment should not be in DOM');
- logEles.count().then(function(count) {
+ logEles.count().then(function(count: number) {
logCount = count;
- return sendKeys(childViewInputEle, '-test-');
+ return childViewInputEle.sendKeys('-test-');
}).then(function() {
expect(childViewInputEle.getAttribute('value')).toContain('-test-');
expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars');
expect(commentEle.getText()).toContain('long name');
return logEles.count();
- }).then(function(count) {
+ }).then(function(count: number) {
expect(logCount + 5).toEqual(count, '5 additional log messages should have been added');
logCount = count;
return buttonEle.click();
@@ -151,7 +146,7 @@ describe('Lifecycle hooks', function () {
let logEles = element.all(by.css('spy-parent h4 ~ div'));
expect(heroEles.count()).toBe(2, 'should have two heroes displayed');
expect(logEles.count()).toBe(2, 'should have two log entries');
- sendKeys(inputEle, '-test-').then(function() {
+ inputEle.sendKeys('-test-').then(function() {
return addHeroButtonEle.click();
}).then(function() {
expect(heroEles.count()).toBe(3, 'should have added one hero');
diff --git a/public/docs/_examples/ngmodule/e2e-spec.ts b/public/docs/_examples/ngmodule/e2e-spec.ts
index de8f4fa7e0..0fbce1213d 100644
--- a/public/docs/_examples/ngmodule/e2e-spec.ts
+++ b/public/docs/_examples/ngmodule/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('NgModule', function () {
// helpers
diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json
index 980813eabd..615db7f811 100644
--- a/public/docs/_examples/package.json
+++ b/public/docs/_examples/package.json
@@ -1,27 +1,12 @@
{
"name": "angular2-examples-master",
"version": "1.0.0",
- "description": "Master package.json, the superset of all dependencies for all of the _example package.json files.",
+ "description": "Master package.json, the superset of all dependencies for all of the _example package.json files. See _boilerplate/package.json for example npm scripts.",
"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",
"postinstall": "typings install",
- "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
- "tsc": "tsc",
- "tsc:w": "tsc -w",
"typings": "typings",
"protractor": "protractor",
- "webdriver:update": "webdriver-manager update",
- "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.js",
- "i18n": "ng-xi18n"
+ "webdriver:update": "webdriver-manager update"
},
"keywords": [],
"author": "",
@@ -42,6 +27,7 @@
"angular-in-memory-web-api": "~0.1.1",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
+ "protractor": "^4.0.9",
"reflect-metadata": "^0.1.8",
"rollup": "^0.36.0",
"rollup-plugin-node-resolve": "^2.0.0",
@@ -51,7 +37,9 @@
"zone.js": "^0.6.25"
},
"devDependencies": {
- "angular-cli": "^1.0.0-beta.5",
+ "@types/angular": "^1.5.15",
+ "@types/jasmine": "^2.2.34",
+ "@types/selenium-webdriver": "^2.53.32",
"angular2-template-loader": "^0.4.0",
"awesome-typescript-loader": "^2.2.4",
"canonical-path": "0.0.2",
@@ -62,6 +50,7 @@
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.16.1",
"http-server": "^0.9.0",
+ "jasmine": "^2.5.2",
"jasmine-core": "^2.5.2",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
@@ -76,7 +65,7 @@
"lodash": "^4.16.2",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "^2.1.7",
- "protractor": "^3.3.0",
+ "protractor": "^4.0.9",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.4",
"rollup-plugin-commonjs": "^4.1.0",
diff --git a/public/docs/_examples/pipes/e2e-spec.ts b/public/docs/_examples/pipes/e2e-spec.ts
index 5f9c4607dc..a2c4062dfd 100644
--- a/public/docs/_examples/pipes/e2e-spec.ts
+++ b/public/docs/_examples/pipes/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Pipes', function () {
beforeAll(function () {
@@ -53,12 +55,10 @@ describe('Pipes', function () {
let factorInputEle = eles.get(1);
let outputEle = element(by.css('power-boost-calculator p'));
baseInputEle.clear().then(function() {
- return sendKeys(baseInputEle, '7');
- }).then(function() {
+ baseInputEle.sendKeys('7');
return factorInputEle.clear();
}).then(function() {
- return sendKeys(factorInputEle, '3');
- }).then(function() {
+ factorInputEle.sendKeys('3');
expect(outputEle.getText()).toContain('343');
});
});
@@ -75,15 +75,10 @@ describe('Pipes', function () {
expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array');
expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly');
- return sendKeys(nameEle, 'test1\n')
- .then(function(){
- expect(flyingHeroesEle.count()).toEqual(2, 'no change while mutating array');
- return mutateCheckEle.click();
- })
- .then(function() {
- return sendKeys(nameEle, 'test2\n');
- })
- .then(function() {
+ nameEle.sendKeys('test1\n');
+ expect(flyingHeroesEle.count()).toEqual(2, 'no change while mutating array');
+ mutateCheckEle.click().then(function() {
+ nameEle.sendKeys('test2\n');
expect(flyingHeroesEle.count()).toEqual(4, 'not mutating; should see both adds');
expect(flyingHeroesEle.get(2).getText()).toContain('test1');
expect(flyingHeroesEle.get(3).getText()).toContain('test2');
@@ -105,10 +100,8 @@ describe('Pipes', function () {
expect(mutateCheckEle.getAttribute('checked')).toEqual('true', 'should default to mutating array');
expect(flyingHeroesEle.count()).toEqual(2, 'only two of the original heroes can fly');
- return sendKeys(nameEle, 'test1\n')
- .then(function(){
- expect(flyingHeroesEle.count()).toEqual(3, 'new flying hero should show in mutating array');
- });
+ nameEle.sendKeys('test1\n');
+ expect(flyingHeroesEle.count()).toEqual(3, 'new flying hero should show in mutating array');
});
it('should show an async hero message', function () {
diff --git a/public/docs/_examples/protractor-helpers.ts b/public/docs/_examples/protractor-helpers.ts
new file mode 100644
index 0000000000..f3f784e613
--- /dev/null
+++ b/public/docs/_examples/protractor-helpers.ts
@@ -0,0 +1,36 @@
+export var appLang = {
+ appIsTs: false,
+ appIsJs: false,
+ appIsDart: false,
+ appIsUnknown: false
+};
+
+export function describeIf(cond: boolean, name: string, func: () => void): void {
+ if (cond) {
+ describe(name, func);
+ } else {
+ xdescribe(name, func);
+ }
+}
+
+export function itIf(cond: boolean, name: string, func: (done: DoneFn) => void): void {
+ if (cond) {
+ it(name, func);
+ } else {
+ xit(name, func);
+ }
+}
+
+ // TODO Jesus - figure out what's needed here for the new upgrade chapters
+// Allow changing bootstrap mode to NG1 for upgrade tests
+export function setProtractorToNg1Mode(): void {
+ // browser.rootEl = 'body';
+
+ // let disableNgAnimate = function() {
+ // angular.module('disableNgAnimate', []).run(['$animate', function($animate: any) {
+ // $animate.enabled(false);
+ // }]);
+ // };
+
+ // browser.addMockModule('disableNgAnimate', disableNgAnimate);
+}
diff --git a/public/docs/_examples/_protractor/protractor.config.js b/public/docs/_examples/protractor.config.js
similarity index 76%
rename from public/docs/_examples/_protractor/protractor.config.js
rename to public/docs/_examples/protractor.config.js
index 2452bea764..92b5e1fda5 100644
--- a/public/docs/_examples/_protractor/protractor.config.js
+++ b/public/docs/_examples/protractor.config.js
@@ -43,39 +43,23 @@ exports.config = {
// debugging
// console.log('browser.params:' + JSON.stringify(browser.params));
+ var protractorHelpers = require('./protractor-helpers.ts');
var appDir = browser.params.appDir;
if (appDir) {
if (appDir.match('/ts') != null) {
- browser.appIsTs = true;
+ protractorHelpers.appLang.appIsTs = true;
} else if (appDir.match('/js') != null) {
- browser.appIsJs = true;
+ protractorHelpers.appLang.appIsJs = true;
} else if (appDir.match('/dart') != null) {
- browser.appIsDart = true;
+ protractorHelpers.appLang.appIsDart = true;
} else {
- browser.appIsUnknown = true;
+ protractorHelpers.appLang.appIsUnknown = true;
}
} else {
- browser.appIsUnknown = true;
+ protractorHelpers.appLang.appIsUnknown = true;
}
- jasmine.getEnv().addReporter(new Reporter( browser.params )) ;
- global.describeIf = describeIf;
- global.itIf = itIf;
- global.sendKeys = sendKeys;
-
- // Allow changing bootstrap mode to NG1 for upgrade tests
- global.setProtractorToNg1Mode = function() {
- browser.useAllAngular2AppRoots = false;
- browser.rootEl = 'body';
-
- var disableNgAnimate = function() {
- angular.module('disableNgAnimate', []).run(['$animate', function($animate) {
- $animate.enabled(false);
- }]);
- };
-
- browser.addMockModule('disableNgAnimate', disableNgAnimate);
- };
+ jasmine.getEnv().addReporter(new Reporter( browser.params ));
},
jasmineNodeOpts: {
@@ -87,40 +71,15 @@ exports.config = {
beforeLaunch: function() {
// add TS support for specs
- require('ts-node').register();
+ require('ts-node').register({
+ project: './tsconfig.json'
+ });
}
};
-function describeIf(cond, name, func) {
- if (cond) {
- describe(name, func);
- } else {
- xdescribe(name, func);
- }
-}
-
-function itIf(cond, name, func) {
- if (cond) {
- it(name, func);
- } else {
- xit(name, func);
- }
-}
-
-// Hack - because of bug with protractor send keys
-// Hack - because of bug with send keys
-function sendKeys(element, str) {
- return str.split('').reduce(function (promise, char) {
- return promise.then(function () {
- return element.sendKeys(char);
- });
- }, element.getAttribute('value'));
- // better to create a resolved promise here but ... don't know how with protractor;
- }
-
// See http://jasmine.github.io/2.1/custom_reporter.html
function Reporter(options) {
- var _defaultOutputFile = path.resolve(process.cwd(), "../../../../", 'protractor-results.txt');
+ var _defaultOutputFile = path.resolve(process.cwd(), "../../../", 'protractor-results.txt');
options.outputFile = options.outputFile || _defaultOutputFile;
var _root = { appDir: options.appDir, suites: [] };
diff --git a/public/docs/_examples/quickstart/e2e-spec.ts b/public/docs/_examples/quickstart/e2e-spec.ts
index 5a1c683cfd..a548ec833a 100644
--- a/public/docs/_examples/quickstart/e2e-spec.ts
+++ b/public/docs/_examples/quickstart/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('QuickStart E2E Tests', function () {
let expectedMsg = 'My First Angular App';
diff --git a/public/docs/_examples/router/e2e-spec.ts b/public/docs/_examples/router/e2e-spec.ts
index a82ebd08a5..a3d6d9b926 100644
--- a/public/docs/_examples/router/e2e-spec.ts
+++ b/public/docs/_examples/router/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+
describe('Router', function () {
beforeAll(function () {
@@ -79,12 +81,12 @@ describe('Router', function () {
it('should be able to edit and save details from the heroes view', function () {
let page = getPageStruct();
- let heroEle: protractor.ElementFinder;
+ let heroEle: ElementFinder;
let heroText: string;
page.heroesHref.click().then(function() {
heroEle = page.heroesList.get(4);
return heroEle.getText();
- }).then(function(text) {
+ }).then(function(text: string) {
expect(text.length).toBeGreaterThan(0, 'should have some text');
// remove leading id from text
heroText = text.substr(text.indexOf(' ')).trim();
@@ -94,8 +96,7 @@ describe('Router', function () {
expect(page.heroDetail.isPresent()).toBe(true, 'should be able to see crisis detail');
expect(page.heroDetailTitle.getText()).toContain(heroText);
let inputEle = page.heroDetail.element(by.css('input'));
- return sendKeys(inputEle, '-foo');
- }).then(function() {
+ inputEle.sendKeys('-foo');
expect(page.heroDetailTitle.getText()).toContain(heroText + '-foo');
let buttonEle = page.heroDetail.element(by.css('button'));
return buttonEle.click();
@@ -106,13 +107,13 @@ describe('Router', function () {
function crisisCenterEdit(index: number, shouldSave: boolean) {
let page = getPageStruct();
- let crisisEle: protractor.ElementFinder;
+ let crisisEle: ElementFinder;
let crisisText: string;
page.crisisHref.click()
.then(function () {
crisisEle = page.crisisList.get(index);
return crisisEle.getText();
- }).then(function (text) {
+ }).then(function(text: string) {
expect(text.length).toBeGreaterThan(0, 'should have some text');
// remove leading id from text
crisisText = text.substr(text.indexOf(' ')).trim();
@@ -121,8 +122,7 @@ describe('Router', function () {
expect(page.crisisDetail.isPresent()).toBe(true, 'should be able to see crisis detail');
expect(page.crisisDetailTitle.getText()).toContain(crisisText);
let inputEle = page.crisisDetail.element(by.css('input'));
- return sendKeys(inputEle, '-foo');
- }).then(function () {
+ inputEle.sendKeys('-foo');
expect(page.crisisDetailTitle.getText()).toContain(crisisText + '-foo');
let buttonEle = page.crisisDetail.element(by.cssContainingText('button', shouldSave ? 'Save' : 'Cancel'));
return buttonEle.click();
diff --git a/public/docs/_examples/security/e2e-spec.ts b/public/docs/_examples/security/e2e-spec.ts
index d1a373a781..23d11cd12b 100644
--- a/public/docs/_examples/security/e2e-spec.ts
+++ b/public/docs/_examples/security/e2e-spec.ts
@@ -1,5 +1,6 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, By } from 'protractor';
describe('Security E2E Tests', () => {
beforeAll(() => browser.get(''));
diff --git a/public/docs/_examples/server-communication/e2e-spec.ts b/public/docs/_examples/server-communication/e2e-spec.ts
index 3468d363a0..2b6571b039 100644
--- a/public/docs/_examples/server-communication/e2e-spec.ts
+++ b/public/docs/_examples/server-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('Server Communication', function () {
beforeAll(function () {
@@ -35,7 +37,7 @@ describe('Server Communication', function () {
it('should add a new hero to the list', function () {
expect(heroNameInput).toBeDefined(' for hero name must exist');
expect(addButton).toBeDefined('"Add Hero" button must be defined');
- sendKeys(heroNameInput, newHeroName);
+ heroNameInput.sendKeys(newHeroName);
addButton.click().then(function() {
expect(heroTags.count()).toBe(heroCountAfterAdd, 'A new hero should be added');
let newHeroInList = heroTags.get(heroCountAfterAdd - 1).getText();
diff --git a/public/docs/_examples/structural-directives/e2e-spec.ts b/public/docs/_examples/structural-directives/e2e-spec.ts
index 5f48b08835..335915eb86 100644
--- a/public/docs/_examples/structural-directives/e2e-spec.ts
+++ b/public/docs/_examples/structural-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('Structural Directives', function () {
// tests interact - so we need beforeEach instead of beforeAll
@@ -34,7 +36,7 @@ describe('Structural Directives', function () {
let cssButtonEle = element(by.cssContainingText('button', 'show | hide'));
let cssSiblingEle = cssButtonEle.element(by.xpath('..')).element(by.css('heavy-loader'));
let setConditionText: string;
- setConditionButtonEle.getText().then(function(text) {
+ setConditionButtonEle.getText().then(function(text: string) {
setConditionText = text;
expect(ngIfButtonEle.isPresent()).toBe(true, 'should be able to find ngIfButton');
expect(cssButtonEle.isPresent()).toBe(true, 'should be able to find cssButton');
diff --git a/public/docs/_examples/style-guide/e2e-spec.ts b/public/docs/_examples/style-guide/e2e-spec.ts
index 2809e65e44..d143ae5573 100644
--- a/public/docs/_examples/style-guide/e2e-spec.ts
+++ b/public/docs/_examples/style-guide/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Style Guide', function () {
it('01-01', function () {
browser.get('#/01-01');
diff --git a/public/docs/_examples/styleguide/e2e-spec.ts b/public/docs/_examples/styleguide/e2e-spec.ts
index 321e86c8a1..af10d2b71d 100644
--- a/public/docs/_examples/styleguide/e2e-spec.ts
+++ b/public/docs/_examples/styleguide/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Documentation StyleGuide E2E Tests', function() {
let expectedMsg = 'My First Angular App';
diff --git a/public/docs/_examples/template-syntax/e2e-spec.ts b/public/docs/_examples/template-syntax/e2e-spec.ts
index 47cbce0d59..124f633280 100644
--- a/public/docs/_examples/template-syntax/e2e-spec.ts
+++ b/public/docs/_examples/template-syntax/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
// Not yet complete
describe('Template Syntax', function () {
diff --git a/public/docs/_examples/toh-1/e2e-spec.ts b/public/docs/_examples/toh-1/e2e-spec.ts
index 11e51e4df9..75f99788a6 100644
--- a/public/docs/_examples/toh-1/e2e-spec.ts
+++ b/public/docs/_examples/toh-1/e2e-spec.ts
@@ -1,7 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
-type WPromise = webdriver.promise.Promise;
+import { browser, element, by, ElementFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -12,7 +12,7 @@ class Hero {
// Factory method
// Get hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -25,9 +25,9 @@ class Hero {
}
const nameSuffix = 'X';
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
describe('Tutorial part 1', () => {
diff --git a/public/docs/_examples/toh-2/e2e-spec.ts b/public/docs/_examples/toh-2/e2e-spec.ts
index cde9e93edf..b5df938cd3 100644
--- a/public/docs/_examples/toh-2/e2e-spec.ts
+++ b/public/docs/_examples/toh-2/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -7,8 +9,6 @@ const expectedH2 = 'My Heroes';
const targetHero = { id: 16, name: 'RubberMan' };
const nameSuffix = 'X';
-type WPromise = webdriver.promise.Promise;
-
class Hero {
id: number;
name: string;
@@ -24,7 +24,7 @@ class Hero {
}
// Get hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -113,9 +113,9 @@ function updateHeroTests() {
}
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
function expectHeading(hLevel: number, expectedText: string): void {
diff --git a/public/docs/_examples/toh-3/e2e-spec.ts b/public/docs/_examples/toh-3/e2e-spec.ts
index f1e51f5b39..cce266dcaa 100644
--- a/public/docs/_examples/toh-3/e2e-spec.ts
+++ b/public/docs/_examples/toh-3/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -7,8 +9,6 @@ const expectedH2 = 'My Heroes';
const targetHero = { id: 16, name: 'RubberMan' };
const nameSuffix = 'X';
-type WPromise = webdriver.promise.Promise;
-
class Hero {
id: number;
name: string;
@@ -24,7 +24,7 @@ class Hero {
}
// Get hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -113,9 +113,9 @@ function updateHeroTests() {
}
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
function expectHeading(hLevel: number, expectedText: string): void {
diff --git a/public/docs/_examples/toh-4/e2e-spec.ts b/public/docs/_examples/toh-4/e2e-spec.ts
index 456297b6d2..2307ba17c9 100644
--- a/public/docs/_examples/toh-4/e2e-spec.ts
+++ b/public/docs/_examples/toh-4/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -7,8 +9,6 @@ const expectedH2 = 'My Heroes';
const targetHero = { id: 16, name: 'RubberMan' };
const nameSuffix = 'X';
-type WPromise = webdriver.promise.Promise;
-
class Hero {
id: number;
name: string;
@@ -24,7 +24,7 @@ class Hero {
}
// Get hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -113,9 +113,9 @@ function updateHeroTests() {
}
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
function expectHeading(hLevel: number, expectedText: string): void {
diff --git a/public/docs/_examples/toh-5/e2e-spec.ts b/public/docs/_examples/toh-5/e2e-spec.ts
index 6935ff19a2..1bb398b7f7 100644
--- a/public/docs/_examples/toh-5/e2e-spec.ts
+++ b/public/docs/_examples/toh-5/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -8,8 +10,6 @@ const targetHeroDashboardIndex = 3;
const nameSuffix = 'X';
const newHeroName = targetHero.name + nameSuffix;
-type WPromise = webdriver.promise.Promise;
-
class Hero {
id: number;
name: string;
@@ -25,7 +25,7 @@ class Hero {
}
// Get hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -73,7 +73,7 @@ describe('Tutorial part 5', () => {
const expectedViewNames = ['Dashboard', 'Heroes'];
it(`has views ${expectedViewNames}`, () => {
- let viewNames = getPageElts().hrefs.map(el => el.getText());
+ let viewNames = getPageElts().hrefs.map((el: ElementFinder) => el.getText());
expect(viewNames).toEqual(expectedViewNames);
});
@@ -173,9 +173,9 @@ describe('Tutorial part 5', () => {
});
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
function expectHeading(hLevel: number, expectedText: string): void {
diff --git a/public/docs/_examples/toh-6-aot/ts/dist/build.js.gz b/public/docs/_examples/toh-6-aot/ts/dist/build.js.gz
deleted file mode 100644
index 0f71e85c96..0000000000
Binary files a/public/docs/_examples/toh-6-aot/ts/dist/build.js.gz and /dev/null differ
diff --git a/public/docs/_examples/toh-6/e2e-spec.ts b/public/docs/_examples/toh-6/e2e-spec.ts
index 8152ac308c..814fa2004c 100644
--- a/public/docs/_examples/toh-6/e2e-spec.ts
+++ b/public/docs/_examples/toh-6/e2e-spec.ts
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder, ElementArrayFinder } from 'protractor';
+import { promise } from 'selenium-webdriver';
const expectedH1 = 'Tour of Heroes';
const expectedTitle = `Angular ${expectedH1}`;
@@ -8,8 +10,6 @@ const targetHeroDashboardIndex = 3;
const nameSuffix = 'X';
const newHeroName = targetHero.name + nameSuffix;
-type WPromise = webdriver.promise.Promise;
-
class Hero {
id: number;
name: string;
@@ -25,13 +25,13 @@ class Hero {
}
// Hero from hero list
element.
- static async fromLi(li: protractor.ElementFinder): Promise {
+ static async fromLi(li: ElementFinder): Promise {
let strings = await li.all(by.xpath('span')).getText();
return { id: +strings[0], name: strings[1] };
}
// Hero id and name from the given detail element.
- static async fromDetail(detail: protractor.ElementFinder): Promise {
+ static async fromDetail(detail: ElementFinder): Promise {
// Get hero id from the first
let _id = await detail.all(by.css('div')).first().getText();
// Get name from the h2
@@ -82,7 +82,7 @@ describe('Tutorial part 6', () => {
const expectedViewNames = ['Dashboard', 'Heroes'];
it(`has views ${expectedViewNames}`, () => {
- let viewNames = getPageElts().hrefs.map(el => el.getText());
+ let viewNames = getPageElts().hrefs.map((el: ElementFinder) => el.getText());
expect(viewNames).toEqual(expectedViewNames);
});
@@ -188,7 +188,7 @@ describe('Tutorial part 6', () => {
const heroesBefore = await toHeroArray(getPageElts().allHeroes);
const numHeroes = heroesBefore.length;
- sendKeys(element(by.css('input')), newHeroName);
+ element(by.css('input')).sendKeys(newHeroName);
element(by.buttonText('Add')).click();
let page = getPageElts();
@@ -207,19 +207,19 @@ describe('Tutorial part 6', () => {
beforeAll(() => browser.get(''));
it(`searches for 'Ma'`, async () => {
- sendKeys(getPageElts().searchBox, 'Ma');
+ getPageElts().searchBox.sendKeys('Ma');
browser.sleep(1000);
expect(getPageElts().searchResults.count()).toBe(4);
});
it(`continues search with 'g'`, async () => {
- sendKeys(getPageElts().searchBox, 'g');
+ getPageElts().searchBox.sendKeys('g');
browser.sleep(1000);
expect(getPageElts().searchResults.count()).toBe(2);
});
it(`continues search with 'n' and gets ${targetHero.name}`, async () => {
- sendKeys(getPageElts().searchBox, 'n');
+ getPageElts().searchBox.sendKeys('n');
browser.sleep(1000);
let page = getPageElts();
expect(page.searchResults.count()).toBe(1);
@@ -260,9 +260,9 @@ describe('Tutorial part 6', () => {
});
-function addToHeroName(text: string): WPromise {
+function addToHeroName(text: string): promise.Promise {
let input = element(by.css('input'));
- return sendKeys(input, text);
+ return input.sendKeys(text);
}
function expectHeading(hLevel: number, expectedText: string): void {
@@ -271,13 +271,13 @@ function expectHeading(hLevel: number, expectedText: string): void {
expect(hText).toEqual(expectedText, hTag);
};
-function getHeroLiEltById(id: number): protractor.ElementFinder {
+function getHeroLiEltById(id: number): ElementFinder {
let spanForId = element(by.cssContainingText('li span.badge', id.toString()));
return spanForId.element(by.xpath('..'));
}
-async function toHeroArray(allHeroes: protractor.ElementArrayFinder): Promise {
- let promisedHeroes: Array> = await allHeroes.map(Hero.fromLi);
+async function toHeroArray(allHeroes: ElementArrayFinder): Promise {
+ let promisedHeroes = await allHeroes.map(Hero.fromLi);
// The cast is necessary to get around issuing with the signature of Promise.all()
return > Promise.all(promisedHeroes);
}
diff --git a/public/docs/_examples/tsconfig.json b/public/docs/_examples/tsconfig.json
index fd1d10190d..9357b07770 100644
--- a/public/docs/_examples/tsconfig.json
+++ b/public/docs/_examples/tsconfig.json
@@ -1,6 +1,8 @@
+// this tsconfig is used for protractor tests
+// see _boilerplate/tsconfig.json for the the tsconfig used in examples
{
"compilerOptions": {
- "target": "es5",
+ "target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
@@ -8,6 +10,15 @@
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
- "suppressImplicitAnyIndexErrors": true
- }
-}
+ "suppressImplicitAnyIndexErrors": true,
+ "typeRoots": [
+ "node_modules/@types"
+ ]
+ },
+ "files": [
+ "protractor-helpers.ts"
+ ],
+ "include": [
+ "*/e2e-spec.ts"
+ ]
+}
\ No newline at end of file
diff --git a/public/docs/_examples/typings.json b/public/docs/_examples/typings.json
index 7da31ca0af..ac640054e5 100644
--- a/public/docs/_examples/typings.json
+++ b/public/docs/_examples/typings.json
@@ -1,7 +1,13 @@
{
"globalDependencies": {
+ "angular": "registry:dt/angular#1.5.0+20160829152510",
+ "angular-animate": "registry:dt/angular-animate#1.5.0+20160709061515",
+ "angular-mocks": "registry:dt/angular-mocks#1.5.0+20160608104721",
+ "angular-resource": "registry:dt/angular-resource#1.5.0+20160613142217",
+ "angular-route": "registry:dt/angular-route#1.3.0+20160317120654",
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
+ "jquery": "registry:dt/jquery#1.10.0+20160704162008",
"node": "registry:dt/node#6.0.0+20160909174046"
}
}
diff --git a/public/docs/_examples/upgrade-adapter/e2e-spec.ts.disabled b/public/docs/_examples/upgrade-adapter/e2e-spec.ts.disabled
index de7ffa68cc..271224cccc 100644
--- a/public/docs/_examples/upgrade-adapter/e2e-spec.ts.disabled
+++ b/public/docs/_examples/upgrade-adapter/e2e-spec.ts.disabled
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by } from 'protractor';
+
describe('Upgrade Tests', function () {
// Protractor doesn't support the UpgradeAdapter's asynchronous
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/README.md b/public/docs/_examples/upgrade-phonecat-1-typescript/README.md
index dafa67ece9..5770656e86 100644
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/README.md
+++ b/public/docs/_examples/upgrade-phonecat-1-typescript/README.md
@@ -12,9 +12,6 @@ The following changes from vanilla Phonecat are applied:
in index.html and karma.conf.ng1.js.
* E2E tests have been moved to the parent directory, where `gulp run-e2e-tests` can
discover and run them along with all the other examples.
-* Angular 1 typings (from DefinitelyTyped) are added to typings-ng1 so that
- TypeScript can recognize Angular 1 code. (typings.json comes from boilerplate
- so we can't add them there).
* Most of the phone JSON and image data removed in the interest of keeping
repo weight down. Keeping enough to retain testability of the app.
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts.disabled
similarity index 92%
rename from public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts
rename to public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts.disabled
index 48b0f9baa9..4598a7f6dc 100644
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts
+++ b/public/docs/_examples/upgrade-phonecat-1-typescript/e2e-spec.ts.disabled
@@ -1,5 +1,7 @@
-///
-'use strict';
+'use strict'; // necessary for es6 output in node
+
+import { browser, element, by, ElementFinder } from 'protractor';
+import { setProtractorToNg1Mode } from '../protractor-helpers';
// Angular E2E Testing Guide:
// https://docs.angularjs.org/guide/e2e-testing
@@ -43,7 +45,7 @@ describe('PhoneCat Application', function() {
let phoneNameColumn = element.all(by.repeater('phone in $ctrl.phones').column('phone.name'));
function getNames() {
- return phoneNameColumn.map(function(elem) {
+ return phoneNameColumn.map(function(elem: ElementFinder) {
return elem.getText();
});
}
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/index.d.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/index.d.ts
deleted file mode 100644
index c720d9293a..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/index.d.ts
+++ /dev/null
@@ -1,294 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f0b2681b481397d0c03557ac2ac4d70c1c61c464/angularjs/angular-animate.d.ts
-declare module "angular-animate" {
- var _: string;
- export = _;
-}
-
-/**
- * ngAnimate module (angular-animate.js)
- */
-declare namespace angular.animate {
- interface IAnimateFactory {
- (...args: any[]): IAnimateCallbackObject;
- }
-
- interface IAnimateCallbackObject {
- eventFn?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
- setClass?: (element: IAugmentedJQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
- addClass?: (element: IAugmentedJQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
- removeClass?: (element: IAugmentedJQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
- enter?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
- leave?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
- move?: (element: IAugmentedJQuery, doneFunction: Function, options: IAnimationOptions) => any;
- animate?: (element: IAugmentedJQuery, fromStyles: string, toStyles: string, doneFunction: Function, options: IAnimationOptions) => any;
- }
-
- interface IAnimationPromise extends IPromise {}
-
- /**
- * AnimateService
- * see http://docs.angularjs.org/api/ngAnimate/service/$animate
- */
- interface IAnimateService {
- /**
- * Sets up an event listener to fire whenever the animation event has fired on the given element or among any of its children.
- *
- * @param event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
- * @param container the container element that will capture each of the animation events that are fired on itself as well as among its children
- * @param callback the callback function that will be fired when the listener is triggered
- */
- on(event: string, container: JQuery, callback: Function): void;
-
- /**
- * Deregisters an event listener based on the event which has been associated with the provided element.
- *
- * @param event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)
- * @param container the container element the event listener was placed on
- * @param callback the callback function that was registered as the listener
- */
- off(event: string, container?: JQuery, callback?: Function): void;
-
- /**
- * Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application.
- *
- * @param element the external element that will be pinned
- * @param parentElement the host parent element that will be associated with the external element
- */
- pin(element: JQuery, parentElement: JQuery): void;
-
- /**
- * Globally enables / disables animations.
- *
- * @param element If provided then the element will be used to represent the enable/disable operation.
- * @param value If provided then set the animation on or off.
- * @returns current animation state
- */
- enabled(element: JQuery, value?: boolean): boolean;
- enabled(value: boolean): boolean;
-
- /**
- * Cancels the provided animation.
- */
- cancel(animationPromise: IAnimationPromise): void;
-
- /**
- * Performs an inline animation on the element.
- *
- * @param element the element that will be the focus of the animation
- * @param from a collection of CSS styles that will be applied to the element at the start of the animation
- * @param to a collection of CSS styles that the element will animate towards
- * @param className an optional CSS class that will be added to the element for the duration of the animation (the default class is 'ng-inline-animate')
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- animate(element: JQuery, from: any, to: any, className?: string, options?: IAnimationOptions): IAnimationPromise;
-
- /**
- * Appends the element to the parentElement element that resides in the document and then runs the enter animation.
- *
- * @param element the element that will be the focus of the enter animation
- * @param parentElement the parent element of the element that will be the focus of the enter animation
- * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, options?: IAnimationOptions): IAnimationPromise;
-
- /**
- * Runs the leave animation operation and, upon completion, removes the element from the DOM.
- *
- * @param element the element that will be the focus of the leave animation
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- leave(element: JQuery, options?: IAnimationOptions): IAnimationPromise;
-
- /**
- * Fires the move DOM operation. Just before the animation starts, the animate service will either append
- * it into the parentElement container or add the element directly after the afterElement element if present.
- * Then the move animation will be run.
- *
- * @param element the element that will be the focus of the move animation
- * @param parentElement the parent element of the element that will be the focus of the move animation
- * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
- * @returns the animation callback promise
- */
- move(element: JQuery, parentElement: JQuery, afterElement?: JQuery): IAnimationPromise;
-
- /**
- * Triggers a custom animation event based off the className variable and then attaches the className
- * value to the element as a CSS class.
- *
- * @param element the element that will be animated
- * @param className the CSS class that will be added to the element and then animated
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- addClass(element: JQuery, className: string, options?: IAnimationOptions): IAnimationPromise;
-
- /**
- * Triggers a custom animation event based off the className variable and then removes the CSS class
- * provided by the className value from the element.
- *
- * @param element the element that will be animated
- * @param className the CSS class that will be animated and then removed from the element
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- removeClass(element: JQuery, className: string, options?: IAnimationOptions): IAnimationPromise;
-
- /**
- * Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
- * will be fired (if provided).
- *
- * @param element the element which will have its CSS classes changed removed from it
- * @param add the CSS classes which will be added to the element
- * @param remove the CSS class which will be removed from the element CSS classes have been set on the element
- * @param options an optional collection of styles that will be picked up by the CSS transition/animation
- * @returns the animation callback promise
- */
- setClass(element: JQuery, add: string, remove: string, options?: IAnimationOptions): IAnimationPromise;
- }
-
- /**
- * AnimateProvider
- * see http://docs.angularjs.org/api/ngAnimate/provider/$animateProvider
- */
- interface IAnimateProvider {
- /**
- * Registers a new injectable animation factory function.
- *
- * @param name The name of the animation.
- * @param factory The factory function that will be executed to return the animation object.
- */
- register(name: string, factory: IAnimateFactory): void;
-
- /**
- * Gets and/or sets the CSS class expression that is checked when performing an animation.
- *
- * @param expression The className expression which will be checked against all animations.
- * @returns The current CSS className expression value. If null then there is no expression value.
- */
- classNameFilter(expression?: RegExp): RegExp;
- }
-
- /**
- * Angular Animation Options
- * see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation
- */
- interface IAnimationOptions {
- /**
- * The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
- */
- to?: Object;
-
- /**
- * The starting CSS styles (a key/value object) that will be applied at the start of the animation.
- */
- from?: Object;
-
- /**
- * The DOM event (e.g. enter, leave, move). When used, a generated CSS class of ng-EVENT and
- * ng-EVENT-active will be applied to the element during the animation. Multiple events can be provided when
- * spaces are used as a separator. (Note that this will not perform any DOM operation.)
- */
- event?: string;
-
- /**
- * The CSS easing value that will be applied to the transition or keyframe animation (or both).
- */
- easing?: string;
-
- /**
- * The raw CSS transition style that will be used (e.g. 1s linear all).
- */
- transition?: string;
-
- /**
- * The raw CSS keyframe animation style that will be used (e.g. 1s my_animation linear).
- */
- keyframe?: string;
-
- /**
- * A space separated list of CSS classes that will be added to the element and spread across the animation.
- */
- addClass?: string;
-
- /**
- * A space separated list of CSS classes that will be removed from the element and spread across
- * the animation.
- */
- removeClass?: string;
-
- /**
- * A number value representing the total duration of the transition and/or keyframe (note that a value
- * of 1 is 1000ms). If a value of 0 is provided then the animation will be skipped entirely.
- */
- duration?: number;
-
- /**
- * A number value representing the total delay of the transition and/or keyframe (note that a value of
- * 1 is 1000ms). If a value of true is used then whatever delay value is detected from the CSS classes will be
- * mirrored on the elements styles (e.g. by setting delay true then the style value of the element will be
- * transition-delay: DETECTED_VALUE). Using true is useful when you want the CSS classes and inline styles to
- * all share the same CSS delay value.
- */
- delay?: number;
-
- /**
- * A numeric time value representing the delay between successively animated elements (Click here to
- * learn how CSS-based staggering works in ngAnimate.)
- */
- stagger?: number;
-
- /**
- * The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item
- * in the stagger; therefore when a stagger option value of 0.1 is used then there will be a stagger delay of 600ms)
- * applyClassesEarly - Whether or not the classes being added or removed will be used when detecting the animation.
- * This is set by $animate when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time.
- * (Note that this will prevent any transitions from occuring on the classes being added and removed.)
- */
- staggerIndex?: number;
- }
-
- interface IAnimateCssRunner {
- /**
- * Starts the animation
- *
- * @returns The animation runner with a done function for supplying a callback.
- */
- start(): IAnimateCssRunnerStart;
-
- /**
- * Ends (aborts) the animation
- */
- end(): void;
- }
-
- interface IAnimateCssRunnerStart extends IPromise {
- /**
- * Allows you to add done callbacks to the running animation
- *
- * @param callbackFn: the callback function to be run
- */
- done(callbackFn: (animationFinished: boolean) => void): void;
- }
-
- /**
- * AnimateCssService
- * see http://docs.angularjs.org/api/ngAnimate/service/$animateCss
- */
- interface IAnimateCssService {
- (element: JQuery, animateCssOptions: IAnimationOptions): IAnimateCssRunner;
- }
-}
-
-declare module angular {
- interface IModule {
- animation(name: string, animationFactory: angular.animate.IAnimateFactory): IModule;
- animation(name: string, inlineAnnotatedFunction: any[]): IModule;
- animation(object: Object): IModule;
- }
-
-}
\ No newline at end of file
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/typings.json b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/typings.json
deleted file mode 100644
index ea2467c89a..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-animate/typings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "resolution": "main",
- "tree": {
- "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f0b2681b481397d0c03557ac2ac4d70c1c61c464/angularjs/angular-animate.d.ts",
- "raw": "registry:dt/angular-animate#1.5.0+20160407085121",
- "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f0b2681b481397d0c03557ac2ac4d70c1c61c464/angularjs/angular-animate.d.ts"
- }
-}
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/index.d.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/index.d.ts
deleted file mode 100644
index fd6e92534b..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/index.d.ts
+++ /dev/null
@@ -1,339 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5b7257019ae959533341a715b339d2562bbf9b85/angularjs/angular-mocks.d.ts
-declare module "angular-mocks/ngMock" {
- var _: string;
- export = _;
-}
-
-declare module "angular-mocks/ngMockE2E" {
- var _: string;
- export = _;
-}
-
-declare module "angular-mocks/ngAnimateMock" {
- var _: string;
- export = _;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ngMock module (angular-mocks.js)
-///////////////////////////////////////////////////////////////////////////////
-declare namespace angular {
-
- ///////////////////////////////////////////////////////////////////////////
- // AngularStatic
- // We reopen it to add the MockStatic definition
- ///////////////////////////////////////////////////////////////////////////
- interface IAngularStatic {
- mock: IMockStatic;
- }
-
- // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject
- interface IInjectStatic {
- (...fns: Function[]): any;
- (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
- strictDi(val?: boolean): void;
- }
-
- interface IMockStatic {
- // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump
- dump(obj: any): string;
-
- inject: IInjectStatic
-
- // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module
- module: {
- (...modules: any[]): any;
- sharedInjector(): void;
- }
-
- // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate
- TzDate(offset: number, timestamp: number): Date;
- TzDate(offset: number, timestamp: string): Date;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ExceptionHandlerService
- // see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler
- // see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IExceptionHandlerProvider extends IServiceProvider {
- mode(mode: string): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // TimeoutService
- // see https://docs.angularjs.org/api/ngMock/service/$timeout
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface ITimeoutService {
- flush(delay?: number): void;
- flushNext(expectedDelay?: number): void;
- verifyNoPendingTasks(): void;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // IntervalService
- // see https://docs.angularjs.org/api/ngMock/service/$interval
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface IIntervalService {
- flush(millis?: number): number;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // LogService
- // see https://docs.angularjs.org/api/ngMock/service/$log
- // Augments the original service
- ///////////////////////////////////////////////////////////////////////////
- interface ILogService {
- assertEmpty(): void;
- reset(): void;
- }
-
- interface ILogCall {
- logs: string[];
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ControllerService mock
- // see https://docs.angularjs.org/api/ngMock/service/$controller
- // This interface extends http://docs.angularjs.org/api/ng.$controller
- ///////////////////////////////////////////////////////////////////////////
- interface IControllerService {
- // Although the documentation doesn't state this, locals are optional
- (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T;
- (controllerConstructor: Function, locals?: any, bindings?: any): T;
- (controllerName: string, locals?: any, bindings?: any): T;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // ComponentControllerService
- // see https://docs.angularjs.org/api/ngMock/service/$componentController
- ///////////////////////////////////////////////////////////////////////////
- interface IComponentControllerService {
- // TBinding is an interface exposed by a component as per John Papa's style guide
- // https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#accessible-members-up-top
- (componentName: string, locals: { $scope: IScope, [key: string]: any }, bindings?: TBinding, ident?: string): T;
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
- // HttpBackendService
- // see https://docs.angularjs.org/api/ngMock/service/$httpBackend
- ///////////////////////////////////////////////////////////////////////////
- interface IHttpBackendService {
- /**
- * Flushes all pending requests using the trained responses.
- * @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed.
- */
- flush(count?: number): void;
-
- /**
- * Resets all request expectations, but preserves all backend definitions.
- */
- resetExpectations(): void;
-
- /**
- * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception.
- */
- verifyNoOutstandingExpectation(): void;
-
- /**
- * Verifies that there are no outstanding requests that need to be flushed.
- */
- verifyNoOutstandingRequest(): void;
-
- /**
- * Creates a new request expectation.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param method HTTP method.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for DELETE requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected.
- * @param headers HTTP headers object to be compared with the HTTP headers in the request.
- */
- expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for GET requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object to be compared with the HTTP headers in the request.
- */
- expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for HEAD requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object to be compared with the HTTP headers in the request.
- */
- expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for JSONP requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- */
- expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for PATCH requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for POST requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new request expectation for PUT requests.
- * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param method HTTP method.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for DELETE requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for GET requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for HEAD requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for JSONP requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for PATCH requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for POST requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
-
- /**
- * Creates a new backend definition for PUT requests.
- * Returns an object with respond method that controls how a matched request is handled.
- * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation.
- * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation.
- * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation.
- */
- whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler;
- }
-
- export module mock {
- // returned interface by the the mocked HttpBackendService expect/when methods
- interface IRequestHandler {
-
- /**
- * Controls the response for a matched request using a function to construct the response.
- * Returns the RequestHandler object for possible overrides.
- * @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text.
- */
- respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler;
-
- /**
- * Controls the response for a matched request using supplied static data to construct the response.
- * Returns the RequestHandler object for possible overrides.
- * @param status HTTP status code to add to the response.
- * @param data Data to add to the response.
- * @param headers Headers object to add to the response.
- * @param responseText Response text to add to the response.
- */
- respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
-
- /**
- * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response.
- * Returns the RequestHandler object for possible overrides.
- * @param data Data to add to the response.
- * @param headers Headers object to add to the response.
- * @param responseText Response text to add to the response.
- */
- respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler;
-
- // Available when ngMockE2E is loaded
- /**
- * Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.)
- */
- passThrough(): IRequestHandler;
- }
-
- }
-
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// functions attached to global object (window)
-///////////////////////////////////////////////////////////////////////////////
-//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs.
-//declare var module: (...modules: any[]) => any;
-declare var inject: angular.IInjectStatic;
\ No newline at end of file
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/typings.json b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/typings.json
deleted file mode 100644
index 4e51b0e278..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-mocks/typings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "resolution": "main",
- "tree": {
- "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5b7257019ae959533341a715b339d2562bbf9b85/angularjs/angular-mocks.d.ts",
- "raw": "registry:dt/angular-mocks#1.3.0+20160425155016",
- "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5b7257019ae959533341a715b339d2562bbf9b85/angularjs/angular-mocks.d.ts"
- }
-}
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/index.d.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/index.d.ts
deleted file mode 100644
index 3735f9430c..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/index.d.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e684481e0cd360db62fd6213ca7248245315e8a2/angularjs/angular-resource.d.ts
-declare module 'angular-resource' {
- var _: string;
- export = _;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ngResource module (angular-resource.js)
-///////////////////////////////////////////////////////////////////////////////
-declare namespace angular.resource {
-
- /**
- * Currently supported options for the $resource factory options argument.
- */
- interface IResourceOptions {
- /**
- * If true then the trailing slashes from any calculated URL will be stripped (defaults to true)
- */
- stripTrailingSlashes?: boolean;
- /**
- * If true, the request made by a "non-instance" call will be cancelled (if not already completed) by calling
- * $cancelRequest() on the call's return value. This can be overwritten per action. (Defaults to false.)
- */
- cancellable?: boolean;
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
- // ResourceService
- // see http://docs.angularjs.org/api/ngResource.$resource
- // Most part of the following definitions were achieved by analyzing the
- // actual implementation, since the documentation doesn't seem to cover
- // that deeply.
- ///////////////////////////////////////////////////////////////////////////
- interface IResourceService {
- (url: string, paramDefaults?: any,
- /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
- where deleteDescriptor : IActionDescriptor */
- actions?: any, options?: IResourceOptions): IResourceClass>;
- (url: string, paramDefaults?: any,
- /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
- where deleteDescriptor : IActionDescriptor */
- actions?: any, options?: IResourceOptions): U;
- (url: string, paramDefaults?: any,
- /** example: {update: { method: 'PUT' }, delete: deleteDescriptor }
- where deleteDescriptor : IActionDescriptor */
- actions?: any, options?: IResourceOptions): IResourceClass;
- }
-
- // Just a reference to facilitate describing new actions
- interface IActionDescriptor {
- method: string;
- params?: any;
- url?: string;
- isArray?: boolean;
- transformRequest?: angular.IHttpRequestTransformer | angular.IHttpRequestTransformer[];
- transformResponse?: angular.IHttpResponseTransformer | angular.IHttpResponseTransformer[];
- headers?: any;
- cache?: boolean | angular.ICacheObject;
- /**
- * Note: In contrast to $http.config, promises are not supported in $resource, because the same value
- * would be used for multiple requests. If you are looking for a way to cancel requests, you should
- * use the cancellable option.
- */
- timeout?: number
- cancellable?: boolean;
- withCredentials?: boolean;
- responseType?: string;
- interceptor?: IHttpInterceptor;
- }
-
- // Allow specify more resource methods
- // No need to add duplicates for all four overloads.
- interface IResourceMethod {
- (): T;
- (params: Object): T;
- (success: Function, error?: Function): T;
- (params: Object, success: Function, error?: Function): T;
- (params: Object, data: Object, success?: Function, error?: Function): T;
- }
-
- // Allow specify resource moethod which returns the array
- // No need to add duplicates for all four overloads.
- interface IResourceArrayMethod {
- (): IResourceArray;
- (params: Object): IResourceArray;
- (success: Function, error?: Function): IResourceArray;
- (params: Object, success: Function, error?: Function): IResourceArray;
- (params: Object, data: Object, success?: Function, error?: Function): IResourceArray;
- }
-
- // Baseclass for everyresource with default actions.
- // If you define your new actions for the resource, you will need
- // to extend this interface and typecast the ResourceClass to it.
- //
- // In case of passing the first argument as anything but a function,
- // it's gonna be considered data if the action method is POST, PUT or
- // PATCH (in other words, methods with body). Otherwise, it's going
- // to be considered as parameters to the request.
- // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465
- //
- // Only those methods with an HTTP body do have 'data' as first parameter:
- // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L463
- // More specifically, those methods are POST, PUT and PATCH:
- // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L432
- //
- // Also, static calls always return the IResource (or IResourceArray) retrieved
- // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549
- interface IResourceClass {
- new(dataOrParams? : any) : T;
- get: IResourceMethod;
-
- query: IResourceArrayMethod;
-
- save: IResourceMethod;
-
- remove: IResourceMethod;
-
- delete: IResourceMethod;
- }
-
- // Instance calls always return the the promise of the request which retrieved the object
- // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546
- interface IResource {
- $get(): angular.IPromise;
- $get(params?: Object, success?: Function, error?: Function): angular.IPromise;
- $get(success: Function, error?: Function): angular.IPromise;
-
- $query(): angular.IPromise>;
- $query(params?: Object, success?: Function, error?: Function): angular.IPromise>;
- $query(success: Function, error?: Function): angular.IPromise>;
-
- $save(): angular.IPromise;
- $save(params?: Object, success?: Function, error?: Function): angular.IPromise;
- $save(success: Function, error?: Function): angular.IPromise;
-
- $remove(): angular.IPromise;
- $remove(params?: Object, success?: Function, error?: Function): angular.IPromise;
- $remove(success: Function, error?: Function): angular.IPromise;
-
- $delete(): angular.IPromise;
- $delete(params?: Object, success?: Function, error?: Function): angular.IPromise;
- $delete(success: Function, error?: Function): angular.IPromise;
-
- $cancelRequest(): void;
-
- /** the promise of the original server interaction that created this instance. **/
- $promise : angular.IPromise;
- $resolved : boolean;
- toJSON(): T;
- }
-
- /**
- * Really just a regular Array object with $promise and $resolve attached to it
- */
- interface IResourceArray extends Array> {
- /** the promise of the original server interaction that created this collection. **/
- $promise : angular.IPromise>;
- $resolved : boolean;
- }
-
- /** when creating a resource factory via IModule.factory */
- interface IResourceServiceFactoryFunction {
- ($resource: angular.resource.IResourceService): IResourceClass;
- >($resource: angular.resource.IResourceService): U;
- }
-
- // IResourceServiceProvider used to configure global settings
- interface IResourceServiceProvider extends angular.IServiceProvider {
-
- defaults: IResourceOptions;
- }
-
-}
-
-/** extensions to base ng based on using angular-resource */
-declare namespace angular {
-
- interface IModule {
- /** creating a resource service factory */
- factory(name: string, resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction): IModule;
- }
-}
-
-interface Array
-{
- /** the promise of the original server interaction that created this collection. **/
- $promise : angular.IPromise>;
- $resolved : boolean;
-}
\ No newline at end of file
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/typings.json b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/typings.json
deleted file mode 100644
index b60eafd673..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-resource/typings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "resolution": "main",
- "tree": {
- "src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e684481e0cd360db62fd6213ca7248245315e8a2/angularjs/angular-resource.d.ts",
- "raw": "registry:dt/angular-resource#1.5.0+20160412142209",
- "typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/e684481e0cd360db62fd6213ca7248245315e8a2/angularjs/angular-resource.d.ts"
- }
-}
diff --git a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-route/index.d.ts b/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-route/index.d.ts
deleted file mode 100644
index 5fad393d0a..0000000000
--- a/public/docs/_examples/upgrade-phonecat-1-typescript/ts/typings-ng1/globals/angular-route/index.d.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-// Generated by typings
-// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/angularjs/angular-route.d.ts
-declare module "angular-route" {
- var _: string;
- export = _;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// ngRoute module (angular-route.js)
-///////////////////////////////////////////////////////////////////////////////
-declare namespace angular.route {
-
- ///////////////////////////////////////////////////////////////////////////
- // RouteParamsService
- // see http://docs.angularjs.org/api/ngRoute.$routeParams
- ///////////////////////////////////////////////////////////////////////////
- interface IRouteParamsService {
- [key: string]: any;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- // RouteService
- // see http://docs.angularjs.org/api/ngRoute.$route
- // see http://docs.angularjs.org/api/ngRoute.$routeProvider
- ///////////////////////////////////////////////////////////////////////////
- interface IRouteService {
- reload(): void;
- routes: any;
-
- // May not always be available. For instance, current will not be available
- // to a controller that was not initialized as a result of a route maching.
- current?: ICurrentRoute;
-
- /**
- * Causes $route service to update the current URL, replacing current route parameters with those specified in newParams.
- * Provided property names that match the route's path segment definitions will be interpolated into the
- * location's path, while remaining properties will be treated as query params.
- *
- * @param newParams Object. mapping of URL parameter names to values
- */
- updateParams(newParams:{[key:string]:string}): void;
-
- }
-
- type InlineAnnotatedFunction = Function|Array
-
- /**
- * see http://docs.angularjs.org/api/ngRoute/provider/$routeProvider#when for API documentation
- */
- interface IRoute {
- /**
- * {(string|function()=}
- * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string.
- */
- controller?: string|InlineAnnotatedFunction;
- /**
- * A controller alias name. If present the controller will be published to scope under the controllerAs name.
- */
- controllerAs?: string;
- /**
- * Undocumented?
- */
- name?: string;
- /**
- * {string=|function()=}
- * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl.
- *
- * If template is a function, it will be called with the following parameters:
- *
- * {Array.