diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..fa749aa3fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,7 @@ +**Please do not add issues or pull requests to this repo.** +We are no longer making changes to documentation in this repository. +We will no longer process new issues or PRs and we will close them automatically. + +**Please post new [issues](https://github.com/angular/angular/issues) and [pull requests](https://github.com/angular/angular/pulls) to the content folder in [https://github.com/angular/angular/tree/master/aio/content](https://github.com/angular/angular/tree/master/aio/content)**. + +Be sure to prefix your issue/PR title with "**docs(aio):**" diff --git a/.github/PULL_REQUEST_TEMPLATE.MD b/.github/PULL_REQUEST_TEMPLATE.MD new file mode 100644 index 0000000000..c4e15a1d58 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.MD @@ -0,0 +1,7 @@ +**Please do not add issues or pull requests to this repo.** +We are no longer making changes to documentation in this repository. +We will no longer process new issues or PRs and we will close them automatically. + +**Please post new [issues](https://github.com/angular/angular/issues) and [pull requests](https://github.com/angular/angular/pulls) to the content folder in [https://github.com/angular/angular/tree/master/aio/content](https://github.com/angular/angular/tree/master/aio/content)**. + +Be sure to prefix your issue/PR title with "**docs(aio):**" diff --git a/.travis.yml b/.travis.yml index 13ea225958..edba3b37d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,9 @@ env: - DBUS_SESSION_BUS_ADDRESS=/dev/null - DISPLAY=:99.0 - CHROME_BIN=chromium-browser - - LATEST_RELEASE=2.4.0 - - LATEST_RELEASE_BRANCH=2.4.x + - LATEST_RELEASE=4.0.0 + # Temporarily disabled until there is a new release branch for 4.0.0 + # - LATEST_RELEASE_BRANCH=2.4.x - TASK_FLAGS="--dgeni-log=warn" matrix: # current angular release jobs @@ -19,8 +20,8 @@ env: - TASK="run-e2e-tests --fast" SCRIPT=examples-install.sh - TASK=build-compile SCRIPT=deploy-install.sh WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" # current angular release branch jobs - - TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH - - TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" + # - TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH + # - TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" # angular master jobs - TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=master - TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=master WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" @@ -29,8 +30,8 @@ matrix: allow_failures: # allow current angular release branch and master to fail # these should be moved to a daily task instead of being ran on every PR - - env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH - - env: TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" + # - env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH + # - env: TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=$LATEST_RELEASE_BRANCH WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" - env: TASK="run-e2e-tests --fast" SCRIPT=examples-install-preview.sh PREVIEW_BRANCH=master - env: TASK=build-compile SCRIPT=deploy-install-preview.sh PREVIEW_BRANCH=master WAIT="travis_wait 50" POST_SCRIPT="check-docs.sh -v" before_install: diff --git a/firebase.json b/firebase.json index 9a03643e39..4f6e69080f 100644 --- a/firebase.json +++ b/firebase.json @@ -46,6 +46,11 @@ "source": "/**/dart/**", "destination": "https://webdev.dartlang.org/angular?utm_campaign=dart_migration&utm_medium=redirect&utm_source=angular.io", "type": 301 + }, + { + "source": "/docs", + "destination": "https://angular.io/docs/ts/latest/", + "type": 301 } ], "rewrites": [ diff --git a/gulpfile.js b/gulpfile.js index fb332c68d9..b13de3e006 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -46,7 +46,7 @@ var LIVE_EXAMPLES_PATH = path.join(RESOURCES_PATH, 'live-examples'); 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 ExampleZipper = require(path.resolve(TOOLS_PATH, 'example-zipper/exampleZipper')); 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')); @@ -71,13 +71,13 @@ var _devguideShredJadeOptions = { var _apiShredOptions = { lang: 'ts', - examplesDir: path.join(ANGULAR_PROJECT_PATH, 'modules/@angular/examples'), + examplesDir: path.join(ANGULAR_PROJECT_PATH, 'packages/examples'), fragmentsDir: path.join(DOCS_PATH, '_fragments/_api'), zipDir: path.join(RESOURCES_PATH, 'zips/api'), logLevel: _dgeniLogLevel }; -var _excludePatterns = ['**/node_modules/**', '**/packages/**']; +var _excludePatterns = ['**/node_modules/**']; var _excludeMatchers = _excludePatterns.map(function(excludePattern){ return new Minimatch(excludePattern) @@ -86,6 +86,7 @@ var _excludeMatchers = _excludePatterns.map(function(excludePattern){ var _exampleBoilerplateFiles = [ 'src/styles.css', 'src/systemjs.config.js', + 'src/systemjs-angular-loader.js', 'src/tsconfig.json', 'bs-config.json', 'bs-config.e2e.json', @@ -501,7 +502,7 @@ function installExampleAngular() { var template; var libs = [ 'core', 'common', 'compiler', 'compiler-cli', - 'platform-browser', 'platform-browser-dynamic', + 'platform-browser', 'platform-browser-dynamic', 'platform-server', 'forms', 'http', 'router', 'upgrade']; var build = argv.build; @@ -521,13 +522,16 @@ function installExampleAngular() { : `git+https://github.com/angular/${lib}-builds${build}`; }); - if (argv.build) { sources.push('@angular/tsc-wrapped');} // tsc-wrapped needed for builds + if (argv.build) { + sources.push('@angular/tsc-wrapped'); // tsc-wrapped needed for builds + sources.push('typescript@2.2.1'); // recent builds need recent TypeScript + } sources.push('@angular/router-deprecated'); gutil.log(`Installing Angular packages from ${build === 'npm' ? 'NPM' : 'BUILD ' + build}`); - var spawnInfo = spawnExt('rm', ['-rf', 'node_modules/@angular'], { cwd: EXAMPLES_PATH}); + var spawnInfo = spawnExt('node', ['node_modules/rimraf/bin.js', 'node_modules/@angular'], { cwd: EXAMPLES_PATH}); return spawnInfo.promise .then(() => { spawnInfo = spawnExt('npm', ['install', ...sources], {cwd: EXAMPLES_PATH}); @@ -572,9 +576,7 @@ gulp.task('build-and-serve', ['build-docs'], function (cb) { watchAndSync({localFiles: true}, cb); }); -gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers']); -// Stop zipping examples Feb 28, 2016 -//gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers', '_zip-examples']); +gulp.task('build-docs', ['build-devguide-docs', 'build-api-docs', 'build-plunkers', '_zip-examples']); gulp.task('build-api-docs', ['build-js-api-docs', 'build-ts-api-docs']); @@ -787,8 +789,8 @@ gulp.task('_shred-clean-api', function(cb) { }); gulp.task('_zip-examples', function() { - exampleZipper.zipExamples(_devguideShredOptions.examplesDir, _devguideShredOptions.zipDir); - exampleZipper.zipExamples(_apiShredOptions.examplesDir, _apiShredOptions.zipDir); + new ExampleZipper(_devguideShredOptions.examplesDir, _devguideShredOptions.zipDir); + // exampleZipper.zipExamples(_apiShredOptions.examplesDir, _apiShredOptions.zipDir); }); @@ -1202,7 +1204,7 @@ function devGuideExamplesWatch(shredOptions, postShredAction, focus) { // var excludePattern = '!' + path.join(shredOptions.examplesDir, '**/node_modules/**/*.*'); // gulp.watch([includePattern, excludePattern], {readDelay: 500}, function (event, done) { var ignoreThese = [ '**/node_modules/**', '**/_fragments/**', '**/dist/**', - '**/dart/.pub/**', '**/dart/build/**', '**/dart/packages/**']; + '**/dart/.pub/**', '**/dart/build/**']; ignoreThese = ignoreThese.concat(_exampleBoilerplateFiles.map((file) => `public/docs/_examples/*/*/${file}`)); var files = globby.sync( [includePattern], { ignore: ignoreThese }); gulp.watch([files], {readDelay: 500}, function (event, done) { diff --git a/harp.json b/harp.json index 0c1bdaa2bd..f24fd86c42 100644 --- a/harp.json +++ b/harp.json @@ -355,6 +355,7 @@ "name": "Ward Bell", "picture": "/resources/images/bios/wardbell.jpg", "website": "https://github.com/wardbell", + "twitter": "wardbell", "bio": "Ward is an all-around developer with JavaScript, node, and .net chops. He's a frequent conference speaker and podcaster, trainer, Google Developer Expert for Angular, Microsoft MVP, and PluralSight author. He is also president of IdeaBlade, an enterprise software consulting firm and the makers of breeze.js. He would like to get more sleep and spend more time in the mountains.", "type": "Community" }, @@ -503,7 +504,8 @@ "name": "Kapunahele Wong", "picture": "/resources/images/bios/kapunahelewong.jpg", "website": " https://github.com/kapunahelewong", - "bio": "Kapunahele is a front-end developer at Capital One. She loves just about anything to do with JavaScript, Angular and electronics. She enjoys mapping Hawaiian star names and constellations to Western ones and loves dancing native Hawaiian hula.", + "twitter": "kapunahele", + "bio": "Kapunahele is a front-end developer and contributor to angular.io. She loves just about anything to do with JavaScript, Angular and electronics. She enjoys mapping Hawaiian star names and constellations to Western ones and loves dancing native Hawaiian hula.", "type": "Community" }, @@ -512,7 +514,7 @@ "picture": "/resources/images/bios/devversion.jpg", "website": "http://github.com/DevVersion/", "twitter": "DevVersion", - "bio": "Paul is an aspiring 16-year-old developer living in Germany. While attending school, Paul works as a core team member on the Angular Material projects. He is a prolific contributor to all aspects of AngularJS and Angular and hopes to work at Google during his college studies!", + "bio": "Paul is a 16-year-old developer living in Germany. While he attends school, Paul works as a core team member on Angular Material. Paul focuses on tooling and building components for Angular.", "type": "Community" }, @@ -521,6 +523,13 @@ "picture": "/resources/images/bios/mmalerba.jpg", "bio": "Miles is a software engineer on the Angular Material team at Google. In addition to Javascripting he enjoys eating food and ogling cute puppies.", "type": "Google" + }, + + "jasonaden": { + "name": "Jason Aden", + "picture": "/resources/images/bios/jasonaden.jpg", + "bio": "Jason is a software engineer at Google on the Angular Core team. He is enthusiastic about Angular and application development in the modern age. In his free time Jason enjoys spending time with his wife and four children and doing outdoor activities (hiking, fishing, snowboarding, etc.).", + "type": "Google" } } } diff --git a/public/_data.json b/public/_data.json index 216d1c7183..987d3e6b4a 100644 --- a/public/_data.json +++ b/public/_data.json @@ -15,13 +15,7 @@ "subtitle": "帮我们构建面向未来的框架", "autoformat": "true" }, - "resources": { - "title": "资源库", - "subtitle": "Angular的资源库" - }, - "news": { - "title": "新闻" - }, + "events": { "title": "开发者会议", "subtitle": "我们将在哪里开会" diff --git a/public/_includes/_footer.jade b/public/_includes/_footer.jade index 40f13bb4c7..95b75dfe62 100644 --- a/public/_includes/_footer.jade +++ b/public/_includes/_footer.jade @@ -60,7 +60,7 @@ div(class="main-footer" data-swiftype-index="false") p Events p 会议 li Meetups - li Twitter + li Twitter li GitHub li p Contribute diff --git a/public/_includes/_hero-home.jade b/public/_includes/_hero-home.jade index ac2e35f25a..fed2fb18e7 100644 --- a/public/_includes/_hero-home.jade +++ b/public/_includes/_hero-home.jade @@ -1,13 +1,13 @@ header(class="background-sky l-relative") .hero.background-superhero-paper.is-large - img(class="hero-logo" src='/resources/images/logos/angular2/angular.svg') + img(class="hero-logo" src='/resources/images/logos/angular/angular.svg') h1.text-headline #{title}
#{subtitle} a(href="/docs/ts/latest/quickstart.html" class="hero-cta md-raised button button-large button-plain" md-button) 开始吧! announcement-bar .announcement-bar-slide.clearfix - img(src="/resources/images/logos/angular2/angular-banner-logo-grey.png" width="64") - p Test-drive @angular/material: 22个组件进入beta阶段啦! - a(href="https://material.angular.io/" target="_blank" class="button md-button") 试试看! + img(src="/resources/images/logos/angular/angular-banner-logo-grey.png" width="64") + p Angular v4.0 发布啦!更小,更快,改动少 + a(href="http://angularjs.blogspot.com/2017/03/angular-400-now-available.html" target="_blank" class="button md-button") 了解更多 diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade index 46ac3b2ce5..bdd1161a62 100644 --- a/public/_includes/_hero.jade +++ b/public/_includes/_hero.jade @@ -15,7 +15,7 @@ if current.path[4] && current.path[3] == 'api' if current.path.indexOf('cheatsheet') > 0 || current.path[current.path.length-2] === 'api' - var base = current.path[4] ? '../guide' : './guide'; - - var ngVersion = '(v2.X.Y)'; + - var ngVersion = '(v4.X.Y)'; header.hero.background-sky h1(class="hero-title #{textFormat}") #{headerTitle} !{ngVersion} diff --git a/public/_includes/_main-nav.jade b/public/_includes/_main-nav.jade index 58001184a8..442147fa1d 100644 --- a/public/_includes/_main-nav.jade +++ b/public/_includes/_main-nav.jade @@ -10,7 +10,6 @@ nav(data-swiftype-index="false" class="main-nav l-pinned-top l-layer-5", scroll- li.l-left 特性 li.l-left 文档 li.l-left 会议 - li.l-left 新闻 li.l-left a.main-nav-button(href="http://community.angular.cn/" target="_blank" md-button) | 社区 diff --git a/public/_includes/_scripts-include.jade b/public/_includes/_scripts-include.jade index af71717825..c8d1563d57 100644 --- a/public/_includes/_scripts-include.jade +++ b/public/_includes/_scripts-include.jade @@ -37,5 +37,4 @@ script(src="/resources/js/directives/code-pane.js") script(src="/resources/js/directives/code-example.js") script(src="/resources/js/directives/if-docs.js") script(src="/resources/js/directives/live-example.js") -script(src="/resources/js/directives/ngio-ex-path.js") script(src="/resources/js/directives/scroll-y-offset-element.js") diff --git a/public/docs/_examples/.gitignore b/public/docs/_examples/.gitignore index d3e14b4f54..3fb5ae8562 100644 --- a/public/docs/_examples/.gitignore +++ b/public/docs/_examples/.gitignore @@ -1,6 +1,7 @@ # _boilerplate files !_boilerplate/* */*/src/styles.css +*/*/src/systemjs-angular-loader.js */*/src/systemjs.config.js */*/src/tsconfig.json */*/bs-config.e2e.json @@ -15,4 +16,3 @@ protractor-helpers.js **/ts/**/*.js **/js-es6*/**/*.js **/ts-snippets/**/*.js -!**/systemjs.config.extras.js diff --git a/public/docs/_examples/_boilerplate/package.json b/public/docs/_examples/_boilerplate/package.json index 5ac9fa9de2..2e4bc19f91 100644 --- a/public/docs/_examples/_boilerplate/package.json +++ b/public/docs/_examples/_boilerplate/package.json @@ -38,7 +38,7 @@ "license": "MIT", "dependencies": {}, "devDependencies": { - "angular-cli": "^1.0.0-beta.26" + "angular-cli": "^1.0.0-rc.0" }, "repository": {} } diff --git a/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js b/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js new file mode 100644 index 0000000000..8b1005444e --- /dev/null +++ b/public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js @@ -0,0 +1,49 @@ +var templateUrlRegex = /templateUrl\s*:(\s*['"`](.*?)['"`]\s*)/gm; +var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g; +var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g; + +module.exports.translate = function(load){ + if (load.source.indexOf('moduleId') != -1) return load; + + var url = document.createElement('a'); + url.href = load.address; + + var basePathParts = url.pathname.split('/'); + + basePathParts.pop(); + var basePath = basePathParts.join('/'); + + var baseHref = document.createElement('a'); + baseHref.href = this.baseURL; + baseHref = baseHref.pathname; + + if (!baseHref.startsWith('/base/')) { // it is not karma + basePath = basePath.replace(baseHref, ''); + } + + load.source = load.source + .replace(templateUrlRegex, function(match, quote, url){ + var resolvedUrl = url; + + if (url.startsWith('.')) { + resolvedUrl = basePath + url.substr(1); + } + + return 'templateUrl: "' + resolvedUrl + '"'; + }) + .replace(stylesRegex, function(match, relativeUrls) { + var urls = []; + + while ((match = stringRegex.exec(relativeUrls)) !== null) { + if (match[2].startsWith('.')) { + urls.push('"' + basePath + match[2].substr(1) + '"'); + } else { + urls.push('"' + match[2] + '"'); + } + } + + return "styleUrls: [" + urls.join(', ') + "]"; + }); + + return load; +}; diff --git a/public/docs/_examples/_boilerplate/src/systemjs.config.js b/public/docs/_examples/_boilerplate/src/systemjs.config.js index 0d748b9e5e..ea7a3879ac 100644 --- a/public/docs/_examples/_boilerplate/src/systemjs.config.js +++ b/public/docs/_examples/_boilerplate/src/systemjs.config.js @@ -11,13 +11,16 @@ // map tells the System loader where to look for things map: { // our app is within the app folder - app: 'app', + 'app': 'app', // angular bundles + '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js', + '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js', '@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/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.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', @@ -34,7 +37,12 @@ packages: { app: { main: './main.js', - defaultExtension: 'js' + defaultExtension: 'js', + meta: { + './*.js': { + loader: 'systemjs-angular-loader.js' + } + } }, rxjs: { defaultExtension: 'js' diff --git a/public/docs/_examples/_boilerplate/src/systemjs.config.web.build.js b/public/docs/_examples/_boilerplate/src/systemjs.config.web.build.js index bfb9dbcd99..5774fd8187 100644 --- a/public/docs/_examples/_boilerplate/src/systemjs.config.web.build.js +++ b/public/docs/_examples/_boilerplate/src/systemjs.config.web.build.js @@ -35,13 +35,16 @@ // map tells the System loader where to look for things map: { // our app is within the app folder - app: 'app', + 'app': 'app', // angular bundles + '@angular/animations': 'ng:animations-builds/master/bundles/animations.umd.js', + '@angular/animations/browser': 'ng:animations-builds/master/bundles/animations-browser.umd.js', '@angular/core': 'ng:core-builds/master/bundles/core.umd.js', '@angular/common': 'ng:common-builds/master/bundles/common.umd.js', '@angular/compiler': 'ng:compiler-builds/master/bundles/compiler.umd.js', '@angular/platform-browser': 'ng:platform-browser-builds/master/bundles/platform-browser.umd.js', + '@angular/platform-browser/animations': 'ng:animations-builds/master/bundles/platform-browser-animations.umd.js', '@angular/platform-browser-dynamic': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'ng:http-builds/master/bundles/http.umd.js', '@angular/router': 'ng:router-builds/master/bundles/router.umd.js', @@ -64,14 +67,19 @@ 'rxjs': 'npm:rxjs@5.0.1', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js', - 'typescript': 'npm:typescript@2.0.10/lib/typescript.js', + 'typescript': 'npm:typescript@2.2.1/lib/typescript.js', }, // packages tells the System loader how to load when no filename and/or no extension packages: { app: { main: './main.ts', - defaultExtension: 'ts' + defaultExtension: 'ts', + meta: { + './*.ts': { + loader: 'systemjs-angular-loader.js' + } + } }, rxjs: { defaultExtension: 'js' @@ -79,58 +87,6 @@ } }); - if (global.autoBootstrap) { bootstrap(); } - - // Bootstrap with a default `AppModule` - // ignore an `app/app.module.ts` and `app/main.ts`, even if present - // This function exists primarily (exclusively?) for the QuickStart - function bootstrap() { - console.log('Auto-bootstrapping'); - - // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html - System.set(System.normalizeSync('app/main.ts'), System.newModule({ })); - - // bootstrap and launch the app (equivalent to standard main.ts) - Promise.all([ - System.import('@angular/platform-browser-dynamic'), - getAppModule() - ]) - .then(function (imports) { - var platform = imports[0]; - var app = imports[1]; - platform.platformBrowserDynamic().bootstrapModule(app.AppModule); - }) - .catch(function(err){ console.error(err); }); - } - - // Make the default AppModule - // returns a promise for the AppModule - function getAppModule() { - console.log('Making a bare-bones, default AppModule'); - - return Promise.all([ - System.import('@angular/core'), - System.import('@angular/platform-browser'), - System.import('app/app.component') - ]) - .then(function (imports) { - - var core = imports[0]; - var browser = imports[1]; - var appComp = imports[2].AppComponent; - - var AppModule = function() {} - - AppModule.annotations = [ - new core.NgModule({ - imports: [ browser.BrowserModule ], - declarations: [ appComp ], - bootstrap: [ appComp ] - }) - ] - return {AppModule: AppModule}; - }) - } })(this); /* diff --git a/public/docs/_examples/_boilerplate/src/systemjs.config.web.js b/public/docs/_examples/_boilerplate/src/systemjs.config.web.js index 576bded343..376fcdde8a 100644 --- a/public/docs/_examples/_boilerplate/src/systemjs.config.web.js +++ b/public/docs/_examples/_boilerplate/src/systemjs.config.web.js @@ -32,13 +32,16 @@ // map tells the System loader where to look for things map: { // our app is within the app folder - app: 'app', + 'app': 'app', // angular bundles + '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js', + '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js', '@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/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.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', @@ -51,14 +54,19 @@ 'rxjs': 'npm:rxjs@5.0.1', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js', - 'typescript': 'npm:typescript@2.0.10/lib/typescript.js', + 'typescript': 'npm:typescript@2.2.1/lib/typescript.js', }, // packages tells the System loader how to load when no filename and/or no extension packages: { app: { main: './main.ts', - defaultExtension: 'ts' + defaultExtension: 'ts', + meta: { + './*.ts': { + loader: 'systemjs-angular-loader.js' + } + } }, rxjs: { defaultExtension: 'js' @@ -66,58 +74,6 @@ } }); - if (global.autoBootstrap) { bootstrap(); } - - // Bootstrap with a default `AppModule` - // ignore an `app/app.module.ts` and `app/main.ts`, even if present - // This function exists primarily (exclusively?) for the QuickStart - function bootstrap() { - console.log('Auto-bootstrapping'); - - // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html - System.set(System.normalizeSync('app/main.ts'), System.newModule({ })); - - // bootstrap and launch the app (equivalent to standard main.ts) - Promise.all([ - System.import('@angular/platform-browser-dynamic'), - getAppModule() - ]) - .then(function (imports) { - var platform = imports[0]; - var app = imports[1]; - platform.platformBrowserDynamic().bootstrapModule(app.AppModule); - }) - .catch(function(err){ console.error(err); }); - } - - // Make the default AppModule - // returns a promise for the AppModule - function getAppModule() { - console.log('Making a bare-bones, default AppModule'); - - return Promise.all([ - System.import('@angular/core'), - System.import('@angular/platform-browser'), - System.import('app/app.component') - ]) - .then(function (imports) { - - var core = imports[0]; - var browser = imports[1]; - var appComp = imports[2].AppComponent; - - var AppModule = function() {} - - AppModule.annotations = [ - new core.NgModule({ - imports: [ browser.BrowserModule ], - declarations: [ appComp ], - bootstrap: [ appComp ] - }) - ] - return {AppModule: AppModule}; - }) - } })(this); /* diff --git a/public/docs/_examples/animations/ts/src/app/app.module.ts b/public/docs/_examples/animations/ts/src/app/app.module.ts index 1550034236..0773357c58 100644 --- a/public/docs/_examples/animations/ts/src/app/app.module.ts +++ b/public/docs/_examples/animations/ts/src/app/app.module.ts @@ -1,5 +1,8 @@ +// #docregion animations-module import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +// #enddocregion animations-module import { HeroTeamBuilderComponent } from './hero-team-builder.component'; import { HeroListBasicComponent } from './hero-list-basic.component'; @@ -13,8 +16,10 @@ import { HeroListGroupsComponent } from './hero-list-groups.component'; import { HeroListMultistepComponent } from './hero-list-multistep.component'; import { HeroListTimingsComponent } from './hero-list-timings.component'; +// #docregion animation-module @NgModule({ - imports: [ BrowserModule ], + imports: [ BrowserModule, BrowserAnimationsModule ], + // #enddocregion animation-module declarations: [ HeroTeamBuilderComponent, HeroListBasicComponent, diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-auto.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-auto.component.ts index df7280d3ea..84b25c05de 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-auto.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-auto.component.ts @@ -1,17 +1,18 @@ import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, animate, transition -} from '@angular/core'; +} from '@angular/animations'; import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-auto', // #docregion template template: ` diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-basic.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-basic.component.ts index a40f9ade94..76d5ba686c 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-basic.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-basic.component.ts @@ -3,19 +3,20 @@ // #docregion imports import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, - transition, - animate -} from '@angular/core'; + animate, + transition +} from '@angular/animations'; // #enddocregion imports import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-basic', // #enddocregion /* The click event calls hero.toggleState(), which diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-combined-transitions.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-combined-transitions.component.ts index b40a0c3514..fc654cbcb5 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-combined-transitions.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-combined-transitions.component.ts @@ -2,19 +2,20 @@ // #docregion imports import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, - transition, - animate -} from '@angular/core'; + animate, + transition +} from '@angular/animations'; // #enddocregion imports import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-combined-transitions', // #docregion template template: ` diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave-states.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave-states.component.ts index a88e08f251..c01e182e8b 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave-states.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave-states.component.ts @@ -1,17 +1,18 @@ import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, animate, transition -} from '@angular/core'; +} from '@angular/animations'; import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-enter-leave-states', // #docregion template template: ` diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave.component.ts index 05944c84f1..f27b5f10e1 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-enter-leave.component.ts @@ -1,17 +1,18 @@ import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, animate, transition -} from '@angular/core'; +} from '@angular/animations'; import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-enter-leave', // #docregion template template: ` diff --git a/public/docs/_examples/animations/ts/src/app/hero-list-groups.component.ts b/public/docs/_examples/animations/ts/src/app/hero-list-groups.component.ts index dda696eca2..12a57292f7 100644 --- a/public/docs/_examples/animations/ts/src/app/hero-list-groups.component.ts +++ b/public/docs/_examples/animations/ts/src/app/hero-list-groups.component.ts @@ -1,18 +1,19 @@ import { Component, - Input, + Input +} from '@angular/core'; +import { trigger, state, style, animate, transition, group -} from '@angular/core'; +} from '@angular/animations'; import { Heroes } from './hero.service'; @Component({ - moduleId: module.id, selector: 'hero-list-groups', template: `