diff --git a/.gitignore b/.gitignore index b6d52bd9b9..679af37907 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,12 @@ _.* **/resources/zips public/docs/xref-*.* _zip-output -www +www* npm-debug*.log* *.plnkr.html plnkr.html +*.eplnkr.html +eplnkr.html *plnkr.no-link.html public/docs/*/latest/guide/cheatsheet.json protractor-results.txt diff --git a/.travis.yml b/.travis.yml index bf6b8894aa..7a87796437 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,18 +12,17 @@ env: - CHROME_BIN=chromium-browser - LATEST_RELEASE=2.0.0-rc.5 - TASK_FLAGS="--dgeni-log=warn" - # - TASK_FLAGS="" matrix: - TASK=lint - TASK="run-e2e-tests --fast" SCRIPT=examples-install.sh - TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh - - TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50" - - TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" + - TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" + - TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" matrix: fast_finish: true allow_failures: - env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh - - env: TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" + - env: TASK=build-compile SCRIPT=deploy-install-preview.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" before_install: - source ./scripts/env-set.sh - ./scripts/before-install.sh @@ -34,3 +33,4 @@ before_script: - sh -e /etc/init.d/xvfb start script: - $WAIT gulp $TASK $TASK_FLAGS + - if [[ -n "$POST_SCRIPT" ]]; then ./scripts/$POST_SCRIPT; fi diff --git a/gulpfile.js b/gulpfile.js index 33a555d09e..366310ec49 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,7 +45,8 @@ var STYLES_SOURCE_PATH = path.join(TOOLS_PATH, 'styles-builder/less'); var docShredder = require(path.resolve(TOOLS_PATH, 'doc-shredder/doc-shredder')); var exampleZipper = require(path.resolve(TOOLS_PATH, '_example-zipper/exampleZipper')); -var plunkerBuilder = require(path.resolve(TOOLS_PATH, 'plunker-builder/plunkerBuilder')); +var regularPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/regularPlunker')); +var embeddedPlunker = require(path.resolve(TOOLS_PATH, 'plunker-builder/embeddedPlunker')); var fsUtils = require(path.resolve(TOOLS_PATH, 'fs-utils/fsUtils')); const isSilent = !!argv.silent; @@ -72,9 +73,10 @@ var _apiShredOptions = { logLevel: _dgeniLogLevel }; +const relDartDocApiDir = path.join('doc', 'api'); var _apiShredOptionsForDart = { lang: 'dart', - examplesDir: path.resolve(ngPathFor('dart'), 'examples'), + examplesDir: path.resolve(ngPathFor('dart'), 'example'), fragmentsDir: path.join(DOCS_PATH, '_fragments/_api'), zipDir: path.join(RESOURCES_PATH, 'zips/api'), logLevel: _dgeniLogLevel @@ -118,22 +120,35 @@ var _styleLessName = 'a2docs.less'; // or a regex pattern to match any one of 'ts', 'js', or 'dart'. // Default: 'ts|js' except for the "full site build" tasks (see below), // for which it is 'all'. -// -var lang, langs, buildDartApiDocs = false; + +// langs and skipLangs partition ['ts', 'js', 'dart']. +var lang, langs, skipLangs, buildDartApiDocs = false; function configLangs(langOption) { - const fullSiteBuildTasks = ['build-compile', 'check-serve', 'check-deploy']; + const fullSiteBuildTasks = ['build-compile', 'check-deploy', 'harp-compile']; const buildAllDocs = argv['_'] && fullSiteBuildTasks.some((task) => argv['_'].indexOf(task) >= 0); const langDefault = buildAllDocs ? 'all' : 'ts|js'; - lang = (langOption || langDefault).toLowerCase(); - if (lang === 'all') lang = 'ts|js|dart'; - langs = lang.match(/\w+/g); // the languages in `lang` as an array - gutil.log('Building docs for: ' + lang); + if (langOption === '') { + lang = ''; + langs = []; + } else { + lang = (langOption || langDefault).toLowerCase(); + if (lang === 'all') lang = 'ts|js|dart'; + langs = lang.match(/\w+/g); // the languages in `lang` as an array + } + gutil.log(`Building docs for: [${langs}]`); if (langs.indexOf('dart') >= 0) { buildDartApiDocs = true; // For Dart, be proactive about checking for the repo checkAngularProjectPath(ngPathFor('dart')); + } else { + argv.pub = false; } + skipLangs = []; + ['ts', 'js', 'dart'].forEach(lang => { + if (langs.indexOf(lang) < 0) skipLangs.push(lang); + }); + gutil.log(`Skipped languages: [${skipLangs}]`); } configLangs(argv.lang); @@ -346,6 +361,7 @@ function runE2eDartTests(appDir, outputFile) { } if (argv.pub === false) { var prepPromise = Promise.resolve(true); + gutil.log('Skipping pub upgrade and pub build (--no-pub flag present)'); } else { var pubUpgradeSpawnInfo = spawnExt('pub', ['upgrade'], { cwd: appDir }); var prepPromise = pubUpgradeSpawnInfo.promise.then(function (data) { @@ -508,23 +524,42 @@ gulp.task('remove-example-boilerplate', function() { // either release or current build packages // Examples: // gulp install-example-angular --build // use current build packages +// gulp install-example-angular --build=2.0.0-b43f954 // use tagged packages // gulp install-example-angular // restore release packages +// +// Find the tags here: https://github.com/angular/core-builds/releases gulp.task('install-example-angular', installExampleAngular); function installExampleAngular() { var sources; var template; var libs = [ - 'core', 'common', 'compiler', + 'core', 'common', 'compiler', 'compiler-cli', 'platform-browser', 'platform-browser-dynamic', 'forms', 'http', 'router', 'upgrade']; + var build = argv.build; + if (build) { + if (typeof build === 'string') { + build = (build[0]==='#' ? '' : '#') + build; + } else { + build = ''; + } + } else{ + build = 'npm'; + } // Like: "angular/core-builds" or "@angular/core" - sources = libs.map( lib => argv.build ? `angular/${lib}-builds` : `@angular/${lib}`); + sources = libs.map( lib => { + return build === 'npm' + ? `@angular/${lib}` + : `git+https://github.com/angular/${lib}-builds${build}`; + }); + + if (argv.build) { sources.push('@angular/tsc-wrapped');} // tsc-wrapped needed for builds sources.push('@angular/router-deprecated'); - gutil.log(`Installing Angular npm packages from ${argv.build ? 'BUILD' : 'RELEASE'}`); + gutil.log(`Installing Angular packages from ${build === 'npm' ? 'NPM' : 'BUILD ' + build}`); var spawnInfo = spawnExt('rm', ['-rf', 'node_modules/@angular'], { cwd: EXAMPLES_PATH}); return spawnInfo.promise @@ -598,8 +633,10 @@ gulp.task('build-dart-api-docs', ['_shred-api-examples', 'dartdoc'], function() return buildApiDocsForDart(); }); +// Using the --build flag will use systemjs.config.plunker.build.js (for preview builds) gulp.task('build-plunkers', ['_copy-example-boilerplate'], function() { - return plunkerBuilder.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); + regularPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); + return embeddedPlunker.buildPlunkers(EXAMPLES_PATH, LIVE_EXAMPLES_PATH, { errFn: gutil.log, build: argv.build }); }); gulp.task('build-dart-cheatsheet', [], function() { @@ -608,8 +645,8 @@ gulp.task('build-dart-cheatsheet', [], function() { gulp.task('dartdoc', ['pub upgrade'], function() { const ngRepoPath = ngPathFor('dart'); - if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, 'docs', 'api'))) { - gutil.log('Skipping dartdoc: --fast flag enabled and "docs/api" dir exists'); + if (argv.fast && fs.existsSync(path.resolve(ngRepoPath, relDartDocApiDir))) { + gutil.log(`Skipping dartdoc: --fast flag enabled and api dir exists (${relDartDocApiDir})`); return true; } checkAngularProjectPath(ngRepoPath); @@ -618,7 +655,7 @@ gulp.task('dartdoc', ['pub upgrade'], function() { renameIfExistsSync(topLevelLibFilePath, tmpPath); gutil.log(`Hiding top-level angular2 library: ${topLevelLibFilePath}`); // Remove dartdoc '--add-crossdart' flag while we are fixing links to API pages. - const dartdoc = spawnExt('dartdoc', ['--output', 'docs/api'], { cwd: ngRepoPath}); + const dartdoc = spawnExt('dartdoc', ['--output', relDartDocApiDir], { cwd: ngRepoPath}); return dartdoc.promise.finally(() => { gutil.log(`Restoring top-level angular2 library: ${topLevelLibFilePath}`); renameIfExistsSync(tmpPath, topLevelLibFilePath); @@ -682,12 +719,12 @@ gulp.task('git-changed-examples', ['_shred-devguide-examples'], function(){ }); }); -gulp.task('harp-compile', [], function() { +gulp.task('harp-compile', () => { return harpCompile() }); -gulp.task('serve', [], function() { - // Harp will serve files from workspace. +gulp.task('harp-serve', () => { + // Harp will watch and serve workspace files. const cmd = 'npm run harp -- server .'; gutil.log('Launching harp server (over project files)'); gutil.log(` > ${cmd}`); @@ -695,7 +732,7 @@ gulp.task('serve', [], function() { return execPromise(cmd); }); -gulp.task('serve-www', [], function() { +gulp.task('serve-www', () => { // Serve generated site. return execPromise('npm run live-server ./www'); }); @@ -704,13 +741,6 @@ gulp.task('build-compile', ['build-docs'], function() { return harpCompile(); }); -gulp.task('check-serve', ['build-docs'], function() { - return harpCompile().then(function() { - gutil.log('Launching live-server over ./www'); - return execPromise('npm run live-server ./www'); - }); -}); - gulp.task('check-deploy', ['build-docs'], function() { return harpCompile().then(function() { gutil.log('compile ok'); @@ -806,7 +836,7 @@ gulp.task('_shred-clean-devguide', function(cb) { gulp.task('_shred-api-examples', ['_shred-clean-api'], function() { const promises = []; gutil.log('Shredding API examples for languages: ' + langs.join(', ')); - langs.forEach((lang) => { + langs.forEach(lang => { if (lang === 'js') return; // JS is handled via TS. checkAngularProjectPath(ngPathFor(lang)); const options = lang == 'dart' ? _apiShredOptionsForDart : _apiShredOptions; @@ -856,26 +886,40 @@ gulp.task('lint', function() { function harpCompile() { // Supposedly running in production makes harp faster // and less likely to drown in node_modules. - env({ - vars: { NODE_ENV: "production" } - }); + env({ vars: { NODE_ENV: "production" } }); gutil.log("NODE_ENV: " + process.env.NODE_ENV); + if(skipLangs && fs.existsSync('www') && backupApiHtmlFilesExist('www')) { + gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`); + gutil.log(`API docs will be copied from existing www folder.`) + del.sync('www-backup'); // remove existing backup if it exists + renameIfExistsSync('www', 'www-backup'); + } else { + gutil.log(`Harp full site compile, including API docs for all languages.`); + if (skipLangs) + gutil.log(`Ignoring API docs skip set (${skipLangs}) because full ` + + `site has not been built yet or some API HTML files are missing.`); + } + var deferred = Q.defer(); gutil.log('running harp compile...'); showHideExampleNodeModules('hide'); + showHideApiDir('hide'); var spawnInfo = spawnExt('npm',['run','harp', '--', 'compile', '.', './www' ]); spawnInfo.promise.then(function(x) { gutil.log("NODE_ENV: " + process.env.NODE_ENV); showHideExampleNodeModules('show'); + showHideApiDir('show'); if (x !== 0) { deferred.reject(x) } else { + restoreApiHtml(); deferred.resolve(x); } }).catch(function(e) { gutil.log("NODE_ENV: " + process.env.NODE_ENV); showHideExampleNodeModules('show'); + showHideApiDir('show'); deferred.reject(e); }); return deferred.promise; @@ -974,6 +1018,52 @@ function showHideExampleNodeModules(showOrHide) { } } +// Show/hide the API docs harp source folder for every lang in skipLangs. +function showHideApiDir(showOrHide) { + skipLangs.forEach(lang => { + _showHideApiDir(lang, showOrHide); + }); +} + +// Rename the API docs harp source folder for lang to/from 'api' to '_api-tmp-foo'. +function _showHideApiDir(lang, showOrHide) { + const vers = 'latest'; + const basePath = path.join(DOCS_PATH, lang, vers); + const apiDirPath = path.join(basePath, 'api'); + const disabledApiDirPath = path.join(basePath, '_api-tmp-hide-from-jade'); + const args = showOrHide == 'hide' + ? [apiDirPath, disabledApiDirPath] + : [disabledApiDirPath, apiDirPath]; + renameIfExistsSync(...args); +} + +// For each lang in skipLangs, copy the API dir from www-backup to www. +function restoreApiHtml() { + const vers = 'latest'; + skipLangs.forEach(lang => { + const relApiDir = path.join('docs', lang, vers, 'api'); + const wwwApiSubdir = path.join('www', relApiDir); + const backupApiSubdir = path.join('www-backup', relApiDir); + gutil.log(`cp ${backupApiSubdir} ${wwwApiSubdir}`) + fs.copySync(backupApiSubdir, wwwApiSubdir); + }); +} + +// For each lang in skipLangs, ensure API dir exists in www-backup +function backupApiHtmlFilesExist(folderName) { + const vers = 'latest'; + var result = 1; + skipLangs.forEach(lang => { + const relApiDir = path.join('docs', lang, vers, 'api'); + const backupApiSubdir = path.join(folderName, relApiDir); + if (!fs.existsSync(backupApiSubdir)) { + gutil.log(`WARNING: API docs HTML folder doesn't exist: ${backupApiSubdir}`); + result = 0; + } + }); + return result; +} + // Copies fileNames into destPaths, setting the mode of the // files at the destination as optional_destFileMode if given. // returns a promise @@ -1073,11 +1163,16 @@ function watchAndSync(options, cb) { var browserSync = require('browser-sync').create(); browserSync.init({proxy: 'localhost:9000'}); + // When using the --focus=name flag, only **/name/**/*.* example files and + // **/name.jade files are watched. This is useful for performance reasons. + // Example: gulp serve-and-sync --focus=architecture + var focus = argv.focus; + if (options.devGuide) { - devGuideExamplesWatch(_devguideShredOptions, browserSync.reload); + devGuideExamplesWatch(_devguideShredOptions, browserSync.reload, focus); } if (options.devGuideJade) { - devGuideSharedJadeWatch( { jadeDir: DOCS_PATH}, browserSync.reload); + devGuideSharedJadeWatch( { jadeDir: DOCS_PATH}, browserSync.reload, focus); } if (options.apiDocs) { apiSourceWatch(browserSync.reload); @@ -1092,11 +1187,10 @@ function watchAndSync(options, cb) { // returns a promise; function askDeploy() { - prompt.start(); var schema = { name: 'shouldDeploy', - description: 'Deploy to Firebase? (y/n): ', + description: 'Deploy to Firebase? (y/n)', type: 'string', pattern: /Y|N|y|n/, message: "Respond with either a 'y' or 'n'", @@ -1145,8 +1239,9 @@ function apiExamplesWatch(postShredAction) { }); } -function devGuideExamplesWatch(shredOptions, postShredAction) { - var includePattern = path.join(shredOptions.examplesDir, '**/*.*'); +function devGuideExamplesWatch(shredOptions, postShredAction, focus) { + var watchPattern = focus ? '**/' + focus + '/**/*.*' : '**/*.*'; + var includePattern = path.join(shredOptions.examplesDir, watchPattern); // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { @@ -1162,8 +1257,9 @@ function devGuideExamplesWatch(shredOptions, postShredAction) { }); } -function devGuideSharedJadeWatch(shredOptions, postShredAction) { - var includePattern = path.join(DOCS_PATH, '**/*.jade'); +function devGuideSharedJadeWatch(shredOptions, postShredAction, focus) { + var watchPattern = focus ? '**/' + focus + '.jade' : '**/*.jade'; + var includePattern = path.join(DOCS_PATH, watchPattern); // removed this version because gulp.watch has the same glob issue that dgeni has. // var excludePattern = '!' + path.join(shredOptions.jadeDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { @@ -1246,7 +1342,7 @@ function buildApiDocsForDart() { log.level = _dgeniLogLevel; const dabInfo = dab.dartPkgConfigInfo; dabInfo.ngIoDartApiDocPath = path.join(DOCS_PATH, 'dart', vers, 'api'); - dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), 'docs', 'api'); + dabInfo.ngDartDocPath = path.join(ngPathFor('dart'), relDartDocApiDir); // Exclude API entries for developer/internal libraries. Also exclude entries for // the top-level catch all "angular2" library (otherwise every entry appears twice). dabInfo.excludeLibRegExp = new RegExp(/^(?!angular2)|\.testing|_|codegen|^angular2$/); @@ -1461,8 +1557,9 @@ function checkAngularProjectPath(_ngPath) { function renameIfExistsSync(oldPath, newPath) { if (fs.existsSync(oldPath)) { - fs.renameSync(oldPath, newPath); + gutil.log(`Rename: mv ${oldPath} ${newPath}`); + fs.renameSync(oldPath, newPath); } else { - gutil.log(`renameIfExistsSync cannot find file to rename: ${oldPath}`); + gutil.log(`renameIfExistsSync cannot rename, path not found: ${oldPath}`); } } diff --git a/package.json b/package.json index 2e848d239c..f13d2126c1 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "protractor": "^3.0.0", "q": "^1.4.1", "tree-kill": "^1.0.0", - "tslint": "^3.2.2", + "tslint": "^3.15.1", "yargs": "^4.7.1" }, "dependencies": { diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade index d2ce8d2639..f7e9a27ae3 100644 --- a/public/_includes/_hero.jade +++ b/public/_includes/_hero.jade @@ -35,5 +35,8 @@ header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "") else if current.path[3] == 'api' && current.path[1] == 'dart' block breadcrumbs + //- Show cross-language menu for top-level API page (but not entry pages) + if ! public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]] + != partial("_version-dropdown") else if current.path[0] == "docs" != partial("_version-dropdown") diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade index 946f82d2f4..3e580095c3 100644 --- a/public/_includes/_util-fns.jade +++ b/public/_includes/_util-fns.jade @@ -155,64 +155,66 @@ mixin makeJson( filePath, jsonConfig, title, stylePatterns) else != styleString(jsonExtract, stylePatterns) -- // Open (and close) an explanation
..... and we need
- // to remove this from the fragment prefix is 11 long and suffix is 13 long
-- frag = frag.substring(11, frag.length-13);
+- frag = jade2ng ? frag : frag.substring(11, frag.length-13);
- // Uncomment next line for debugging.
- // frag = "FileName: " + fullFileName + " Current path: " + current.path + " PathToDocs: " + getPathToDocs() + "\n" + frag;
- return frag;
diff --git a/public/_includes/_version-dropdown.jade b/public/_includes/_version-dropdown.jade
index 0525aa4fee..91db1cc9b9 100644
--- a/public/_includes/_version-dropdown.jade
+++ b/public/_includes/_version-dropdown.jade
@@ -5,7 +5,7 @@
- var version = ''
- var page = ''
-
+//- Replace _ underscores with . dots
if current.path[2]
- var version = current.path[2].replace(/\_+/gm, ".")
@@ -33,7 +33,7 @@ else if current.path[3]
else
- var page = current.path[3] + '.html'
-
+//- VERSION TREE CREATOR MIXIN
mixin tree(directory, urlPrefix, name, latest)
ul
for val, semvar in directory
@@ -42,7 +42,7 @@ mixin tree(directory, urlPrefix, name, latest)
li #{name} #{libVersion}
-
+//- BUTTON TITLE GENERATION
if language == 'ts'
if version == "latest"
- var title = 'Angular 2 for TypeScript'
@@ -72,4 +72,6 @@ nav.dropdown
div(class="dropdown-menu" ng-class="appCtrl.showMenu ? 'is-visible' : ''")
mixin tree(public.docs.ts, "/docs/ts", "Angular 2 for TypeScript")
mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript")
- mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")
+ //- Disable cross-language link for API entry pages (but keep for top API search page):
+ if ! (current.path[3] === 'api' && public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]])
+ mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")
diff --git a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts
index 621d144a1f..39d69f2c91 100644
--- a/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts
+++ b/public/docs/_examples/animations/ts/app/hero-list-auto.component.ts
@@ -17,7 +17,7 @@ import { Heroes } from './hero.service';
template: `
{{ msg }}
' }).Class({ constructor: [ [ @@ -14,20 +14,14 @@ new ng.core.Inject('titlePrefix') ], new ng.core.Attribute('title'), - [ - new ng.core.Query('okMsg'), - ng.core.ElementRef - ], - function(titlePrefix, title, msg) { + function(titlePrefix, title) { this.titlePrefix = titlePrefix; this.title = title; - this.msg = msg; + this.msg = ''; } ], ok: function() { - var msgEl = - this.msg.first.nativeElement; - msgEl.textContent = 'OK!'; + this.msg = 'OK!'; } }); // #enddocregion @@ -35,7 +29,6 @@ var AppComponent = ng.core.Component({ selector: 'hero-di-inject-additional', template: '{{ msg }}
` }) class TitleComponent { + private msg: string = ''; constructor( @Inject('titlePrefix') @Optional() private titlePrefix: string, @Attribute('title') - private title: string, - @Query('okMsg') - private msg: QueryList
Welcome, {{user}}
diff --git a/public/docs/_examples/ngmodule/ts/app/shared/title.component.ts b/public/docs/_examples/ngmodule/ts/app/core/title.component.ts
similarity index 77%
rename from public/docs/_examples/ngmodule/ts/app/shared/title.component.ts
rename to public/docs/_examples/ngmodule/ts/app/core/title.component.ts
index c3f35b5d32..ca8cffe9d5 100644
--- a/public/docs/_examples/ngmodule/ts/app/shared/title.component.ts
+++ b/public/docs/_examples/ngmodule/ts/app/core/title.component.ts
@@ -1,10 +1,10 @@
// Exact copy of app/title.component.ts except import UserService from shared
import { Component, Input } from '@angular/core';
-import { UserService } from './user.service';
+import { UserService } from '../core/user.service';
@Component({
selector: 'app-title',
- templateUrl: 'app/shared/title.component.html',
+ templateUrl: 'app/core/title.component.html',
})
export class TitleComponent {
@Input() subtitle = '';
diff --git a/public/docs/_examples/ngmodule/ts/app/core/user.service.ts b/public/docs/_examples/ngmodule/ts/app/core/user.service.ts
new file mode 100644
index 0000000000..8fe839075e
--- /dev/null
+++ b/public/docs/_examples/ngmodule/ts/app/core/user.service.ts
@@ -0,0 +1,32 @@
+// Crazy copy of the app/user.service
+// Proves that UserService is an app-wide singleton and only instantiated once
+// IFF shared.module follows the `forRoot` pattern
+//
+// If it didn't, a new instance of UserService would be created
+// after each lazy load and the userName would double up.
+
+import { Injectable, Optional } from '@angular/core';
+
+let nextId = 1;
+
+export class UserServiceConfig {
+ userName = 'Philip Marlowe';
+}
+
+@Injectable()
+export class UserService {
+ id = nextId++;
+ private _userName = 'Sherlock Holmes';
+
+ // #docregion ctor
+ constructor(@Optional() config: UserServiceConfig) {
+ if (config) { this._userName = config.userName; }
+ }
+ // #enddocregion ctor
+
+ get userName() {
+ // Demo: add a suffix if this service has been created more than once
+ const suffix = this.id > 1 ? ` times ${this.id}` : '';
+ return this._userName + suffix;
+ }
+}
diff --git a/public/docs/_examples/ngmodule/ts/app/crisis/crisis-detail.component.ts b/public/docs/_examples/ngmodule/ts/app/crisis/crisis-detail.component.ts
index da9efb3b2b..9749029d62 100644
--- a/public/docs/_examples/ngmodule/ts/app/crisis/crisis-detail.component.ts
+++ b/public/docs/_examples/ngmodule/ts/app/crisis/crisis-detail.component.ts
@@ -1,5 +1,5 @@
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
+import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
@Component({
template: `
diff --git a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.module.ts b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.module.ts
index 6a759cf87e..40491985dc 100644
--- a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.module.ts
+++ b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.module.ts
@@ -11,6 +11,4 @@ import { routing } from './crisis.routing';
declarations: [ CrisisDetailComponent, CrisisListComponent ],
providers: [ CrisisService ]
})
-// #docregion export-default
-export default class CrisisModule {}
-// #enddocregion export-default
+export class CrisisModule {}
diff --git a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts
index c9aeb83d5f..4d8d711d65 100644
--- a/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts
+++ b/public/docs/_examples/ngmodule/ts/app/crisis/crisis.routing.ts
@@ -1,6 +1,6 @@
import { ModuleWithProviders } from '@angular/core';
import { Routes,
- RouterModule } from '@angular/router';
+ RouterModule } from '@angular/router';
import { CrisisListComponent } from './crisis-list.component';
import { CrisisDetailComponent } from './crisis-detail.component';
diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.component.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.component.ts
index 3329e25cc0..86338fb0ae 100644
--- a/public/docs/_examples/ngmodule/ts/app/hero/hero.component.ts
+++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.component.ts
@@ -1,8 +1,8 @@
-// Exact copy except import UserService from shared
+// Exact copy except import UserService from core
import { Component } from '@angular/core';
import { HeroService } from './hero.service';
-import { UserService } from '../shared/user.service';
+import { UserService } from '../core/user.service';
@Component({
template: `
diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.module.3.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.module.3.ts
index def1432fc4..95f58730f5 100644
--- a/public/docs/_examples/ngmodule/ts/app/hero/hero.module.3.ts
+++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.module.3.ts
@@ -1,20 +1,25 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
-import { HeroComponent } from './hero.component.3';
-import { HeroDetailComponent } from './hero-detail.component';
-import { HeroListComponent } from './hero-list.component';
-import { HighlightDirective } from './highlight.directive';
-import { routing } from './hero.routing.3';
+import { HeroComponent } from './hero.component.3';
+import { HeroDetailComponent } from './hero-detail.component';
+import { HeroListComponent } from './hero-list.component';
+import { HighlightDirective } from './highlight.directive';
+import { routing } from './hero.routing.3';
+
+// TODO: Remove in RC 6
+import { HeroService } from './hero.service';
// #docregion class
@NgModule({
imports: [ CommonModule, FormsModule, routing ],
+ // TODO: Remove in RC 6
+ providers: [ HeroService ],
declarations: [
HeroComponent, HeroDetailComponent, HeroListComponent,
HighlightDirective
]
})
-export default class HeroModule { }
+export class HeroModule { }
// #enddocregion class
diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.module.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.module.ts
index d49455fa0b..c3f7d73270 100644
--- a/public/docs/_examples/ngmodule/ts/app/hero/hero.module.ts
+++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.module.ts
@@ -1,23 +1,21 @@
-import { NgModule } from '@angular/core';
+import { NgModule } from '@angular/core';
-import { SharedModule } from '../shared/shared.module';
+import { SharedModule } from '../shared/shared.module';
-import { HeroComponent } from './hero.component';
-import { HeroDetailComponent } from './hero-detail.component';
-import { HeroListComponent } from './hero-list.component';
-import { routing } from './hero.routing';
+import { HeroComponent } from './hero.component';
+import { HeroDetailComponent } from './hero-detail.component';
+import { HeroListComponent } from './hero-list.component';
+import { routing } from './hero.routing';
-/*
- * TODO: Remove THE HeroService class and provider after
- * https://github.com/angular/angular/pull/10579 lands
- */
+// TODO: Remove THE HeroService class in RC 6
import { HeroService } from './hero.service';
@NgModule({
imports: [ SharedModule, routing ],
+ // TODO: Remove in RC 6
providers: [ HeroService ],
declarations: [
HeroComponent, HeroDetailComponent, HeroListComponent,
]
})
-export default class HeroModule { }
+export class HeroModule { }
diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts
index e14d4a7725..132d21b29e 100644
--- a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts
+++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.3.ts
@@ -1,10 +1,10 @@
import { ModuleWithProviders } from '@angular/core';
import { Routes,
- RouterModule } from '@angular/router';
+ RouterModule } from '@angular/router';
-import { HeroComponent } from './hero.component.3';
-import { HeroListComponent } from './hero-list.component';
-import { HeroDetailComponent } from './hero-detail.component';
+import { HeroComponent } from './hero.component.3';
+import { HeroListComponent } from './hero-list.component';
+import { HeroDetailComponent } from './hero-detail.component';
const routes: Routes = [
{ path: '',
diff --git a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts
index 7f364ee988..f1b4285ecd 100644
--- a/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts
+++ b/public/docs/_examples/ngmodule/ts/app/hero/hero.routing.ts
@@ -1,10 +1,10 @@
import { ModuleWithProviders } from '@angular/core';
import { Routes,
- RouterModule } from '@angular/router';
+ RouterModule } from '@angular/router';
-import { HeroComponent } from './hero.component';
-import { HeroListComponent } from './hero-list.component';
-import { HeroDetailComponent } from './hero-detail.component';
+import { HeroComponent } from './hero.component';
+import { HeroListComponent } from './hero-list.component';
+import { HeroDetailComponent } from './hero-detail.component';
const routes: Routes = [
{ path: '',
diff --git a/public/docs/_examples/ngmodule/ts/app/shared/shared.module.ts b/public/docs/_examples/ngmodule/ts/app/shared/shared.module.ts
index 5991278d44..2da7d7b2a5 100644
--- a/public/docs/_examples/ngmodule/ts/app/shared/shared.module.ts
+++ b/public/docs/_examples/ngmodule/ts/app/shared/shared.module.ts
@@ -1,40 +1,18 @@
// #docregion
-import { NgModule,
- ModuleWithProviders } from '@angular/core';
+import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AwesomePipe } from './awesome.pipe';
import { HighlightDirective } from './highlight.directive';
-import { TitleComponent } from './title.component';
-import { UserService } from './user.service';
-// #docregion shared-module
+// #docregion module
@NgModule({
imports: [ CommonModule ],
- declarations: [ AwesomePipe, HighlightDirective, TitleComponent ],
- exports: [ AwesomePipe, HighlightDirective, TitleComponent,
+ declarations: [ AwesomePipe, HighlightDirective ],
+ exports: [ AwesomePipe, HighlightDirective,
CommonModule, FormsModule ]
})
-export class SharedModule {
-
-// #docregion for-root
- static forRoot(): ModuleWithProviders {
- return {
- ngModule: SharedModule,
- providers: [ UserService ]
- };
- }
-// #enddocregion for-root
-}
-
-// #enddocregion shared-module
+export class SharedModule { }
+// #enddocregion module
// #enddocregion
-
-// #docregion shared-root-module
-@NgModule({
- exports: [ SharedModule ],
- providers: [ UserService ]
-})
-export class SharedRootModule { }
-// #enddocregion shared-root-module
diff --git a/public/docs/_examples/ngmodule/ts/app/shared/user.service.ts b/public/docs/_examples/ngmodule/ts/app/shared/user.service.ts
deleted file mode 100644
index d32b20b043..0000000000
--- a/public/docs/_examples/ngmodule/ts/app/shared/user.service.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// Crazy copy of the app/user.service
-// Proves that UserService is an app-wide singleton and only instantiated once
-// IFF shared.module follows the `forRoot` pattern
-//
-// If it didn't, a new instance of UserService would be created
-// after each lazy load and the userName would double up.
-
-import { Injectable } from '@angular/core';
-
-@Injectable()
-export class UserService {
-
- static userName = '';
-
- constructor() {
- UserService.userName += UserService.userName || 'Sam Spade';
- }
-
- get userName() { return UserService.userName; }
-}
diff --git a/public/docs/_examples/ngmodule/ts/app/user.service.ts b/public/docs/_examples/ngmodule/ts/app/user.service.ts
index cf31db5da5..7d996b26fa 100644
--- a/public/docs/_examples/ngmodule/ts/app/user.service.ts
+++ b/public/docs/_examples/ngmodule/ts/app/user.service.ts
@@ -4,5 +4,5 @@ import { Injectable } from '@angular/core';
@Injectable()
/** Dummy version of an authenticated user service */
export class UserService {
- userName = 'Sam Spade';
+ userName = 'Sherlock Holmes';
}
diff --git a/public/docs/_examples/ngmodule/ts/contact.1b.plnkr.json b/public/docs/_examples/ngmodule/ts/contact.1b.plnkr.json
index 77804a3be1..090a440059 100644
--- a/public/docs/_examples/ngmodule/ts/contact.1b.plnkr.json
+++ b/public/docs/_examples/ngmodule/ts/contact.1b.plnkr.json
@@ -9,11 +9,12 @@
"app/title.component.ts",
"app/user.service.ts",
- "app/contact/*.css",
- "app/contact/*.html",
- "app/contact/*.ts",
- "!app/contact/contact.component.ts",
- "!app/contact/contact.module.ts",
+ "app/contact/awesome.pipe.ts",
+ "app/contact/contact.component.css",
+ "app/contact/contact.component.html",
+ "app/contact/contact.component.3.ts",
+ "app/contact/contact.service.ts",
+ "app/contact/highlight.directive.ts",
"styles.css",
"index.1b.html"
diff --git a/public/docs/_examples/ngmodule/ts/contact.2.plnkr.json b/public/docs/_examples/ngmodule/ts/contact.2.plnkr.json
index b7da9b879f..4ee4638a63 100644
--- a/public/docs/_examples/ngmodule/ts/contact.2.plnkr.json
+++ b/public/docs/_examples/ngmodule/ts/contact.2.plnkr.json
@@ -9,12 +9,14 @@
"app/title.component.ts",
"app/user.service.ts",
- "app/contact/*.css",
- "app/contact/*.html",
- "app/contact/*.ts",
- "!app/contact/contact.component.ts",
- "!app/contact/contact.module.ts",
- "!app/contact/contact.module.3.ts",
+ "app/contact/contact.component.css",
+ "app/contact/contact.component.html",
+ "app/contact/contact.service.ts",
+
+ "app/contact/awesome.pipe.ts",
+ "app/contact/contact.component.3.ts",
+ "app/contact/contact.module.2.ts",
+ "app/contact/highlight.directive.ts",
"styles.css",
"index.2.html"
diff --git a/public/docs/_examples/ngmodule/ts/plnkr.json b/public/docs/_examples/ngmodule/ts/plnkr.json
index 54b3da8310..fbc92ce13b 100644
--- a/public/docs/_examples/ngmodule/ts/plnkr.json
+++ b/public/docs/_examples/ngmodule/ts/plnkr.json
@@ -8,19 +8,25 @@
"app/contact/contact.component.css",
"app/contact/contact.component.html",
+ "app/contact/contact.service.ts",
+
"app/contact/contact.component.ts",
"app/contact/contact.module.ts",
"app/contact/contact.routing.ts",
- "app/contact/contact.service.ts",
"app/crisis/*.ts",
- "app/hero/*.ts",
+ "app/hero/hero-detail.component.ts",
+ "app/hero/hero-list.component.ts",
+ "app/hero/hero.service.ts",
- "!app/hero/hero.component.3.ts",
- "!app/hero/hero.module.3.ts",
- "!app/hero/hero.routing.3.ts",
- "!app/hero/highlight.directive.ts",
+ "app/hero/hero.component.ts",
+ "app/hero/hero.module.ts",
+ "app/hero/hero.routing.ts",
+
+ "app/core/*.css",
+ "app/core/*.html",
+ "app/core/*.ts",
"app/shared/*.css",
"app/shared/*.html",
diff --git a/public/docs/_examples/ngmodule/ts/pre-shared.3.plnkr.json b/public/docs/_examples/ngmodule/ts/pre-shared.3.plnkr.json
index dcdfb6e77f..6a7b39e2a2 100644
--- a/public/docs/_examples/ngmodule/ts/pre-shared.3.plnkr.json
+++ b/public/docs/_examples/ngmodule/ts/pre-shared.3.plnkr.json
@@ -11,21 +11,26 @@
"app/title.component.ts",
"app/user.service.ts",
- "app/contact/*.css",
- "app/contact/*.html",
- "app/contact/*.ts",
+ "app/contact/contact.component.css",
+ "app/contact/contact.component.html",
+ "app/contact/contact.service.ts",
- "!app/contact/contact.component.ts",
- "!app/contact/contact.module.ts",
- "!app/contact/contact.routing.ts",
+ "app/contact/awesome.pipe.ts",
+ "app/contact/contact.component.3.ts",
+ "app/contact/contact.module.3.ts",
+ "app/contact/contact.routing.3.ts",
+ "app/contact/highlight.directive.ts",
"app/crisis/*.ts",
- "app/hero/*.ts",
+ "app/hero/hero-detail.component.ts",
+ "app/hero/hero-list.component.ts",
+ "app/hero/hero.service.ts",
- "!app/hero/hero.component.ts",
- "!app/hero/hero.module.ts",
- "!app/hero/hero.routing.ts",
+ "app/hero/hero.component.3.ts",
+ "app/hero/hero.module.3.ts",
+ "app/hero/hero.routing.3.ts",
+ "app/hero/highlight.directive.ts",
"styles.css",
"index.3.html"
diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json
index 6c253c3e4c..93215c5d5e 100644
--- a/public/docs/_examples/package.json
+++ b/public/docs/_examples/package.json
@@ -25,29 +25,29 @@
"author": "",
"license": "ISC",
"dependencies": {
- "@angular/common": "2.0.0-rc.5",
- "@angular/compiler": "2.0.0-rc.5",
- "@angular/core": "2.0.0-rc.5",
- "@angular/forms": "0.3.0",
- "@angular/http": "2.0.0-rc.5",
- "@angular/platform-browser": "2.0.0-rc.5",
- "@angular/platform-browser-dynamic": "2.0.0-rc.5",
- "@angular/router": "3.0.0-rc.1",
- "@angular/router-deprecated": "2.0.0-rc.2",
- "@angular/upgrade": "2.0.0-rc.5",
- "angular2-in-memory-web-api": "0.0.17",
+ "@angular/common": "2.0.0-rc.6",
+ "@angular/compiler": "2.0.0-rc.6",
+ "@angular/compiler-cli": "0.6.0",
+ "@angular/core": "2.0.0-rc.6",
+ "@angular/forms": "2.0.0-rc.6",
+ "@angular/http": "2.0.0-rc.6",
+ "@angular/platform-browser": "2.0.0-rc.6",
+ "@angular/platform-browser-dynamic": "2.0.0-rc.6",
+ "@angular/router": "3.0.0-rc.2",
+ "@angular/upgrade": "2.0.0-rc.6",
+ "angular2-in-memory-web-api": "0.0.18",
"bootstrap": "^3.3.6",
- "core-js": "^2.4.0",
+ "core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
- "rxjs": "5.0.0-beta.6",
+ "rxjs": "5.0.0-beta.11",
"systemjs": "0.19.27",
- "zone.js": "^0.6.12"
+ "zone.js": "^0.6.17"
},
"devDependencies": {
"angular-cli": "^1.0.0-beta.5",
"angular2-template-loader": "^0.4.0",
"canonical-path": "0.0.2",
- "concurrently": "^2.1.0",
+ "concurrently": "^2.2.0",
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
@@ -55,15 +55,15 @@
"html-webpack-plugin": "^2.16.1",
"http-server": "^0.9.0",
"jasmine-core": "^2.4.1",
- "karma": "^0.13.22",
- "karma-chrome-launcher": "^1.0.1",
- "karma-cli": "^1.0.0",
- "karma-htmlfile-reporter": "^0.3.1",
+ "karma": "^1.2.0",
+ "karma-chrome-launcher": "^2.0.0",
+ "karma-cli": "^1.0.1",
+ "karma-htmlfile-reporter": "^0.3.4",
"karma-jasmine": "^1.0.2",
- "karma-phantomjs-launcher": "^1.0.0",
+ "karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
- "karma-webpack": "^1.7.0",
- "lite-server": "^2.2.0",
+ "karma-webpack": "^1.8.0",
+ "lite-server": "^2.2.2",
"lodash": "^4.13.1",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "^2.1.7",
@@ -73,9 +73,9 @@
"style-loader": "^0.13.1",
"ts-loader": "^0.8.2",
"ts-node": "^0.7.3",
- "tslint": "^3.13.0",
+ "tslint": "^3.15.1",
"typescript": "^1.8.10",
- "typings": "^1.0.4",
+ "typings": "^1.3.2",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.14.0"
diff --git a/public/docs/_examples/quickstart/js/package.1.json b/public/docs/_examples/quickstart/js/package.1.json
index 5b3ecbc847..971b6b5d2b 100644
--- a/public/docs/_examples/quickstart/js/package.1.json
+++ b/public/docs/_examples/quickstart/js/package.1.json
@@ -7,23 +7,23 @@
},
"license": "ISC",
"dependencies": {
- "@angular/common": "2.0.0-rc.5",
- "@angular/compiler": "2.0.0-rc.5",
- "@angular/core": "2.0.0-rc.5",
- "@angular/forms": "0.3.0",
- "@angular/http": "2.0.0-rc.5",
- "@angular/platform-browser": "2.0.0-rc.5",
- "@angular/platform-browser-dynamic": "2.0.0-rc.5",
- "@angular/router": "3.0.0-rc.1",
+ "@angular/common": "2.0.0-rc.6",
+ "@angular/compiler": "2.0.0-rc.6",
+ "@angular/core": "2.0.0-rc.6",
+ "@angular/forms": "2.0.0-rc.6",
+ "@angular/http": "2.0.0-rc.6",
+ "@angular/platform-browser": "2.0.0-rc.6",
+ "@angular/platform-browser-dynamic": "2.0.0-rc.6",
+ "@angular/router": "3.0.0-rc.2",
"@angular/router-deprecated": "2.0.0-rc.2",
- "@angular/upgrade": "2.0.0-rc.5",
+ "@angular/upgrade": "2.0.0-rc.6",
- "core-js": "^2.4.0",
+ "core-js": "^2.4.1",
"reflect-metadata": "0.1.3",
- "rxjs": "5.0.0-beta.6",
- "zone.js": "0.6.12",
+ "rxjs": "5.0.0-beta.11",
+ "zone.js": "0.6.17",
- "angular2-in-memory-web-api": "0.0.15",
+ "angular2-in-memory-web-api": "0.0.18",
"bootstrap": "^3.3.6"
},
"devDependencies": {
diff --git a/public/docs/_examples/quickstart/ts/app/app.module.1.ts b/public/docs/_examples/quickstart/ts/app/app.module.1.ts
new file mode 100644
index 0000000000..cd9673617d
--- /dev/null
+++ b/public/docs/_examples/quickstart/ts/app/app.module.1.ts
@@ -0,0 +1,8 @@
+// #docregion
+import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+
+@NgModule({
+ imports: [ BrowserModule ]
+})
+export class AppModule { }
diff --git a/public/docs/_examples/quickstart/ts/app/app.module.ts b/public/docs/_examples/quickstart/ts/app/app.module.ts
index b4fc185c24..a8b40a7650 100644
--- a/public/docs/_examples/quickstart/ts/app/app.module.ts
+++ b/public/docs/_examples/quickstart/ts/app/app.module.ts
@@ -2,11 +2,12 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
-import { AppComponent } from './app.component';
+import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
+
export class AppModule { }
diff --git a/public/docs/_examples/quickstart/ts/app/main.ts b/public/docs/_examples/quickstart/ts/app/main.ts
index 4ad787ebfd..e36de73708 100644
--- a/public/docs/_examples/quickstart/ts/app/main.ts
+++ b/public/docs/_examples/quickstart/ts/app/main.ts
@@ -5,4 +5,5 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
// #enddocregion import
-platformBrowserDynamic().bootstrapModule(AppModule);
+const platform = platformBrowserDynamic();
+platform.bootstrapModule(AppModule);
diff --git a/public/docs/_examples/quickstart/ts/package.1.json b/public/docs/_examples/quickstart/ts/package.1.json
index 4f0bc098fd..5d9d1f6c24 100644
--- a/public/docs/_examples/quickstart/ts/package.1.json
+++ b/public/docs/_examples/quickstart/ts/package.1.json
@@ -11,30 +11,30 @@
},
"license": "ISC",
"dependencies": {
- "@angular/common": "2.0.0-rc.5",
- "@angular/compiler": "2.0.0-rc.5",
- "@angular/core": "2.0.0-rc.5",
- "@angular/forms": "0.3.0",
- "@angular/http": "2.0.0-rc.5",
- "@angular/platform-browser": "2.0.0-rc.5",
- "@angular/platform-browser-dynamic": "2.0.0-rc.5",
- "@angular/router": "3.0.0-rc.1",
- "@angular/router-deprecated": "2.0.0-rc.2",
- "@angular/upgrade": "2.0.0-rc.5",
+ "@angular/common": "2.0.0-rc.6",
+ "@angular/compiler": "2.0.0-rc.6",
+ "@angular/compiler-cli": "0.6.0",
+ "@angular/core": "2.0.0-rc.6",
+ "@angular/forms": "2.0.0-rc.6",
+ "@angular/http": "2.0.0-rc.6",
+ "@angular/platform-browser": "2.0.0-rc.6",
+ "@angular/platform-browser-dynamic": "2.0.0-rc.6",
+ "@angular/router": "3.0.0-rc.2",
+ "@angular/upgrade": "2.0.0-rc.6",
- "systemjs": "0.19.27",
- "core-js": "^2.4.0",
+ "core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
- "rxjs": "5.0.0-beta.6",
- "zone.js": "^0.6.12",
+ "rxjs": "5.0.0-beta.11",
+ "systemjs": "0.19.27",
+ "zone.js": "^0.6.17",
- "angular2-in-memory-web-api": "0.0.15",
+ "angular2-in-memory-web-api": "0.0.18",
"bootstrap": "^3.3.6"
},
"devDependencies": {
- "concurrently": "^2.0.0",
- "lite-server": "^2.2.0",
+ "concurrently": "^2.2.0",
+ "lite-server": "^2.2.2",
"typescript": "^1.8.10",
- "typings":"^1.0.4"
+ "typings":"^1.3.2"
}
}
diff --git a/public/docs/_examples/quickstart/ts/systemjs.config.1.js b/public/docs/_examples/quickstart/ts/systemjs.config.1.js
index 63e2109db3..d92e1361d0 100644
--- a/public/docs/_examples/quickstart/ts/systemjs.config.1.js
+++ b/public/docs/_examples/quickstart/ts/systemjs.config.1.js
@@ -3,58 +3,44 @@
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
-(function(global) {
+(function (global) {
+ System.config({
+ paths: {
+ // paths serve as alias
+ 'npm:': 'node_modules/'
+ },
+ // map tells the System loader where to look for things
+ map: {
+ // our app is within the app folder
+ app: 'app',
- // map tells the System loader where to look for things
- var map = {
- 'app': 'app', // 'dist',
-
- '@angular': 'node_modules/@angular',
- 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
- 'rxjs': 'node_modules/rxjs'
- };
-
- // packages tells the System loader how to load when no filename and/or no extension
- var packages = {
- 'app': { main: 'main.js', defaultExtension: 'js' },
- 'rxjs': { defaultExtension: 'js' },
- 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
- };
-
- var ngPackageNames = [
- 'common',
- 'compiler',
- 'core',
- 'forms',
- 'http',
- 'platform-browser',
- 'platform-browser-dynamic',
- 'router',
- 'router-deprecated',
- 'upgrade',
- ];
-
- // Individual files (~300 requests):
- function packIndex(pkgName) {
- packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
- }
-
- // Bundled (~40 requests):
- function packUmd(pkgName) {
- packages['@angular/'+pkgName] = { main: 'bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
- }
-
- // Most environments should use UMD; some (Karma) need the individual index files
- var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
-
- // Add package entries for angular packages
- ngPackageNames.forEach(setPackageConfig);
-
- var config = {
- map: map,
- packages: packages
- };
-
- System.config(config);
+ // angular bundles
+ '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
+ '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
+ '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
+ '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
+ '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
+ '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
+ '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
+ '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
+ // other libraries
+ 'rxjs': 'npm:rxjs',
+ 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
+ },
+ // packages tells the System loader how to load when no filename and/or no extension
+ packages: {
+ app: {
+ main: './main.js',
+ defaultExtension: 'js'
+ },
+ rxjs: {
+ defaultExtension: 'js'
+ },
+ 'angular2-in-memory-web-api': {
+ main: './index.js',
+ defaultExtension: 'js'
+ }
+ }
+ });
})(this);
diff --git a/public/docs/_examples/quickstart/ts/typings.1.json b/public/docs/_examples/quickstart/ts/typings.1.json
index 3d826df25a..72db971273 100644
--- a/public/docs/_examples/quickstart/ts/typings.1.json
+++ b/public/docs/_examples/quickstart/ts/typings.1.json
@@ -1,7 +1,7 @@
{
"globalDependencies": {
- "core-js": "registry:dt/core-js#0.0.0+20160602141332",
+ "core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
- "node": "registry:dt/node#6.0.0+20160807145350"
+ "node": "registry:dt/node#6.0.0+20160831021119"
}
}
diff --git a/public/docs/_examples/security/ts/app/bypass-security.component.ts b/public/docs/_examples/security/ts/app/bypass-security.component.ts
index a18d4251a5..9b33247828 100644
--- a/public/docs/_examples/security/ts/app/bypass-security.component.ts
+++ b/public/docs/_examples/security/ts/app/bypass-security.component.ts
@@ -1,7 +1,7 @@
// #docplaster
// #docregion
import { Component } from '@angular/core';
-import { DomSanitizationService, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';
+import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';
@Component({
selector: 'bypass-security',
@@ -14,7 +14,7 @@ export class BypassSecurityComponent {
videoUrl: SafeResourceUrl;
// #docregion trust-url
- constructor(private sanitizer: DomSanitizationService) {
+ constructor(private sanitizer: DomSanitizer) {
// javascript: URLs are dangerous if attacker controlled.
// Angular sanitizes them in data binding, but we can
// explicitly tell Angular to trust this value:
diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts
index 518bc2b05f..25911b0d37 100644
--- a/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts
+++ b/public/docs/_examples/server-communication/ts/app/wiki/wikipedia.service.1.ts
@@ -18,7 +18,7 @@ export class WikipediaService {
return this.jsonp
.get(wikiUrl + queryString)
- .map(request => > getHeroesSlowly() {
- return new Future.delayed(const Duration(seconds: 2), () => mockHeroes);
+ return new Future.delayed(const Duration(seconds: 2), getHeroes);
}
// #enddocregion get-heroes-slowly
// #docregion
diff --git a/public/docs/_examples/toh-4/dart/lib/hero_service_1.dart b/public/docs/_examples/toh-4/dart/lib/hero_service_1.dart
index 87e11177d8..6feca85ae0 100644
--- a/public/docs/_examples/toh-4/dart/lib/hero_service_1.dart
+++ b/public/docs/_examples/toh-4/dart/lib/hero_service_1.dart
@@ -13,7 +13,7 @@ class HeroService {
// #enddocregion getHeroes-stub, empty-class, final
/*
// #docregion getHeroes-stub
- List
> getHeroes() async => mockHeroes;
- // See the "Take it slow" appendix
Future
> getHeroesSlowly() {
return new Future
>.delayed(
- const Duration(seconds: 2), () => mockHeroes);
+ const Duration(seconds: 2), getHeroes);
}
// #docregion getHero
diff --git a/public/docs/_examples/toh-5/ts/app/hero.service.ts b/public/docs/_examples/toh-5/ts/app/hero.service.ts
index 67215fb228..163734fe5f 100644
--- a/public/docs/_examples/toh-5/ts/app/hero.service.ts
+++ b/public/docs/_examples/toh-5/ts/app/hero.service.ts
@@ -10,11 +10,10 @@ export class HeroService {
return Promise.resolve(HEROES);
}
- // See the "Take it slow" appendix
getHeroesSlowly(): Promise
{{hero.name}} details!
diff --git a/public/docs/_examples/toh-6/dart/lib/hero_service.dart b/public/docs/_examples/toh-6/dart/lib/hero_service.dart
index 7a15c6473f..38e8357968 100644
--- a/public/docs/_examples/toh-6/dart/lib/hero_service.dart
+++ b/public/docs/_examples/toh-6/dart/lib/hero_service.dart
@@ -1,4 +1,5 @@
-// #docregion
+// #docplaster
+// #docregion , imports
import 'dart:async';
import 'dart:convert';
@@ -6,12 +7,13 @@ import 'package:angular2/core.dart';
import 'package:http/http.dart';
import 'hero.dart';
+// #enddocregion imports
@Injectable()
class HeroService {
- // #docregion post
+ // #docregion update
static final _headers = {'Content-Type': 'application/json'};
- // #enddocregion post
+ // #enddocregion update
// #docregion getHeroes
static const _heroesUrl = 'app/heroes'; // URL to web API
@@ -35,25 +37,20 @@ class HeroService {
// #docregion extract-data
dynamic _extractData(Response resp) => JSON.decode(resp.body)['data'];
- // #enddocregion extract-data, getHeroes
-
- FutureMy Heroes
-
-
-
-
-
{{selectedHero.name | uppercase}} is my hero
-
{{hero.name}} details!
diff --git a/public/docs/_examples/toh-6/ts/app/hero-detail.component.ts b/public/docs/_examples/toh-6/ts/app/hero-detail.component.ts
index 4329f63a2c..87333a9fe3 100644
--- a/public/docs/_examples/toh-6/ts/app/hero-detail.component.ts
+++ b/public/docs/_examples/toh-6/ts/app/hero-detail.component.ts
@@ -1,8 +1,5 @@
-// #docplaster
-// #docregion, variables-imports
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-
-// #enddocregion variables-imports
+// #docregion
+import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { Hero } from './hero';
@@ -13,50 +10,30 @@ import { HeroService } from './hero.service';
templateUrl: 'app/hero-detail.component.html',
styleUrls: ['app/hero-detail.component.css']
})
-// #docregion variables-imports
export class HeroDetailComponent implements OnInit {
- @Input() hero: Hero;
- @Output() close = new EventEmitter();
- error: any;
- navigated = false; // true if navigated here
- // #enddocregion variables-imports
+ hero: Hero;
constructor(
private heroService: HeroService,
private route: ActivatedRoute) {
}
- // #docregion ngOnInit
ngOnInit(): void {
this.route.params.forEach((params: Params) => {
- if (params['id'] !== undefined) {
- let id = +params['id'];
- this.navigated = true;
- this.heroService.getHero(id)
- .then(hero => this.hero = hero);
- } else {
- this.navigated = false;
- this.hero = new Hero();
- }
+ let id = +params['id'];
+ this.heroService.getHero(id)
+ .then(hero => this.hero = hero);
});
}
- // #enddocregion ngOnInit
// #docregion save
save(): void {
- this.heroService
- .save(this.hero)
- .then(hero => {
- this.hero = hero; // saved hero, w/ id if new
- this.goBack(hero);
- })
- .catch(error => this.error = error); // TODO: Display error message
+ this.heroService.update(this.hero)
+ .then(this.goBack);
}
// #enddocregion save
- // #docregion goBack
- goBack(savedHero: Hero = null): void {
- this.close.emit(savedHero);
- if (this.navigated) { window.history.back(); }
+
+ goBack(): void {
+ window.history.back();
}
- // #enddocregion goBack
}
diff --git a/public/docs/_examples/toh-6/ts/app/hero.service.ts b/public/docs/_examples/toh-6/ts/app/hero.service.ts
index 21d036ad9e..e220982f6f 100644
--- a/public/docs/_examples/toh-6/ts/app/hero.service.ts
+++ b/public/docs/_examples/toh-6/ts/app/hero.service.ts
@@ -1,17 +1,21 @@
// #docplaster
-// #docregion
+// #docregion , imports
import { Injectable } from '@angular/core';
-import { Headers, Http, Response } from '@angular/http';
+import { Headers, Http } from '@angular/http';
// #docregion rxjs
import 'rxjs/add/operator/toPromise';
// #enddocregion rxjs
import { Hero } from './hero';
+// #enddocregion imports
@Injectable()
export class HeroService {
+ // #docregion update
+ private headers = new Headers({'Content-Type': 'application/json'});
+ // #enddocregion update
// #docregion getHeroes
private heroesUrl = 'app/heroes'; // URL to web api
@@ -36,62 +40,40 @@ export class HeroService {
.then(heroes => heroes.find(hero => hero.id === id));
}
- // #docregion save
- save(hero: Hero): PromiseMy Heroes
-
-
-
-
-
+
+
{{selectedHero.name | uppercase}} is my hero
diff --git a/public/docs/_examples/toh-6/ts/app/heroes.component.ts b/public/docs/_examples/toh-6/ts/app/heroes.component.ts
index b3d17549e8..6c0e8f2306 100644
--- a/public/docs/_examples/toh-6/ts/app/heroes.component.ts
+++ b/public/docs/_examples/toh-6/ts/app/heroes.component.ts
@@ -4,57 +4,48 @@ import { Router } from '@angular/router';
import { Hero } from './hero';
import { HeroService } from './hero.service';
-// #docregion hero-detail-component
@Component({
selector: 'my-heroes',
templateUrl: 'app/heroes.component.html',
styleUrls: ['app/heroes.component.css']
})
-// #enddocregion hero-detail-component
export class HeroesComponent implements OnInit {
heroes: Hero[];
selectedHero: Hero;
- addingHero = false;
- // #docregion error
- error: any;
- // #enddocregion error
constructor(
- private router: Router,
- private heroService: HeroService) { }
+ private heroService: HeroService,
+ private router: Router) { }
getHeroes(): void {
this.heroService
.getHeroes()
- .then(heroes => this.heroes = heroes)
- .catch(error => this.error = error);
+ .then(heroes => this.heroes = heroes);
}
- // #docregion addHero
- addHero(): void {
- this.addingHero = true;
- this.selectedHero = null;
+ // #docregion add
+ add(name: string): void {
+ name = name.trim();
+ if (!name) { return; }
+ this.heroService.create(name)
+ .then(hero => {
+ this.heroes.push(hero);
+ this.selectedHero = null;
+ });
}
+ // #enddocregion add
- close(savedHero: Hero): void {
- this.addingHero = false;
- if (savedHero) { this.getHeroes(); }
- }
- // #enddocregion addHero
-
- // #docregion deleteHero
- deleteHero(hero: Hero, event: any): void {
- event.stopPropagation();
+ // #docregion delete
+ delete(hero: Hero): void {
this.heroService
- .delete(hero)
- .then(res => {
+ .delete(hero.id)
+ .then(() => {
this.heroes = this.heroes.filter(h => h !== hero);
if (this.selectedHero === hero) { this.selectedHero = null; }
- })
- .catch(error => this.error = error);
+ });
}
- // #enddocregion deleteHero
+ // #enddocregion delete
ngOnInit(): void {
this.getHeroes();
@@ -62,7 +53,6 @@ export class HeroesComponent implements OnInit {
onSelect(hero: Hero): void {
this.selectedHero = hero;
- this.addingHero = false;
}
gotoDetail(): void {
diff --git a/public/docs/_examples/typings.json b/public/docs/_examples/typings.json
index 3d826df25a..72db971273 100644
--- a/public/docs/_examples/typings.json
+++ b/public/docs/_examples/typings.json
@@ -1,7 +1,7 @@
{
"globalDependencies": {
- "core-js": "registry:dt/core-js#0.0.0+20160602141332",
+ "core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
- "node": "registry:dt/node#6.0.0+20160807145350"
+ "node": "registry:dt/node#6.0.0+20160831021119"
}
}
diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma-test-shim.1.js b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma-test-shim.1.js
index bf17063954..31589119d2 100644
--- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma-test-shim.1.js
+++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma-test-shim.1.js
@@ -29,22 +29,18 @@ System.config({
});
System.import('systemjs.config.js')
- .then(function () {
- return Promise.all([
+ .then(() => Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
- ])
+ ]))
+ .then((providers) => {
+ var coreTesting = providers[0];
+ var browserTesting = providers[1];
+ coreTesting.TestBed.initTestEnvironment(
+ browserTesting.BrowserDynamicTestingModule,
+ browserTesting.platformBrowserDynamicTesting());
})
- .then(function (providers) {
- var testing = providers[0];
- var testingBrowser = providers[1];
-
- testing.setBaseTestProviders(
- testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
- testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
-
- })
- .then(function() {
+ .then(function () {
// Finally, load all spec files.
// This will run the tests directly.
return Promise.all(
diff --git a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma.conf.ng1.js b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma.conf.ng1.js
index 7156e025ce..48cc490f89 100644
--- a/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma.conf.ng1.js
+++ b/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/karma.conf.ng1.js
@@ -19,10 +19,13 @@ module.exports = function(config) {
// Polyfills
'node_modules/core-js/client/shim.js',
-
- // Reflect and Zone.js
'node_modules/reflect-metadata/Reflect.js',
+
+ // zone.js
'node_modules/zone.js/dist/zone.js',
+ 'node_modules/zone.js/dist/long-stack-trace-zone.js',
+ 'node_modules/zone.js/dist/proxy.js',
+ 'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
diff --git a/public/docs/_examples/upgrade-phonecat-3-final/ts/karma.conf.ng1.js b/public/docs/_examples/upgrade-phonecat-3-final/ts/karma.conf.ng1.js
index 7156e025ce..48cc490f89 100644
--- a/public/docs/_examples/upgrade-phonecat-3-final/ts/karma.conf.ng1.js
+++ b/public/docs/_examples/upgrade-phonecat-3-final/ts/karma.conf.ng1.js
@@ -19,10 +19,13 @@ module.exports = function(config) {
// Polyfills
'node_modules/core-js/client/shim.js',
-
- // Reflect and Zone.js
'node_modules/reflect-metadata/Reflect.js',
+
+ // zone.js
'node_modules/zone.js/dist/zone.js',
+ 'node_modules/zone.js/dist/long-stack-trace-zone.js',
+ 'node_modules/zone.js/dist/proxy.js',
+ 'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
diff --git a/public/docs/_examples/webpack/ts/config/karma-test-shim.js b/public/docs/_examples/webpack/ts/config/karma-test-shim.js
index 2a6b7f363c..973543a02a 100644
--- a/public/docs/_examples/webpack/ts/config/karma-test-shim.js
+++ b/public/docs/_examples/webpack/ts/config/karma-test-shim.js
@@ -5,10 +5,12 @@ require('core-js/es6');
require('reflect-metadata');
require('zone.js/dist/zone');
+require('zone.js/dist/long-stack-trace-zone');
+require('zone.js/dist/proxy');
+require('zone.js/dist/sync-test');
+require('zone.js/dist/jasmine-patch');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
-require('zone.js/dist/sync-test');
-require('zone.js/dist/proxy-zone');
var appContext = require.context('../src', true, /\.spec\.ts/);
diff --git a/public/docs/_examples/webpack/ts/config/webpack.prod.js b/public/docs/_examples/webpack/ts/config/webpack.prod.js
index 0e897cb35a..7b2f8f9800 100644
--- a/public/docs/_examples/webpack/ts/config/webpack.prod.js
+++ b/public/docs/_examples/webpack/ts/config/webpack.prod.js
@@ -24,7 +24,11 @@ module.exports = webpackMerge(commonConfig, {
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
- new webpack.optimize.UglifyJsPlugin(),
+ new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
+ mangle: {
+ keep_fnames: true
+ }
+ }),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
diff --git a/public/docs/_examples/webpack/ts/package.webpack.json b/public/docs/_examples/webpack/ts/package.webpack.json
index 4b3dc3e15d..4d772b16ee 100644
--- a/public/docs/_examples/webpack/ts/package.webpack.json
+++ b/public/docs/_examples/webpack/ts/package.webpack.json
@@ -10,18 +10,17 @@
},
"license": "MIT",
"dependencies": {
- "@angular/common": "2.0.0-rc.5",
- "@angular/compiler": "2.0.0-rc.5",
- "@angular/core": "2.0.0-rc.5",
- "@angular/forms": "0.3.0",
- "@angular/http": "2.0.0-rc.5",
- "@angular/platform-browser": "2.0.0-rc.5",
- "@angular/platform-browser-dynamic": "2.0.0-rc.5",
- "@angular/router": "3.0.0-rc.1",
- "core-js": "^2.4.0",
- "reflect-metadata": "0.1.2",
- "rxjs": "5.0.0-beta.6",
- "zone.js": "0.6.12"
+ "@angular/common": "2.0.0-rc.6",
+ "@angular/compiler": "2.0.0-rc.6",
+ "@angular/core": "2.0.0-rc.6",
+ "@angular/forms": "2.0.0-rc.6",
+ "@angular/http": "2.0.0-rc.6",
+ "@angular/platform-browser": "2.0.0-rc.6",
+ "@angular/platform-browser-dynamic": "2.0.0-rc.6",
+ "@angular/router": "3.0.0-rc.2",
+ "core-js": "^2.4.1",
+ "rxjs": "5.0.0-beta.11",
+ "zone.js": "^0.6.17"
},
"devDependencies": {
"angular2-template-loader": "^0.4.0",
diff --git a/public/docs/_examples/webpack/ts/public/images/angular.png b/public/docs/_examples/webpack/ts/public/images/angular.png
index a1d9790bc3..c510293918 100644
Binary files a/public/docs/_examples/webpack/ts/public/images/angular.png and b/public/docs/_examples/webpack/ts/public/images/angular.png differ
diff --git a/public/docs/_examples/webpack/ts/typings.1.json b/public/docs/_examples/webpack/ts/typings.1.json
index 3d826df25a..72db971273 100644
--- a/public/docs/_examples/webpack/ts/typings.1.json
+++ b/public/docs/_examples/webpack/ts/typings.1.json
@@ -1,7 +1,7 @@
{
"globalDependencies": {
- "core-js": "registry:dt/core-js#0.0.0+20160602141332",
+ "core-js": "registry:dt/core-js#0.0.0+20160725163759",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
- "node": "registry:dt/node#6.0.0+20160807145350"
+ "node": "registry:dt/node#6.0.0+20160831021119"
}
}
diff --git a/public/docs/dart/latest/cookbook/_data.json b/public/docs/dart/latest/cookbook/_data.json
index c7f07e9834..931857b846 100644
--- a/public/docs/dart/latest/cookbook/_data.json
+++ b/public/docs/dart/latest/cookbook/_data.json
@@ -12,6 +12,12 @@
"hide": true
},
+ "ngmodule-faq": {
+ "title": "Angular Module FAQs",
+ "intro": "Answers to frequently asked questions about @NgModule",
+ "hide": true
+ },
+
"component-communication": {
"title": "Component Interaction",
"intro": "Share information between different directives and components"
@@ -35,6 +41,12 @@
"hide": true
},
+ "form-validation": {
+ "title": "Form Validation",
+ "intro": "Validate user's form entries",
+ "hide": true
+ },
+
"rc4-to-rc5": {
"title": "RC4 to RC5 Migration",
"intro": "Migrate your RC4 app to RC5 in minutes.",
diff --git a/public/docs/dart/latest/cookbook/dynamic-form.jade b/public/docs/dart/latest/cookbook/dynamic-form.jade
index f8df2a84a6..6778b6af28 100644
--- a/public/docs/dart/latest/cookbook/dynamic-form.jade
+++ b/public/docs/dart/latest/cookbook/dynamic-form.jade
@@ -1 +1 @@
-!= partial("../../../_includes/_ts-temp")
\ No newline at end of file
+!= partial("../../../_includes/_ts-temp")
diff --git a/public/docs/dart/latest/cookbook/form-validation.jade b/public/docs/dart/latest/cookbook/form-validation.jade
new file mode 100644
index 0000000000..6778b6af28
--- /dev/null
+++ b/public/docs/dart/latest/cookbook/form-validation.jade
@@ -0,0 +1 @@
+!= partial("../../../_includes/_ts-temp")
diff --git a/public/docs/dart/latest/cookbook/ngmodule-faq.jade b/public/docs/dart/latest/cookbook/ngmodule-faq.jade
new file mode 100644
index 0000000000..6778b6af28
--- /dev/null
+++ b/public/docs/dart/latest/cookbook/ngmodule-faq.jade
@@ -0,0 +1 @@
+!= partial("../../../_includes/_ts-temp")
diff --git a/public/docs/dart/latest/guide/dependency-injection.jade b/public/docs/dart/latest/guide/dependency-injection.jade
index 3e4c5011e3..6656739107 100644
--- a/public/docs/dart/latest/guide/dependency-injection.jade
+++ b/public/docs/dart/latest/guide/dependency-injection.jade
@@ -34,6 +34,12 @@ block real-logger
A real implementation would probably use the
[logging package](https://pub.dartlang.org/packages/logging).
+block provider-shorthand
+ :marked
+ This is actually a shorthand expression for a provider registration
+ that creates a new instance of the
+ [Provider](../api/angular2.core/Provider-class.html) class:
+
block provider-ctor-args
- var _secondParam = 'named parameter, such as
useClass'
:marked
diff --git a/public/docs/dart/latest/guide/forms.jade b/public/docs/dart/latest/guide/forms.jade
index 73651c1092..863ee5e9bd 100644
--- a/public/docs/dart/latest/guide/forms.jade
+++ b/public/docs/dart/latest/guide/forms.jade
@@ -518,7 +518,7 @@ figure.image-display
Recall from the previous section that `ngControl` registered this input box with the
`NgForm` directive as "name".
- We didn't add the **[`NgForm`](../api/common/index/NgForm-directive.html) directive*
+ We didn't add the [NgForm](../api/angular2.common/NgForm-class.html) directive
explicitly. Angular added it surreptitiously, wrapping it around the `