diff --git a/gulpfile.js b/gulpfile.js index 50ca975a39..1476231c6c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -25,6 +25,8 @@ var globby = require("globby"); var treeKill = require("tree-kill"); var blc = require("broken-link-checker"); +var tslint = require('gulp-tslint'); + // TODO: // 1. Think about using runSequence // 2. Think about using spawn instead of exec in case of long error messages. @@ -45,6 +47,7 @@ var exampleZipper = require(path.resolve(TOOLS_PATH, '_example-zipper/exampleZip var plunkerBuilder = require(path.resolve(TOOLS_PATH, 'plunker-builder/plunkerBuilder')); var fsUtils = require(path.resolve(TOOLS_PATH, 'fs-utils/fsUtils')); + var _devguideShredOptions = { examplesDir: path.join(DOCS_PATH, '_examples'), fragmentsDir: path.join(DOCS_PATH, '_fragments'), @@ -74,6 +77,7 @@ var _exampleBoilerplateFiles = [ 'karma-test-shim.js', 'package.json', 'styles.css', + 'systemjs.config.js', 'tsconfig.json', 'tslint.json', 'typings.json', @@ -498,6 +502,20 @@ gulp.task('_zip-examples', function() { }); +// Linting + +gulp.task('lint', function() { + return gulp.src(['./public/docs/_examples/style-guide/ts/**/*.ts', '!./public/docs/_examples/style-guide/ts/**/*.avoid.ts']) + .pipe(tslint({ + rulesDirectory: ['node_modules/codelyzer'], + configuration: require('./tslint.json') + })) + .pipe(tslint.report('prose', { + summarizeFailureOutput: true + })); +}); + + // Helper functions function harpCompile() { diff --git a/harp.json b/harp.json index 99e38bff18..aeeda7f949 100644 --- a/harp.json +++ b/harp.json @@ -286,7 +286,13 @@ "bio": "Chuck is a Software Engineer on the Angular team at Google. He is a programming language geek, UI framework and component library veteran, and has a passion for simplifying the task of programming. Before Google, he worked at Microsoft and Borland.", "type": "Google" }, - + "stephenfluin": { + "name": "Stephen Fluin", + "picture": "/resources/images/bios/stephenfluin.jpg", + "twitter": "stephenfluin", + "bio": "Stephen is a Developer Advocate working on the Angular team. Before joining Google, he was a Google Expert. Stephen loves to help enterprises use technology more effectively.", + "type": "Google" + }, "pawel": { "name": "Pawel Kozlowski", "picture": "/resources/images/bios/pawel.jpg", diff --git a/package.json b/package.json index e8267dcdec..91076fd867 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "harp": "harp", "live-server": "live-server", "test-api-builder": "jasmine-node tools/api-builder", - "protractor": "protractor" }, "repository": { @@ -28,10 +27,11 @@ "devDependencies": { "archiver": "^0.16.0", "assert-plus": "^0.1.5", - "broken-link-checker":"0.7.0", + "broken-link-checker": "0.7.0", "browser-sync": "^2.9.3", "canonical-path": "0.0.2", "cross-spawn": "^2.1.0", + "codelyzer": "0.0.18", "del": "^1.2.0", "dgeni": "^0.4.0", "dgeni-packages": "^0.11.1", @@ -42,6 +42,7 @@ "gulp": "^3.5.6", "gulp-env": "0.4.0", "gulp-task-listing": "^1.0.1", + "gulp-tslint": "^4.3.5", "gulp-util": "^3.0.6", "gulp-watch": "^4.3.4", "harp": "^0.20.3", @@ -66,6 +67,7 @@ "protractor": "^3.0.0", "q": "^1.4.1", "tree-kill": "^1.0.0", + "tslint": "^3.2.2", "typescript": "1.7.3", "yargs": "^3.23.0" }, diff --git a/public/_data.json b/public/_data.json index 6427634fc8..cfa077a4a9 100644 --- a/public/_data.json +++ b/public/_data.json @@ -1,13 +1,12 @@ { "index": { "hero": "home", - "title": "一个框架", - "subtitle": "适用于手机与桌面" + "title": "一套框架,多个平台", + "subtitle": "同时适用手机与桌面" }, "features": { - "title": "特性与优点", - "subtitle": "开发应用程序的强力特性" + "title": "特性与优点" }, "contribute": { @@ -17,8 +16,7 @@ }, "news": { - "title": "新闻", - "subtitle": "看看我们正在做什么" + "title": "新闻" }, "events": { @@ -29,5 +27,29 @@ "support": { "title": "支持", "subtitle": "从Angular社区获得支持" + }, + + "presskit": { + "title": "出版工具" + }, + + "books": { + "title": "书籍" + }, + + "training": { + "title": "培训" + }, + + "communities": { + "title": "社区" + }, + + "tooling": { + "title": "工具与库" + }, + + "all-resources": { + "title": "资源" } } diff --git a/public/_includes/_footer.jade b/public/_includes/_footer.jade index 065865dc59..5ef757ccba 100644 --- a/public/_includes/_footer.jade +++ b/public/_includes/_footer.jade @@ -8,46 +8,42 @@ else - var styleguide = "/docs/ts/latest/styleguide.html" .main-footer - nav.background-silver.grid-fluid + nav.background-blue-grey-900.grid-fluid .c3.main-footer-branding .logo-inverse-large - .c2 - h3.text-headline 库 + .c3 + h3.text-headline 资源 ul.text-body - li Angular 2.0 - li Angular 1 for JS - li Angular Material - li AngularFire + // TODO: (ericjim) make a libraries page to showcase all angular 2 libraries + //li Libraries + li 关于 + li 书籍与培训 + li 工具与库 + li 社区 + li 出版工具 - .c2 - h3.text-headline 学习资源 - - ul.text-body - li 5分钟快速开始 - li 单步指南 - li 全部API - li 资源 - li 设计文档 & 记录 - - .c2 + .c3 h3.text-headline 帮助 ul.text-body + li Stack Overflow + li Gitter li Google Group - li 聊天室 - li 报告BUG + li 报告问题 + li 站内反馈 .c3 h3.text-headline 社区 ul.text-body - li 官方博客 - li Google+ + li Events + li Meetups li Twitter li GitHub + li Contribute footer(class="background-steel") diff --git a/public/_includes/_hero-home.jade b/public/_includes/_hero-home.jade index 18970ea473..e6e428410d 100644 --- a/public/_includes/_hero-home.jade +++ b/public/_includes/_hero-home.jade @@ -3,10 +3,13 @@ header(class="background-sky") h1.text-headline.hero-logo #{title}
#{subtitle} .hero-cta - a(href="/docs/ts/latest/quickstart.html" class="md-raised button button-large button-plain" - md-button) 现在开始! + a(href="/docs/ts/latest/quickstart.html" class="md-raised button button-large button-plain" md-button) Get Started -.banner.is-centered +.banner.banner-floaty .banner-ng-annoucement - h4 Angular的挑战赛 — 一次48小时的线上黑客马拉松就在2016年5月14~15日。  - a(href="https://www.angularattack.com/" target="_blank") 立即注册 + div(class="banner-text") + p Watch the ng-conf Live Stream May 4th-6th.  + p 观看 ng-conf 实时视频 May 4th-6th.  + div(class="banner-button") + a(href="https://www.ng-conf.org/#/extended" target="_blank" class="button md-button") View Live Stream + a(href="https://www.ng-conf.org/#/extended" target="_blank" class="button md-button") 查看实时视频 diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade index 26c4ddd46b..53bf8fee5d 100644 --- a/public/_includes/_hero.jade +++ b/public/_includes/_hero.jade @@ -8,8 +8,9 @@ if current.path[4] && current.path[3] == 'api' - var textFormat = 'is-standard-case' header(class="hero background-sky") - h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle} - if useBadges + div(class="inner-header") + h1(class="hero-title text-display-1 #{textFormat}") #{headerTitle} + if useBadges span(class="badges") if docType span(class="status-badge"). diff --git a/public/_includes/_main-nav.jade b/public/_includes/_main-nav.jade index 71cd401d91..256c2dca3f 100644 --- a/public/_includes/_main-nav.jade +++ b/public/_includes/_main-nav.jade @@ -10,9 +10,6 @@ md-toolbar(class="main-nav background-regal l-pinned-top l-layer-5",scroll-y-off ul(ng-class="appCtrl.showMainNav ? 'is-visible' : ''") li.l-left 特性 li.l-left 文档 - li.l-left 关于 - li.l-left 贡献 - li.l-left 支持 - li.l-left 新闻 li.l-left 事件 - li.l-right.feedback-button feedback + li.l-left 新闻 + li.l-right 立即开始! diff --git a/public/_includes/_util-fns.jade b/public/_includes/_util-fns.jade index 143489bf08..00288b6c6c 100644 --- a/public/_includes/_util-fns.jade +++ b/public/_includes/_util-fns.jade @@ -4,13 +4,20 @@ mixin includeShared(filePath, region) - var newPath = translatePath(filePath, region); !=partial(newPath) -mixin makeExample(filePath, region, title, stylePatterns) +mixin makeExample(_filePath, region, _title, stylePatterns) + - var filePath = adjustExamplePath ? adjustExamplePath(_filePath) : _filePath; + - var title = adjustExampleTitle ? adjustExampleTitle(_title) : _title; - var language = attributes.language || getExtn(filePath); - var frag = getFrag(filePath, region); - var defaultFormat = frag.split('\n').length > 2 ? "linenums" : ""; - var format = attributes.format || defaultFormat; + - var avoid = !!attributes.avoid; + if (title) - .example-title #{title} + if (avoid) + .example-title.avoid AVOID: #{title} + else + .example-title #{title} code-example(language="#{language}" format="#{format}") != styleString(frag, stylePatterns) @@ -37,9 +44,13 @@ mixin makeJson( filePath, jsonConfig, title, stylePatterns) - var frag = getFrag(filePath, ''); - var json = unescapeHtml(frag); - var jsonExtract = extractJson(json, jsonConfig); + - var avoid = !!attributes.avoid; if (title) - .example-title #{title} + if (avoid) + .example-title.avoid #{title} + else + .example-title #{title} code-example(language="#{language}" format="#{format}") if (jsonExtract == 'ERROR') err 错误: 无法通过配置"#{jsonConfig.toString()}"解析JSON diff --git a/public/all-resources.jade b/public/all-resources.jade new file mode 100644 index 0000000000..1d6dfa6d0c --- /dev/null +++ b/public/all-resources.jade @@ -0,0 +1,200 @@ +div + p(class="text-body") Would you like to be listed in this page? Fill out this form. + div(style="display: flex; justify-content: space-between; flex-wrap: wrap;") + div + h1 Books + div(class="resources") + h3 Packt Publishing + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/switching-angular-2") Switching to Angular 2 + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Mastering Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-blueprints") Angular 2 Blueprints + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-example") Angular 2 By Examples + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/learning-angular-2-net-developers") Learning Angular 2 for .NET Developers + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-test-driven-development") Angular 2 Test-driven Development + + h3 Manning Publications + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-in-action") Angular 2 In Action + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-development-with-typescript") Angular 2 Development with TypeScript + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/testing-angular-2-applications") Testing Angular 2 Applications + + h3 O'Reilly Media + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://www.oreilly.com/pub/e/3693") Angular 2 Web Development with TypeScript + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/0636920051824.do") Migrating to Angular 2 + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/9781785886201.do") Switching to Angular 2 + + h3 Self-published + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://ngcourse.rangle.io/") Rangle.io: ngCourse 2 + li(class="book") + a(class="title text-body" href="https://www.ng-book.com/2/") ng-book 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/angular2-book") Angular 2 Book + li(class="book") + a(class="title text-body" href="https://books.ninja-squad.com/angular2") Become a ninja with Angular 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/practical-angular-2") Practical Angular 2 + + div + h1 Training + div(class="resources") + h3 Rangle.io + ul(class="publisher") + li(class="course") + a(class="title text-body" href="http://rangle.io/services/javascript-training/training-angular1-angular2-with-ngupgrade/") Angular 2 Online Training + + h3 Pluralsight + ul(class="publisher") + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-first-look") Angular 2: First Look + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-getting-started") Angular 2: Getting Started + + h3 Udemy + ul(class="publisher") + li + a(class="title text-body" href="https://www.udemy.com/the-complete-guide-to-angular-2/?utm_content=_._ag_angular%202_._ad_47395956109_._de_c_._dm__._lo_9061189_._&matchtype=b&gclid=CjwKEAjww9O3BRDp1tq0jIP023YSJAB0-j1S4bFN4tudrjzZO_-ABNAfFQJrhrKo7KX1AnV-8yjV-hoCRrDw_wcB&utm_medium=udemyads&k_clickid=dce13cd7-9844-44dc-9967-020275b637c9_408_GOOGLE_NEW-AW-PROS-TECH-Dev-angular-2-EN-ENG_._ci_756150_._sl_ENG_._vi_TECH_._sd_All_._la_EN_.__angular%202_%2Bangular%20%2B2_b_47395956109_c&utm_campaign=NEW-AW-PROS-TECH-Dev-angular-2-EN-ENG_._ci_756150_._sl_ENG_._vi_TECH_._sd_All_._la_EN_._&utm_source=adwords&utm_term=_._pl__._pd__._ti_kwd-68757357257_._kw_%2Bangular%20%2B2_._&pmtag=72bf13dc-329c-411c-b381-a6143735b9dc") The Complete Guide to Angular 2 + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 With TypeScript for Beginners + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 Jumpstart with Typescript + li + a(class="title text-body" href="https://www.udemy.com/angular-2-fundamentals/") Angular 2 Fundamentals + li + a(class="title text-body" href="https://www.udemy.com/angular-2-master-class-with-alejandro-rangel/") Angular 2 Master Class + li + a(class="title text-body" href="https://www.udemy.com/introduction-to-angular2/") Angular 2 Demystified + + h3 egghead.io + ul(class="publisher") + li + a(class="title text-body" href="https://egghead.io/technologies/angular2") Angular 2 videos + + h3 Workshops & Onsite Training Vendors + ul(class="publisher") + li + a(class="title text-body" href="http://rangle.io/services/javascript-training/angular2-training/") Rangle.io + li + a(class="title text-body" href="http://oasisdigital.com/training") Oasis Digital + li + a(class="title text-body" href="http://thoughtram.io/") Thoughtram + + div + h1 Tooling and Libraries + div(class="resources") + h3 Tooling + ul + li + a(class="text-body" href="https://augury.rangle.io/") Augury + li + a(class="text-body" href="https://github.com/angular/universal") Angular Universal + li + a(class="text-body" href="https://github.com/johnpapa/lite-server") Lite-server + li + a(class="text-body" href="https://github.com/mgechev/codelyzer") Codelyzer + + h3 IDEs + ul + li + a(class="text-body" href="http://code.visualstudio.com/") Visual Studio Code + li + a(class="text-body" href="https://www.jetbrains.com/webstorm/") WebStorm + li + a(class="text-body" href="https://www.jetbrains.com/idea/") IntelliJ IDEA + + h3 Data Libraries + ul + li + a(class="text-body" href="https://www.firebase.com/") Firebase + li + a(class="text-body" href="https://www.meteor.com/") Meteor + li + a(class="text-body" href="http://mean.io/") MEAN + + h3 UI Components + ul + li + a(class="text-body" href="https://github.com/angular/material2") Angular Material 2 + li + a(class="text-body" href="http://www.primefaces.org/primeng/") Prime Faces + li + a(class="text-body" href="http://www.telerik.com/blogs/what-to-expect-in-2016-for-kendo-ui-with-angular-2-and-more") Kendo UI + li + a(class="text-body" href="http://ng-lightning.github.io/ng-lightning/") ng-lightening + li + a(class="text-body" href="http://wijmo.com/products/wijmo-5/") Wijmo + li + a(class="text-body" href="https://angular-ui.github.io/bootstrap/") Bootstrap UI + li + a(class="text-body" href="https://vaadin.com/home") Vaadin + + h3 Cross-Platform Development + ul + li + a(class="text-body" href="https://github.com/NativeScript/nativescript-angular") NativeScript + li + a(class="text-body" href="http://angular.github.io/react-native-renderer/") React Native + li + a(class="text-body" href="http://ionicframework.com/docs/v2/") Ionic + li + a(class="text-body" href="http://github.com/angular/angular-electron") Electron + li + a(class="text-body" href="http://github.com/preboot/angular2-universal-windows-app") Windows (UWP) + + div + h1 Communities + div(class="resources") + p(class="text-body") Would you like to be listed in this page? Fill out this form. + + h3 Podcasts + ul(class="podcasts") + li(class="podcast") + a(class="text-body" href="https://angularair.com/") AngularAir + li(class="podcast") + a(class="text-body" href="https://javascriptair.com/") JavaScript Air + li(class="podcast") + a(class="text-body" href="https://devchat.tv/adventures-in-angular") Adventures in Angular + + + h3 Communities + ul(class="communities") + li(class="community") + a(class="text-body" href="http://angularbeers.org/") Angular Beers + li(class="community") + a(class="text-body" href="http://angularcamp.org/") Angular Camp + li(class="community") + a(class="text-body" href="http://www.meetup.com/find/?allMeetups=false&keywords=angularjs&radius=Infinity&userFreeform=94043&gcResults=Mountain+View%2C+CA+94043%2C+USA%3AUS%3ACalifornia%3ASanta+Clara+County%3AMountain+View%3Anull%3A94043%3A37.428434%3A-122.07238159999997&change=yes&sort=default") Angular Meetups + + + + + + + + + + + + + + + + + diff --git a/public/books.jade b/public/books.jade new file mode 100644 index 0000000000..b9a60d089a --- /dev/null +++ b/public/books.jade @@ -0,0 +1,54 @@ +div(class="resources") + p(class="text-body") Would you like to be listed in this page? Fill out this form. + + h3 Packt Publishing + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/switching-angular-2") Switching to Angular 2 + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Mastering Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-blueprints") Angular 2 Blueprints + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-example") Angular 2 By Examples + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/learning-angular-2-net-developers") Learning Angular 2 for .NET Developers + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-test-driven-development") Angular 2 Test-driven Development + + h3 Manning Publications + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-in-action") Angular 2 In Action + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-development-with-typescript") Angular 2 Development with TypeScript + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/testing-angular-2-applications") Testing Angular 2 Applications + + h3 O'Reilly Media + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://www.oreilly.com/pub/e/3693") Angular 2 Web Development with TypeScript + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/0636920051824.do") Migrating to Angular 2 + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/9781785886201.do") Switching to Angular 2 + + h3 Self-published + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://ngcourse.rangle.io/") Rangle.io: ngCourse 2 + li(class="book") + a(class="title text-body" href="https://www.ng-book.com/2/") ng-book 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/angular2-book") Angular 2 Book + li(class="book") + a(class="title text-body" href="https://books.ninja-squad.com/angular2") Become a ninja with Angular 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/practical-angular-2") Practical Angular 2 + + + + diff --git a/public/communities.jade b/public/communities.jade new file mode 100644 index 0000000000..a6b5c0dcf4 --- /dev/null +++ b/public/communities.jade @@ -0,0 +1,26 @@ +div(class="resources") + p(class="text-body") Would you like to be listed in this page? Fill out this form. + + h3 Podcasts + ul(class="podcasts") + li(class="podcast") + a(class="text-body" href="https://angularair.com/") AngularAir + li(class="podcast") + a(class="text-body" href="https://javascriptair.com/") JavaScript Air + li(class="podcast") + a(class="text-body" href="https://devchat.tv/adventures-in-angular") Adventures in Angular + + + h3 Communities + ul(class="communities") + li(class="community") + a(class="text-body" href="http://angularbeers.org/") Angular Beers + li(class="community") + a(class="text-body" href="http://angularcamp.org/") Angular Camp + li(class="community") + a(class="text-body" href="http://www.meetup.com/find/?allMeetups=false&keywords=angularjs&radius=Infinity&userFreeform=94043&gcResults=Mountain+View%2C+CA+94043%2C+USA%3AUS%3ACalifornia%3ASanta+Clara+County%3AMountain+View%3Anull%3A94043%3A37.428434%3A-122.07238159999997&change=yes&sort=default") Angular Meetups + + + + + diff --git a/public/docs/_examples/.gitignore b/public/docs/_examples/.gitignore index 07614a46ec..a7b60352e4 100644 --- a/public/docs/_examples/.gitignore +++ b/public/docs/_examples/.gitignore @@ -15,7 +15,12 @@ tslint.json wallaby.js npm-debug*. protractor.config.js +systemjs.config.js _test-output _temp +**/ts/**/*.js +**/ts-snippets/**/*.js +**/ts/**/*.d.ts !**/*e2e-spec.js +!systemjs.config.1.js diff --git a/public/docs/_examples/architecture/dart/lib/hero_list_component.html b/public/docs/_examples/architecture/dart/lib/hero_list_component.html index 539ef5fdd5..e493e949fb 100644 --- a/public/docs/_examples/architecture/dart/lib/hero_list_component.html +++ b/public/docs/_examples/architecture/dart/lib/hero_list_component.html @@ -1,7 +1,7 @@

Hero List

-
+
{{hero.name}}
diff --git a/public/docs/_examples/architecture/dart/lib/hero_list_component_1.html b/public/docs/_examples/architecture/dart/lib/hero_list_component_1.html index 8673962169..7a08bd2f8b 100644 --- a/public/docs/_examples/architecture/dart/lib/hero_list_component_1.html +++ b/public/docs/_examples/architecture/dart/lib/hero_list_component_1.html @@ -5,6 +5,6 @@ -
...
+
...
diff --git a/public/docs/_examples/architecture/dart/pubspec.yaml b/public/docs/_examples/architecture/dart/pubspec.yaml index ae0dd30e42..9418b2ec76 100644 --- a/public/docs/_examples/architecture/dart/pubspec.yaml +++ b/public/docs/_examples/architecture/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.15 + angular2: 2.0.0-beta.17 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/architecture/ts/.gitignore b/public/docs/_examples/architecture/ts/.gitignore deleted file mode 100644 index 2cb7d2a2e9..0000000000 --- a/public/docs/_examples/architecture/ts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -**/*.js diff --git a/public/docs/_examples/architecture/ts/app/app.component.ts b/public/docs/_examples/architecture/ts/app/app.component.ts index 144990a86e..409fde3aa3 100644 --- a/public/docs/_examples/architecture/ts/app/app.component.ts +++ b/public/docs/_examples/architecture/ts/app/app.component.ts @@ -1,5 +1,5 @@ // #docregion import -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; // #enddocregion import import {HeroListComponent} from './hero-list.component'; import {SalesTaxComponent} from './sales-tax.component'; @@ -14,4 +14,4 @@ import {SalesTaxComponent} from './sales-tax.component'; }) // #docregion export export class AppComponent { } -// #enddocregion export \ No newline at end of file +// #enddocregion export diff --git a/public/docs/_examples/architecture/ts/app/backend.service.ts b/public/docs/_examples/architecture/ts/app/backend.service.ts index 0600fee6e0..2170c88758 100644 --- a/public/docs/_examples/architecture/ts/app/backend.service.ts +++ b/public/docs/_examples/architecture/ts/app/backend.service.ts @@ -1,4 +1,4 @@ -import {Injectable, Type} from 'angular2/core'; +import {Injectable, Type} from '@angular/core'; import {Logger} from './logger.service'; import {Hero} from './hero'; diff --git a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts index d8c7bed1a8..2a8d23e392 100644 --- a/public/docs/_examples/architecture/ts/app/hero-detail.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-detail.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from 'angular2/core'; +import {Component, Input} from '@angular/core'; import {Hero} from './hero'; @Component({ @@ -7,5 +7,5 @@ import {Hero} from './hero'; directives: [HeroDetailComponent] }) export class HeroDetailComponent { - @Input() hero:Hero; -} \ No newline at end of file + @Input() hero: Hero; +} diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.1.html b/public/docs/_examples/architecture/ts/app/hero-list.component.1.html index 7fbd8f22ac..d4d6b905fa 100644 --- a/public/docs/_examples/architecture/ts/app/hero-list.component.1.html +++ b/public/docs/_examples/architecture/ts/app/hero-list.component.1.html @@ -6,7 +6,7 @@ -
+
diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.html b/public/docs/_examples/architecture/ts/app/hero-list.component.html index a3de7f2950..f3c92b3141 100644 --- a/public/docs/_examples/architecture/ts/app/hero-list.component.html +++ b/public/docs/_examples/architecture/ts/app/hero-list.component.html @@ -2,7 +2,7 @@

Hero List

Pick a hero from the list

-
+
{{hero.name}}
diff --git a/public/docs/_examples/architecture/ts/app/hero-list.component.ts b/public/docs/_examples/architecture/ts/app/hero-list.component.ts index 7d4c3e152d..686775eff5 100644 --- a/public/docs/_examples/architecture/ts/app/hero-list.component.ts +++ b/public/docs/_examples/architecture/ts/app/hero-list.component.ts @@ -1,5 +1,5 @@ // #docplaster -import {Component, OnInit} from 'angular2/core'; +import {Component, OnInit} from '@angular/core'; import {Hero} from './hero'; import {HeroDetailComponent} from './hero-detail.component'; import {HeroService} from './hero.service'; @@ -24,13 +24,13 @@ export class HeroesComponent { ... } // #docregion class export class HeroListComponent implements OnInit { // #docregion ctor - constructor(private _service: HeroService){ } + constructor(private _service: HeroService) { } // #enddocregion ctor - heroes:Hero[]; + heroes: Hero[]; selectedHero: Hero; - ngOnInit(){ + ngOnInit() { this.heroes = this._service.getHeroes(); } diff --git a/public/docs/_examples/architecture/ts/app/hero.service.ts b/public/docs/_examples/architecture/ts/app/hero.service.ts index 4fd33a5e09..7f524daa4d 100644 --- a/public/docs/_examples/architecture/ts/app/hero.service.ts +++ b/public/docs/_examples/architecture/ts/app/hero.service.ts @@ -1,4 +1,4 @@ -import {Injectable} from 'angular2/core'; +import {Injectable} from '@angular/core'; import {Hero} from './hero'; import {BackendService} from './backend.service'; import {Logger} from './logger.service'; @@ -12,14 +12,14 @@ export class HeroService { private _logger: Logger) { } // #enddocregion ctor - private _heroes:Hero[] = []; + private _heroes: Hero[] = []; getHeroes() { - this._backend.getAll(Hero).then( (heroes:Hero[]) => { + this._backend.getAll(Hero).then( (heroes: Hero[]) => { this._logger.log(`Fetched ${heroes.length} heroes.`); this._heroes.push(...heroes); // fill cache }); return this._heroes; } } -// #enddocregion class \ No newline at end of file +// #enddocregion class diff --git a/public/docs/_examples/architecture/ts/app/hero.ts b/public/docs/_examples/architecture/ts/app/hero.ts index df6c37a0f5..b89557aa71 100644 --- a/public/docs/_examples/architecture/ts/app/hero.ts +++ b/public/docs/_examples/architecture/ts/app/hero.ts @@ -1,10 +1,10 @@ +let nextId = 1; + export class Hero { - id:number + id: number; constructor( - public name:string, - public power?:string){ + public name: string, + public power?: string) { this.id = nextId++; } } - -var nextId = 1; diff --git a/public/docs/_examples/architecture/ts/app/logger.service.ts b/public/docs/_examples/architecture/ts/app/logger.service.ts index 69a7cd6b87..ddbcb61ca7 100644 --- a/public/docs/_examples/architecture/ts/app/logger.service.ts +++ b/public/docs/_examples/architecture/ts/app/logger.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable} from 'angular2/core'; +import {Injectable} from '@angular/core'; @Injectable() // #docregion class @@ -8,4 +8,4 @@ export class Logger { error(msg: any) { console.error(msg); } warn(msg: any) { console.warn(msg); } } -// #enddocregion class \ No newline at end of file +// #enddocregion class diff --git a/public/docs/_examples/architecture/ts/app/main.ts b/public/docs/_examples/architecture/ts/app/main.ts index 0f064932b1..f5ab51b113 100644 --- a/public/docs/_examples/architecture/ts/app/main.ts +++ b/public/docs/_examples/architecture/ts/app/main.ts @@ -1,4 +1,4 @@ -import {bootstrap} from 'angular2/platform/browser'; +import {bootstrap} from '@angular/platform-browser-dynamic'; // #docregion import import {AppComponent} from './app.component'; // #enddocregion import diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts index 475725a0e4..19234de171 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.component.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.component.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {SalesTaxService} from './sales-tax.service'; import {TaxRateService} from './tax-rate.service'; diff --git a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts index 6a93d3795e..86a797515c 100644 --- a/public/docs/_examples/architecture/ts/app/sales-tax.service.ts +++ b/public/docs/_examples/architecture/ts/app/sales-tax.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable, Inject} from 'angular2/core'; +import {Injectable, Inject} from '@angular/core'; import {TaxRateService} from './tax-rate.service'; // #docregion class diff --git a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts index ab4fb2b097..8e6b9add1e 100644 --- a/public/docs/_examples/architecture/ts/app/tax-rate.service.ts +++ b/public/docs/_examples/architecture/ts/app/tax-rate.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable} from 'angular2/core'; +import {Injectable} from '@angular/core'; // #docregion class @Injectable() diff --git a/public/docs/_examples/architecture/ts/index.html b/public/docs/_examples/architecture/ts/index.html index 388031aa10..eb3a14a9c4 100644 --- a/public/docs/_examples/architecture/ts/index.html +++ b/public/docs/_examples/architecture/ts/index.html @@ -1,30 +1,21 @@ - Intro to Angular 2 - + Architecture of Angular 2 + + - + - - - + + - - + + @@ -32,4 +23,4 @@ Loading... - \ No newline at end of file + diff --git a/public/docs/_examples/architecture/ts/plnkr.json b/public/docs/_examples/architecture/ts/plnkr.json index ee199ba476..3acf69014c 100644 --- a/public/docs/_examples/architecture/ts/plnkr.json +++ b/public/docs/_examples/architecture/ts/plnkr.json @@ -1,8 +1,8 @@ { "description": "Intro to Angular2", "files":[ - "!**/*.d.ts", - "!**/*.js", + "!**/*.d.ts", + "!**/*.js", "!app/hero-list.component.1.*" ] -} \ No newline at end of file +} diff --git a/public/docs/_examples/attribute-directives/dart/pubspec.yaml b/public/docs/_examples/attribute-directives/dart/pubspec.yaml index b38d0d31a1..0472ac2166 100644 --- a/public/docs/_examples/attribute-directives/dart/pubspec.yaml +++ b/public/docs/_examples/attribute-directives/dart/pubspec.yaml @@ -5,7 +5,7 @@ version: 0.0.1 environment: sdk: '>=1.13.0 <2.0.0' dependencies: - angular2: 2.0.0-beta.15 + angular2: 2.0.0-beta.17 browser: ^0.10.0 dart_to_js_script_rewriter: ^1.0.1 transformers: diff --git a/public/docs/_examples/attribute-directives/ts/.gitignore b/public/docs/_examples/attribute-directives/ts/.gitignore deleted file mode 100644 index 2cb7d2a2e9..0000000000 --- a/public/docs/_examples/attribute-directives/ts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -**/*.js diff --git a/public/docs/_examples/attribute-directives/ts/app/app.component.ts b/public/docs/_examples/attribute-directives/ts/app/app.component.ts index 2cfed3b35f..458e02e08e 100644 --- a/public/docs/_examples/attribute-directives/ts/app/app.component.ts +++ b/public/docs/_examples/attribute-directives/ts/app/app.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {HighlightDirective} from './highlight.directive'; @Component({ diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts index 9b4dbd7448..3d3632272a 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.1.ts @@ -1,5 +1,5 @@ // #docregion -import {Directive, ElementRef, Input} from 'angular2/core'; +import {Directive, ElementRef, Input} from '@angular/core'; @Directive({ selector: '[myHighlight]' diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts index 1f42c5773f..9e7abaab88 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.2.ts @@ -1,5 +1,5 @@ // #docregion -import {Directive, ElementRef, Input} from 'angular2/core'; +import {Directive, ElementRef, Input} from '@angular/core'; @Directive({ selector: '[myHighlight]', diff --git a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts index 4380174c8f..2e9d68e9e1 100644 --- a/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts +++ b/public/docs/_examples/attribute-directives/ts/app/highlight.directive.ts @@ -1,6 +1,6 @@ // #docplaster // #docregion full -import {Directive, ElementRef, Input} from 'angular2/core'; +import {Directive, ElementRef, Input} from '@angular/core'; @Directive({ selector: '[myHighlight]', diff --git a/public/docs/_examples/attribute-directives/ts/app/main.ts b/public/docs/_examples/attribute-directives/ts/app/main.ts index 3fe89a9b15..1bb870eea0 100644 --- a/public/docs/_examples/attribute-directives/ts/app/main.ts +++ b/public/docs/_examples/attribute-directives/ts/app/main.ts @@ -1,5 +1,5 @@ // #docregion -import {bootstrap} from 'angular2/platform/browser'; +import {bootstrap} from '@angular/platform-browser-dynamic'; import {AppComponent} from './app.component'; bootstrap(AppComponent); diff --git a/public/docs/_examples/attribute-directives/ts/index.html b/public/docs/_examples/attribute-directives/ts/index.html index 97a38048b8..6bfef2480d 100644 --- a/public/docs/_examples/attribute-directives/ts/index.html +++ b/public/docs/_examples/attribute-directives/ts/index.html @@ -2,33 +2,25 @@ + Attribute Directives - + - - - + + - - + + + loading... diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/.gitignore b/public/docs/_examples/cb-a1-a2-quick-reference/ts/.gitignore deleted file mode 100644 index 2cb7d2a2e9..0000000000 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -**/*.js diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.html b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.html index e0be283708..9626afd5cb 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.html +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.html @@ -75,7 +75,7 @@

Movie Titles via local variable

- + @@ -84,7 +84,7 @@

Sliced Movies with pipes

{{movie.title}}
- + diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts index 6c19c4c4d6..e8d95fe134 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/app.component.ts @@ -1,5 +1,5 @@ -import {Component} from 'angular2/core'; -import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from "angular2/router"; +import {Component} from '@angular/core'; +import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router-deprecated'; import {MovieListComponent} from './movie-list.component'; import {MovieService} from './movie.service'; @@ -19,7 +19,7 @@ import {StringSafeDatePipe} from './date.pipe'; ]) export class AppComponent { - angularDocsUrl = "https://angular.io/"; + angularDocsUrl = 'https://angular.io/'; colorPreference = 'red'; eventType = ''; isActive = true; @@ -27,8 +27,8 @@ export class AppComponent { movie: IMovie = null; movies: IMovie[] = []; showImage = true; - title: string = "A1-A2 Quick Ref Cookbook"; - toggleImage(event:UIEvent) { + title: string = 'A1-A2 Quick Ref Cookbook'; + toggleImage(event: UIEvent) { this.showImage = !this.showImage; this.eventType = (event && event.type) || 'not provided'; } diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts index f9746ceef9..64a5ab80e5 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/date.pipe.ts @@ -1,14 +1,14 @@ -import {Injectable, Pipe} from 'angular2/core'; -import {DatePipe} from 'angular2/common'; +import {Injectable, Pipe} from '@angular/core'; +import {DatePipe} from '@angular/common'; @Injectable() // #docregion date-pipe @Pipe({name: 'date', pure: true}) export class StringSafeDatePipe extends DatePipe { - transform(value: any, args: any[]): string { + transform(value: any, format: string): string { value = typeof value === 'string' ? - Date.parse(value) : value - return super.transform(value, args); + Date.parse(value) : value; + return super.transform(value, format); } } // #enddocregion date-pipe diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/main.ts b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/main.ts index ec4c9d12d6..38cc516baa 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/main.ts +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/main.ts @@ -1,5 +1,5 @@ // #docregion -import {bootstrap} from 'angular2/platform/browser'; +import {bootstrap} from '@angular/platform-browser-dynamic'; import {AppComponent} from './app.component'; bootstrap(AppComponent); diff --git a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.html b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.html index 59edc28556..91f7f416cd 100644 --- a/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.html +++ b/public/docs/_examples/cb-a1-a2-quick-reference/ts/app/movie-list.component.html @@ -54,7 +54,7 @@ - +
+ Angular 1 to Angular 2 Quick Reference - + - - - + + - - - + + diff --git a/public/docs/_examples/cb-component-communication/ts/app/app.component.html b/public/docs/_examples/cb-component-communication/ts/app/app.component.html index 0c71b7379f..ef94020efb 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/app.component.html +++ b/public/docs/_examples/cb-component-communication/ts/app/app.component.html @@ -1,6 +1,6 @@

Component Communication Cookbook

-Pass data from parent to child with input binding ("Heros")
+Pass data from parent to child with input binding ("Heroes")
Intercept input property changes with a setter ("Master")
Intercept input property changes with ngOnChanges ("Source code version")
Parent listens for child event ("Colonize Universe")
diff --git a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts index 1cb24ac989..61e92738ae 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/app.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/app.component.ts @@ -1,4 +1,4 @@ -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {HeroParentComponent} from './hero-parent.component'; import {NameParentComponent} from './name-parent.component'; import {VersionParentComponent} from './version-parent.component'; diff --git a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts index 686543be33..7f8a195333 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/astronaut.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, Input, OnDestroy} from 'angular2/core'; +import {Component, Input, OnDestroy} from '@angular/core'; import {MissionService} from './mission.service'; import {Subscription} from 'rxjs/Subscription'; diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts index bc3487c688..8c9761a442 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-parent.component.ts @@ -1,8 +1,8 @@ // #docplaster // #docregion vc -import {AfterViewInit, ViewChild} from 'angular2/core'; +import {AfterViewInit, ViewChild} from '@angular/core'; // #docregion lv -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {CountdownTimerComponent} from './countdown-timer.component'; // #enddocregion lv diff --git a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts index 5df84c5e50..efd294685c 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/countdown-timer.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, OnInit, OnDestroy} from 'angular2/core'; +import {Component, OnInit, OnDestroy} from '@angular/core'; @Component({ selector:'countdown-timer', diff --git a/public/docs/_examples/cb-component-communication/ts/app/hero-child.component.ts b/public/docs/_examples/cb-component-communication/ts/app/hero-child.component.ts index 748d543983..c33ce43826 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/hero-child.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/hero-child.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, Input} from 'angular2/core'; +import {Component, Input} from '@angular/core'; import {Hero} from './hero'; @Component({ diff --git a/public/docs/_examples/cb-component-communication/ts/app/hero-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/hero-parent.component.ts index 17a2dcc93c..ef9544c472 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/hero-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/hero-parent.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {HeroChildComponent} from './hero-child.component'; import {HEROES} from './hero'; @@ -7,7 +7,7 @@ import {HEROES} from './hero'; selector: 'hero-parent', template: `

{{master}} controls {{heroes.length}} heroes

- diff --git a/public/docs/_examples/cb-component-communication/ts/app/main.ts b/public/docs/_examples/cb-component-communication/ts/app/main.ts index dc1879e9b5..d14f9ff611 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/main.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/main.ts @@ -1,4 +1,4 @@ -import {bootstrap} from 'angular2/platform/browser'; +import {bootstrap} from '@angular/platform-browser-dynamic'; import {AppComponent} from './app.component'; bootstrap(AppComponent); \ No newline at end of file diff --git a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts index b651646b4b..e754acc1cc 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/mission.service.ts @@ -1,5 +1,5 @@ // #docregion -import {Injectable} from 'angular2/core' +import {Injectable} from '@angular/core' import {Subject} from 'rxjs/Subject'; @Injectable() diff --git a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts index edcb0ae344..de13aef360 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/missioncontrol.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {AstronautComponent} from './astronaut.component'; import {MissionService} from './mission.service'; @@ -8,12 +8,12 @@ import {MissionService} from './mission.service'; template: `

Mission Control

-

History

    -
  • {{event}}
  • +
  • {{event}}
`, directives: [AstronautComponent], diff --git a/public/docs/_examples/cb-component-communication/ts/app/name-child.component.ts b/public/docs/_examples/cb-component-communication/ts/app/name-child.component.ts index a02fa7949e..366a54345d 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/name-child.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/name-child.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, Input} from 'angular2/core'; +import {Component, Input} from '@angular/core'; @Component({ selector: 'name-child', diff --git a/public/docs/_examples/cb-component-communication/ts/app/name-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/name-parent.component.ts index ec99f31675..16a3fbe4a6 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/name-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/name-parent.component.ts @@ -1,12 +1,12 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {NameChildComponent} from './name-child.component'; @Component({ selector: 'name-parent', template: `

Master controls {{names.length}} names

- `, diff --git a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts index 944c2888f6..3d5a8a56e7 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/version-child.component.ts @@ -1,5 +1,6 @@ +/* tslint:disable:forin */ // #docregion -import {Component, Input, OnChanges, SimpleChange} from 'angular2/core'; +import {Component, Input, OnChanges, SimpleChange} from '@angular/core'; @Component({ selector: 'version-child', @@ -7,7 +8,7 @@ import {Component, Input, OnChanges, SimpleChange} from 'angular2/core';

Version {{major}}.{{minor}}

Change log:

    -
  • {{change}}
  • +
  • {{change}}
` }) @@ -27,4 +28,4 @@ export class VersionChildComponent implements OnChanges { this.changeLog.push(log.join(', ')); } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/app/version-parent.component.ts b/public/docs/_examples/cb-component-communication/ts/app/version-parent.component.ts index fa3cff767a..8357f97a82 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/version-parent.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/version-parent.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {VersionChildComponent} from './version-child.component'; @Component({ diff --git a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts index 1c5fd16e25..14a99665e3 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/voter.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component, EventEmitter, Input, Output} from 'angular2/core'; +import {Component, EventEmitter, Input, Output} from '@angular/core'; @Component({ selector: 'my-voter', diff --git a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts index 02aeda9fd9..1101e8a8f7 100644 --- a/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts +++ b/public/docs/_examples/cb-component-communication/ts/app/votetaker.component.ts @@ -1,5 +1,5 @@ // #docregion -import {Component} from 'angular2/core'; +import {Component} from '@angular/core'; import {VoterComponent} from './voter.component'; @Component({ @@ -7,7 +7,7 @@ import {VoterComponent} from './voter.component'; template: `

Should mankind colonize the Universe?

Agree: {{agreed}}, Disagree: {{disagreed}}

- @@ -23,4 +23,4 @@ export class VoteTakerComponent { agreed ? this.agreed++ : this.disagreed++; } } -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_examples/cb-component-communication/ts/index.html b/public/docs/_examples/cb-component-communication/ts/index.html index 56965e27cf..ac9730a939 100644 --- a/public/docs/_examples/cb-component-communication/ts/index.html +++ b/public/docs/_examples/cb-component-communication/ts/index.html @@ -1,7 +1,7 @@ - + Passing information from parent to child + + + + + + diff --git a/public/resources/images/logos/angular2/angular_solidBlack.png b/public/resources/images/logos/angular2/angular_solidBlack.png new file mode 100644 index 0000000000..ab8a9764be Binary files /dev/null and b/public/resources/images/logos/angular2/angular_solidBlack.png differ diff --git a/public/resources/images/logos/angular2/angular_solidBlack.svg b/public/resources/images/logos/angular2/angular_solidBlack.svg new file mode 100644 index 0000000000..7e3faa0b2d --- /dev/null +++ b/public/resources/images/logos/angular2/angular_solidBlack.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/public/resources/images/logos/angular2/angular_whiteTransparent.png b/public/resources/images/logos/angular2/angular_whiteTransparent.png new file mode 100644 index 0000000000..f613abb357 Binary files /dev/null and b/public/resources/images/logos/angular2/angular_whiteTransparent.png differ diff --git a/public/resources/images/logos/angular2/angular_whiteTransparent.svg b/public/resources/images/logos/angular2/angular_whiteTransparent.svg new file mode 100644 index 0000000000..1a7b5b32d4 --- /dev/null +++ b/public/resources/images/logos/angular2/angular_whiteTransparent.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/public/resources/index.jade b/public/resources/index.jade new file mode 100644 index 0000000000..80ae78f5a5 --- /dev/null +++ b/public/resources/index.jade @@ -0,0 +1,171 @@ +div + p(class="text-body") Would you like to be listed in this page? Fill out this form. + div(style="display: flex; justify-content: space-between; flex-wrap: wrap;") + div + h1 Training + div(class="resources") + h3 Rangle.io + ul(class="publisher") + li(class="course") + a(class="title text-body" href="http://rangle.io/services/javascript-training/training-angular1-angular2-with-ngupgrade/") Angular 2 Online Training + + h3 Pluralsight + ul(class="publisher") + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-first-look") Angular 2: First Look + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-getting-started") Angular 2: Getting Started + + h3 Udemy + ul(class="publisher") + li + a(class="title text-body" href="https://www.udemy.com/the-complete-guide-to-angular-2") The Complete Guide to Angular 2 + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 With TypeScript for Beginners + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 Jumpstart with Typescript + li + a(class="title text-body" href="https://www.udemy.com/angular-2-fundamentals/") Angular 2 Fundamentals + li + a(class="title text-body" href="https://www.udemy.com/angular-2-master-class-with-alejandro-rangel/") Angular 2 Master Class + li + a(class="title text-body" href="https://www.udemy.com/introduction-to-angular2/") Angular 2 Demystified + + h3 egghead.io + ul(class="publisher") + li + a(class="title text-body" href="https://egghead.io/technologies/angular2") Angular 2 videos + + h3 Workshops & Onsite Training Vendors + ul(class="publisher") + li + a(class="title text-body" href="http://rangle.io/services/javascript-training/angular2-training/") Rangle.io + li + a(class="title text-body" href="http://oasisdigital.com/training") Oasis Digital + li + a(class="title text-body" href="http://thoughtram.io/") Thoughtram + li + a(class="title text-body" href="https://frontendmasters.com/workshops/angular-2/") FrontEnd Masters + div + h1 Books + div(class="resources") + h3 Packt Publishing + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/switching-angular-2") Switching to Angular 2 + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Mastering Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-blueprints") Angular 2 Blueprints + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-example") Angular 2 By Examples + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/mastering-angular-2-components") Angular 2 Components + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/learning-angular-2-net-developers") Learning Angular 2 for .NET Developers + li(class="book") + a(class="title text-body" href="https://www.packtpub.com/web-development/angular-2-test-driven-development") Angular 2 Test-driven Development + + h3 Manning Publications + ul(class="publisher") + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-in-action") Angular 2 In Action + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/angular-2-development-with-typescript") Angular 2 Development with TypeScript + li(class="book") + a(class="title text-body" href="https://www.manning.com/books/testing-angular-2-applications") Testing Angular 2 Applications + + h3 O'Reilly Media + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://www.oreilly.com/pub/e/3693") Angular 2 Web Development with TypeScript + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/0636920051824.do") Migrating to Angular 2 + li(class="book") + a(class="title text-body" href="http://shop.oreilly.com/product/9781785886201.do") Switching to Angular 2 + + h3 Self-published + ul(class="publisher") + li(class="book") + a(class="title text-body" href="http://ngcourse.rangle.io/") Rangle.io: ngCourse 2 + li(class="book") + a(class="title text-body" href="https://www.ng-book.com/2/") ng-book 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/angular2-book") Angular 2 Book + li(class="book") + a(class="title text-body" href="https://books.ninja-squad.com/angular2") Become a ninja with Angular 2 + li(class="book") + a(class="title text-body" href="https://leanpub.com/practical-angular-2") Practical Angular 2 + + div + h1 Tooling and Libraries + div(class="resources") + h3 Tooling + ul + li + a(class="text-body" href="https://augury.rangle.io/") Augury + li + a(class="text-body" href="https://github.com/angular/universal") Angular Universal + li + a(class="text-body" href="https://github.com/johnpapa/lite-server") Lite-server + li + a(class="text-body" href="https://github.com/mgechev/codelyzer") Codelyzer + + h3 IDEs + ul + li + a(class="text-body" href="http://code.visualstudio.com/") Visual Studio Code + li + a(class="text-body" href="https://www.jetbrains.com/webstorm/") WebStorm + li + a(class="text-body" href="https://www.jetbrains.com/idea/") IntelliJ IDEA + + h3 Data Libraries + ul + li + a(class="text-body" href="https://github.com/angular/angularfire2") AngularFire + li + a(class="text-body" href="http://www.angular-meteor.com/angular2") Meteor + li + a(class="text-body" href="http://docs.apollostack.com/apollo-client/angular2.html") Apollo + + h3 UI Components + ul + li + a(class="text-body" href="https://github.com/angular/material2") Angular Material 2 + li + a(class="text-body" href="http://www.primefaces.org/primeng/") Prime Faces + li + a(class="text-body" href="http://www.telerik.com/blogs/what-to-expect-in-2016-for-kendo-ui-with-angular-2-and-more") Kendo UI + li + a(class="text-body" href="http://ng-lightning.github.io/ng-lightning/") ng-lightening + li + a(class="text-body" href="http://wijmo.com/products/wijmo-5/") Wijmo + li + a(class="text-body" href="https://vaadin.com/elements") Vaadin + li + a(class="text-body" href="http://valor-software.com/ng2-bootstrap/") ng2-bootstrap + h3 Cross-Platform Development + ul + li + a(class="text-body" href="https://github.com/NativeScript/nativescript-angular") NativeScript + li + a(class="text-body" href="http://angular.github.io/react-native-renderer/") React Native + li + a(class="text-body" href="http://ionicframework.com/docs/v2/") Ionic + li + a(class="text-body" href="http://github.com/angular/angular-electron") Electron + li + a(class="text-body" href="http://github.com/preboot/angular2-universal-windows-app") Windows (UWP) + + div + h1 Podcasts + div(class="resources") + ul(class="podcasts") + li(class="podcast") + a(class="text-body" href="https://angularair.com/") AngularAir + li(class="podcast") + a(class="text-body" href="https://javascriptair.com/") JavaScript Air + li(class="podcast") + a(class="text-body" href="https://devchat.tv/adventures-in-angular") Adventures in Angular + diff --git a/public/tooling.jade b/public/tooling.jade new file mode 100644 index 0000000000..d153875baf --- /dev/null +++ b/public/tooling.jade @@ -0,0 +1,67 @@ +div(class="resources") + p(class="text-body") Would you like to be listed in this page? Fill out this form. + + h3 Tooling + ul + li + a(class="text-body" href="https://augury.rangle.io/") Augury + li + a(class="text-body" href="https://github.com/angular/universal") Angular Universal + li + a(class="text-body" href="https://github.com/johnpapa/lite-server") Lite-server + li + a(class="text-body" href="https://github.com/mgechev/codelyzer") Codelyzer + + h3 IDEs + ul + li + a(class="text-body" href="http://code.visualstudio.com/") Visual Studio Code + li + a(class="text-body" href="https://www.jetbrains.com/webstorm/") WebStorm + li + a(class="text-body" href="https://www.jetbrains.com/idea/") IntelliJ IDEA + + h3 Data Libraries + ul + li + a(class="text-body" href="https://www.firebase.com/") Firebase + li + a(class="text-body" href="https://www.meteor.com/") Meteor + li + a(class="text-body" href="http://mean.io/") MEAN + + h3 UI Components + ul + li + a(class="text-body" href="https://github.com/angular/material2") Angular Material 2 + li + a(class="text-body" href="http://www.primefaces.org/primeng/") Prime Faces + li + a(class="text-body" href="http://www.telerik.com/blogs/what-to-expect-in-2016-for-kendo-ui-with-angular-2-and-more") Kendo UI + li + a(class="text-body" href="http://ng-lightning.github.io/ng-lightning/") ng-lightening + li + a(class="text-body" href="http://wijmo.com/products/wijmo-5/") Wijmo + li + a(class="text-body" href="https://angular-ui.github.io/bootstrap/") Bootstrap UI + li + a(class="text-body" href="https://vaadin.com/home") Vaadin + + h3 Cross-Platform Development + ul + li + a(class="text-body" href="https://github.com/NativeScript/nativescript-angular") NativeScript + li + a(class="text-body" href="http://angular.github.io/react-native-renderer/") React Native + li + a(class="text-body" href="http://ionicframework.com/docs/v2/") Ionic + li + a(class="text-body" href="http://github.com/angular/angular-electron") Electron + li + a(class="text-body" href="http://github.com/preboot/angular2-universal-windows-app") Windows (UWP) + + + + + + diff --git a/public/training.jade b/public/training.jade new file mode 100644 index 0000000000..efe6863ece --- /dev/null +++ b/public/training.jade @@ -0,0 +1,48 @@ +div(class="resources") + p(class="text-body") Would you like to be listed in this page? Fill out this form. + + h3 Rangle.io + ul(class="publisher") + li(class="course") + a(class="title text-body" href="http://rangle.io/services/javascript-training/training-angular1-angular2-with-ngupgrade/") Angular 2 Online Training + + h3 Pluralsight + ul(class="publisher") + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-first-look") Angular 2: First Look + li(class="course") + a(class="title text-body" href="https://www.pluralsight.com/courses/angular-2-getting-started") Angular 2: Getting Started + + h3 Udemy + ul(class="publisher") + li + a(class="title text-body" href="https://www.udemy.com/the-complete-guide-to-angular-2/?utm_content=_._ag_angular%202_._ad_47395956109_._de_c_._dm__._lo_9061189_._&matchtype=b&gclid=CjwKEAjww9O3BRDp1tq0jIP023YSJAB0-j1S4bFN4tudrjzZO_-ABNAfFQJrhrKo7KX1AnV-8yjV-hoCRrDw_wcB&utm_medium=udemyads&k_clickid=dce13cd7-9844-44dc-9967-020275b637c9_408_GOOGLE_NEW-AW-PROS-TECH-Dev-angular-2-EN-ENG_._ci_756150_._sl_ENG_._vi_TECH_._sd_All_._la_EN_.__angular%202_%2Bangular%20%2B2_b_47395956109_c&utm_campaign=NEW-AW-PROS-TECH-Dev-angular-2-EN-ENG_._ci_756150_._sl_ENG_._vi_TECH_._sd_All_._la_EN_._&utm_source=adwords&utm_term=_._pl__._pd__._ti_kwd-68757357257_._kw_%2Bangular%20%2B2_._&pmtag=72bf13dc-329c-411c-b381-a6143735b9dc") The Complete Guide to Angular 2 + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 With TypeScript for Beginners + li + a(class="title text-body" href="https://www.udemy.com/angular-2-tutorial-for-beginners/") Angular 2 Jumpstart with Typescript + li + a(class="title text-body" href="https://www.udemy.com/angular-2-fundamentals/") Angular 2 Fundamentals + li + a(class="title text-body" href="https://www.udemy.com/angular-2-master-class-with-alejandro-rangel/") Angular 2 Master Class + li + a(class="title text-body" href="https://www.udemy.com/introduction-to-angular2/") Angular 2 Demystified + + h3 egghead.io + ul(class="publisher") + li + a(class="title text-body" href="https://egghead.io/technologies/angular2") Angular 2 videos + + h3 Workshops & Onsite Training Vendors + ul(class="publisher") + li + a(class="title text-body" href="http://rangle.io/services/javascript-training/angular2-training/") Rangle.io + li + a(class="title text-body" href="http://oasisdigital.com/training") Oasis Digital + li + a(class="title text-body" href="http://thoughtram.io/") Thoughtram + + + + + diff --git a/tools/api-builder/angular.io-package/index.js b/tools/api-builder/angular.io-package/index.js index 827d31a22c..add8a222d1 100644 --- a/tools/api-builder/angular.io-package/index.js +++ b/tools/api-builder/angular.io-package/index.js @@ -7,7 +7,7 @@ var cheatsheetPackage = require('../cheatsheet-package'); var PROJECT_PATH = path.resolve(__dirname, "../../.."); var PUBLIC_PATH = path.resolve(PROJECT_PATH, 'public'); var DOCS_PATH = path.resolve(PUBLIC_PATH, 'docs'); -var ANGULAR2_DOCS_PATH = path.resolve(__dirname, '../../../../angular/modules/angular2/docs'); +var ANGULAR2_DOCS_PATH = path.resolve(__dirname, '../../../../angular/modules/@angular/docs'); module.exports = new Package('angular.io', [basePackage, targetPackage, cheatsheetPackage]) @@ -41,18 +41,23 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe .config(function(readTypeScriptModules, writeFilesProcessor, readFilesProcessor) { readTypeScriptModules.sourceFiles = [ - 'angular2/animate.ts', - 'angular2/common.ts', - 'angular2/compiler.ts', - 'angular2/core.ts', - 'angular2/http.ts', - 'angular2/http/testing.ts', - 'angular2/instrumentation.ts', - 'angular2/platform/browser.ts', - 'angular2/router.ts', - 'angular2/router/testing.ts', - 'angular2/upgrade.ts', - 'angular2/testing.ts' + '@angular/common/index.ts', + '@angular/common/testing.ts', + '@angular/compiler/index.ts', + '@angular/compiler/testing.ts', + '@angular/core/index.ts', + '@angular/core/testing.ts', + '@angular/http/index.ts', + '@angular/http/testing.ts', + '@angular/platform-browser/index.ts', + '@angular/platform-browser/testing.ts', + '@angular/platform-browser-dynamic/index.ts', + '@angular/platform-browser-dynamic/testing.ts', + '@angular/platform-server/index.ts', + '@angular/platform-server/testing.ts', + '@angular/router/index.ts', + '@angular/router-deprecated/index.ts', + '@angular/upgrade/index.ts', ]; readTypeScriptModules.hidePrivateMembers = true; @@ -79,7 +84,7 @@ module.exports = new Package('angular.io', [basePackage, targetPackage, cheatshe computePathsProcessor.pathTemplates.push({ docTypes: ['module'], getPath: function computeModulePath(doc) { - doc.moduleFolder = doc.id.replace(/^angular2\//, ''); + doc.moduleFolder = doc.id.replace(/^@angular\//, ''); return doc.moduleFolder + '/index.html'; }, getOutputPath: function computeModulePath(doc) { diff --git a/tools/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html index 9e3092f3d0..7390604888 100644 --- a/tools/api-builder/angular.io-package/templates/class.template.html +++ b/tools/api-builder/angular.io-package/templates/class.template.html @@ -5,7 +5,7 @@ {% block body %} include {$ relativePath(doc.path, '_util-fns') $} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") What it does div(flex="80" flex-xs="100") @@ -16,7 +16,7 @@ include {$ relativePath(doc.path, '_util-fns') $} *Not yet documented* {% endif %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") How to use div(flex="80" flex-xs="100") @@ -27,11 +27,11 @@ include {$ relativePath(doc.path, '_util-fns') $} *Not yet documented* {% endif %} -.div(class="row-margin" layout="row" layout-xs="column") +.div(layout="row" layout-xs="column" class="ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Class Overview div(flex="80" flex-xs="100") - code(class="no-bg api-doc-code") class {$ doc.name $} { + code(class="no-bg api-doc-code openParens") class {$ doc.name $} { {% if doc.statics.length %} .div(layout="column") @@ -58,24 +58,22 @@ include {$ relativePath(doc.path, '_util-fns') $} code(class="api-doc-code") {$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} {% endif %}{% endfor %} {% endif %} - p.selector + p(class="selector endParens") code(class="api-doc-code no-bg") } {% block additional %} {% endblock %} -.div(class="row-margin" layout="row" layout-xs="column") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Class Description div(class="code-links" flex="80" flex-xs="100") :marked {%- if doc.description.length > 2 %} {$ doc.description | indentForMarkdown(6) | trimBlankLines $} - {% else %} - *Not yet documented* {% endif %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Class Export div(flex="80" flex-xs="100") @@ -85,7 +83,7 @@ include {$ relativePath(doc.path, '_util-fns') $} {%- if doc.decorators.length %} {% block annotations %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Annotations div(flex="80" flex-xs="100") @@ -94,9 +92,7 @@ include {$ relativePath(doc.path, '_util-fns') $} code(class="api-doc-code") @{$ decorator.name $}{$ paramList(decorator.arguments) | indent(10, false) $} :marked - {%- if decorator.notYetDocumented %} - *Not yet documented* - {% else %} + {%- if not decorator.notYetDocumented %} {$ decorator.description | indentForMarkdown(8) | trimBlankLines $} {% endif %} {% endfor %} @@ -104,7 +100,7 @@ include {$ relativePath(doc.path, '_util-fns') $} {% endif %} {%- if doc.constructorDoc and not doc.constructorDoc.internal %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Constructor div(flex="80" flex-xs="100") @@ -113,15 +109,13 @@ include {$ relativePath(doc.path, '_util-fns') $} code(class="api-doc-code"). {$ doc.constructorDoc.name $}{$ paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $} :marked - {%- if doc.constructorDoc.notYetDocumented %} - *Not yet documented* - {% else %} + {%- if not doc.constructorDoc.notYetDocumented %} {$ doc.constructorDoc.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} {% endif %} {% endif %} {% if doc.statics.length %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Static Members div(class="code-links" flex="80" flex-xs="100") @@ -131,9 +125,7 @@ include {$ relativePath(doc.path, '_util-fns') $} code(class="api-doc-code"). {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} :marked - {%- if member.notYetDocumented %} - *Not yet documented* - {% else %} + {%- if not member.notYetDocumented %} {$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} {% endif %} @@ -145,10 +137,10 @@ include {$ relativePath(doc.path, '_util-fns') $} {% endif %} {% if doc.members.length %} -.div(layout="row" layout-xs="column" class="instance-members" class="row-margin") +.div(layout="row" layout-xs="column" class="instance-members" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Class Details - div(flex="80" flex-xs="100") + div(class="code-links" flex="80" flex-xs="100") {% for member in doc.members %}{% if not member.internal %} a(name="{$ member.name $}-anchor" class="anchor-offset") pre(class="prettyprint no-bg" ng-class="{ 'anchor-focused': appCtrl.isApiDocMemberFocused('{$ member.name $}') }") @@ -156,9 +148,7 @@ include {$ relativePath(doc.path, '_util-fns') $} {$ member.name $}{$ paramList(member.parameters) | indent(8, false) | trim $}{$ returnType(member.returnType) $} :marked - {%- if member.notYetDocumented %} - *Not yet documented* - {% else %} + {%- if not member.notYetDocumented %} {$ member.description | indentForMarkdown(6) | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines $} {% endif -%} diff --git a/tools/api-builder/angular.io-package/templates/decorator.template.html b/tools/api-builder/angular.io-package/templates/decorator.template.html index 597de1783e..6d449814cf 100644 --- a/tools/api-builder/angular.io-package/templates/decorator.template.html +++ b/tools/api-builder/angular.io-package/templates/decorator.template.html @@ -4,20 +4,20 @@ {% block body %} include {$ relativePath(doc.path, '_util-fns') $} -.l-main-section - h2(class="decorator export") - pre.prettyprint + +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Variable Export + div(class="code-links" flex="80" flex-xs="100") + pre.prettyprint.no-bg code. export {$ doc.name $}(options : {@link {$ doc.decoratorType $} {$ doc.decoratorType | escape $}}){$ returnType(doc.returnType) $} + :marked + {%- if not doc.notYetDocumented %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} - p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} +p.location-badge. + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} - :marked -{%- if doc.notYetDocumented %} - *Not yet documented* -{% else %} -{$ doc.description | indentForMarkdown(4) | trimBlankLines $} -{% endif -%} {% endblock %} diff --git a/tools/api-builder/angular.io-package/templates/directive.template.html b/tools/api-builder/angular.io-package/templates/directive.template.html index 3602a50e54..9e8ab62766 100644 --- a/tools/api-builder/angular.io-package/templates/directive.template.html +++ b/tools/api-builder/angular.io-package/templates/directive.template.html @@ -8,7 +8,7 @@ {% block additional -%} {%- if doc.directiveOptions.selector.split(',').length %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Selectors div(flex="80" flex-xs="100") @@ -19,7 +19,7 @@ {% endif %} {% if doc.outputs %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Outputs div(flex="80" flex-xs="100") @@ -34,7 +34,7 @@ {% endif %} {% if doc.inputs %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Inputs div(flex="80" flex-xs="100") @@ -49,7 +49,7 @@ {% endif %} {%- if doc.directiveOptions.exportAs %} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Exported as div(flex="80" flex-xs="100") diff --git a/tools/api-builder/angular.io-package/templates/function.template.html b/tools/api-builder/angular.io-package/templates/function.template.html index d02983310b..00e29907de 100644 --- a/tools/api-builder/angular.io-package/templates/function.template.html +++ b/tools/api-builder/angular.io-package/templates/function.template.html @@ -4,20 +4,20 @@ {% block body %} include {$ relativePath(doc.path, '_util-fns') $} -.l-main-section - h2(class="function export") - pre.prettyprint + +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") + div(flex="20" flex-xs="100") + h2(class="h2-api-docs") Class Export + div(class="code-links" flex="80" flex-xs="100") + pre.prettyprint.no-bg code. export {$ doc.name $}{$ paramList(doc.parameters) | indent(8, true) | trim $}{$ returnType(doc.returnType) $} + :marked + {%- if not doc.notYetDocumented %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} - p.location-badge. - exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } - defined in {$ githubViewLink(doc) $} +p.location-badge. + exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} - :marked -{%- if doc.notYetDocumented %} - *Not Yet Documented* -{% else %} -{$ doc.description | indentForMarkdown(4) | trimBlankLines $} -{% endif %} {% endblock %} \ No newline at end of file diff --git a/tools/api-builder/angular.io-package/templates/var.template.html b/tools/api-builder/angular.io-package/templates/var.template.html index 19c1b8789a..51a8056352 100644 --- a/tools/api-builder/angular.io-package/templates/var.template.html +++ b/tools/api-builder/angular.io-package/templates/var.template.html @@ -5,22 +5,20 @@ {% block body %} include {$ relativePath(doc.path, '_util-fns') $} -.div(layout="row" layout-xs="column" class="row-margin") +.div(layout="row" layout-xs="column" class="row-margin ng-cloak") div(flex="20" flex-xs="100") h2(class="h2-api-docs") Variable Export - div(flex="80" flex-xs="100") + div(class="code-links" flex="80" flex-xs="100") pre.prettyprint.no-bg code. - export {$ doc.name $}{$ returnType(doc.returnType) $} + export {$ doc.name $} + :marked + {%- if not doc.notYetDocumented %} +{$ doc.description | indentForMarkdown(6) | trimBlankLines $} + {% endif %} p.location-badge. exported from {@link {$ doc.moduleDoc.id $} {$doc.moduleDoc.id $} } defined in {$ githubViewLink(doc) $} -:marked -{%- if doc.notYetDocumented %} - *Not Yet Documented* -{% else %} -{$ doc.description | indentForMarkdown(2) | trimBlankLines $} -{% endif -%} {% endblock %} diff --git a/tools/api-builder/docs-package/processors/addNotYetDocumentedProperty.js b/tools/api-builder/docs-package/processors/addNotYetDocumentedProperty.js index 67d7762a85..ed3b29b22b 100644 --- a/tools/api-builder/docs-package/processors/addNotYetDocumentedProperty.js +++ b/tools/api-builder/docs-package/processors/addNotYetDocumentedProperty.js @@ -23,6 +23,7 @@ module.exports = function addNotYetDocumentedProperty(EXPORT_DOC_TYPES, log, cre } if (doc.notYetDocumented) { + // TODO: (ericjim) should I remove this? log.warn(createDocMessage("Not yet documented", doc)); } }); diff --git a/tools/api-builder/typescript-package/processors/readTypeScriptModules.js b/tools/api-builder/typescript-package/processors/readTypeScriptModules.js index 910b28d2dd..a1bfb0c207 100644 --- a/tools/api-builder/typescript-package/processors/readTypeScriptModules.js +++ b/tools/api-builder/typescript-package/processors/readTypeScriptModules.js @@ -27,7 +27,7 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo, // We leave class members sorted in order of declaration sortClassMembers: false, // We can provide a collection of strings or regexes to ignore exports whose export names match - ignoreExportsMatching: ['___esModule'], + ignoreExportsMatching: ['___esModule', '___core_private_types__', '___platform_browser_private__', '___compiler_private__', '__core_private__'], $process: function(docs) { diff --git a/tools/plunker-builder/indexHtmlTranslator.js b/tools/plunker-builder/indexHtmlTranslator.js index c40182adde..35212df309 100644 --- a/tools/plunker-builder/indexHtmlTranslator.js +++ b/tools/plunker-builder/indexHtmlTranslator.js @@ -7,6 +7,10 @@ var _rxRules = { from: //, to: '' }, + angular_pkg: { + from: /src=".?node_modules\/@angular/g, + to: 'src="https://npmcdn.com/@angular' + }, script: { from: /.*<\/script>/, to: '' @@ -33,80 +37,41 @@ var _rxData = [ }, { pattern: 'script', - from: 'node_modules/systemjs/dist/system.src.js', - //to: ['https://code.angularjs.org/tools/system.js', 'https://code.angularjs.org/tools/typescript.js'] - //to: ['https://code.angularjs.org/tools/system.js', 'https://npmcdn.com/typescript@1.8.10/lib/typescript.js'] - to: ['https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system.js', 'https://npmcdn.com/typescript@1.8.10/lib/typescript.js'] + from: 'node_modules/es6-shim/es6-shim.min.js', + to: 'https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js' }, { pattern: 'script', - from: 'node_modules/angular2/bundles/angular2.dev.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js' + from: 'node_modules/zone.js/dist/zone.js', + to: 'https://npmcdn.com/zone.js@0.6.12' }, { pattern: 'script', - from: 'node_modules/angular2/bundles/angular2-all.umd.dev.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/angular2-all.umd.dev.js' - }, - { - pattern: 'script', - from: 'node_modules/angular2/bundles/angular2-all.umd.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/angular2-all.umd.dev.js' - }, - { - pattern: 'script', - from: 'node_modules/angular2/bundles/angular2-polyfills.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js' - }, - { - pattern: 'script', - from: 'node_modules/rxjs/bundles/Rx.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/Rx.js' + from: 'node_modules/reflect-metadata/Reflect.js', + to: 'https://npmcdn.com/reflect-metadata@0.1.3' }, { pattern: 'script', from: 'node_modules/rxjs/bundles/Rx.umd.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/Rx.umd.js' + to: 'https://npmcdn.com/rxjs@5.0.0-beta.6/bundles/Rx.umd.js' }, { pattern: 'script', - from: 'node_modules/angular2/bundles/router.dev.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/router.dev.js' + from: 'node_modules/systemjs/dist/system.src.js', + to: ['https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.27/system.js', 'https://npmcdn.com/typescript@1.8.10/lib/typescript.js'] }, { pattern: 'script', - from: 'node_modules/angular2/bundles/http.dev.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/http.dev.js' - }, - { - pattern: 'script', - from: 'node_modules/angular2/bundles/testing.dev.js', - to: 'https://code.angularjs.org/2.0.0-beta.15/testing.dev.js' - }, - { - pattern: 'script', - from: 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js', - to: 'https://npmcdn.com/angular2@2.0.0-beta.15/es6/dev/src/testing/shims_for_IE.js' - }, - { - pattern: 'script', - from: 'node_modules/es6-shim/es6-shim.min.js', - to: 'https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js' - }, - { - pattern: 'script', - from: 'node_modules/systemjs/dist/system-polyfills.js', - to: 'https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js' - }, - { - pattern: 'script', - from: 'node_modules/a2-in-memory-web-api/web-api.js', - to: 'https://npmcdn.com/a2-in-memory-web-api/web-api.js' + from: 'node_modules/angular/in-memory-web-api/web-api.js', + to: 'https://npmcdn.com/angular/in-memory-web-api/web-api.js' }, { pattern: 'link', from: 'node_modules/bootstrap/dist/css/bootstrap.min.css', - to: 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css' + to: 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css' + }, + { + pattern: 'angular_pkg', }, { pattern: 'config', diff --git a/tools/plunker-builder/plunkerBuilder.js b/tools/plunker-builder/plunkerBuilder.js index bf784f1e32..b2bf2c79d3 100644 --- a/tools/plunker-builder/plunkerBuilder.js +++ b/tools/plunker-builder/plunkerBuilder.js @@ -10,6 +10,7 @@ var mkdirp = require('mkdirp'); var indexHtmlTranslator = require('./indexHtmlTranslator'); var regionExtractor = require('../doc-shredder/regionExtractor'); var COPYRIGHT, COPYRIGHT_JS, COPYRIGHT_HTML; +var SYSTEM_JS_CONFIG; // content of systemjs.config.js for plunkers that use systemjs module.exports = { buildPlunkers: buildPlunkers @@ -27,6 +28,7 @@ function buildCopyrightStrings() { } function buildPlunkers(basePath, destPath, options) { + getSystemJsConfigPlunker(basePath); var errFn = options.errFn || function(e) { console.log(e); }; var configExtns = ['plnkr.json', '*plnkr.json']; var gpaths = configExtns.map(function(extn) { @@ -58,6 +60,7 @@ function buildPlunkerFrom(configFileName, basePath, destPath ) { try { var config = initConfigAndCollectFileNames(configFileName); var postData = createPostData(config); + addSystemJsConfig(config, postData); var html = createPlunkerHtml(postData); fs.writeFileSync(outputFileName, html, 'utf-8'); if (altFileName) { @@ -79,6 +82,20 @@ function buildPlunkerFrom(configFileName, basePath, destPath ) { } } +function addSystemJsConfig(config, postData){ + if (config.basePath.indexOf('/ts') > -1) { + // uses systemjs.config.js so add plunker version + var relativeFileName = 'systemjs.config.js'; + postData['files[' + relativeFileName + ']'] = SYSTEM_JS_CONFIG; + } +} + +function getSystemJsConfigPlunker(basePath) { + // Assume plunker version is sibling of node_modules version + SYSTEM_JS_CONFIG = fs.readFileSync(basePath + '/systemjs.config.plunker.js', 'utf-8'); + SYSTEM_JS_CONFIG += COPYRIGHT_JS_CSS; +} + function initConfigAndCollectFileNames(configFileName) { var basePath = path.dirname(configFileName); var configSrc = fs.readFileSync(configFileName, 'utf-8'); @@ -106,6 +123,7 @@ function initConfigAndCollectFileNames(configFileName) { return path.join(basePath, fileName); } }); + // var defaultExcludes = [ '!**/node_modules/**','!**/typings/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ]; var defaultExcludes = [ '!**/typings/**', @@ -116,12 +134,14 @@ function initConfigAndCollectFileNames(configFileName) { '!**/example-config.json', '!**/*.spec.*', '!**/tslint.json', - '!**/.editorconfig' + '!**/.editorconfig', + '!**/systemjs.config.js', ]; Array.prototype.push.apply(gpaths, defaultExcludes); config.fileNames = globby.sync(gpaths, { ignore: ["**/node_modules/**"] }); config.basePath = basePath; + return config; } @@ -196,7 +216,6 @@ function encodeBase64(file) { return new Buffer(bitmap).toString('base64'); } - function createPlunkerHtml(postData) { useNewWindow = false; var baseHtml = createBasePlunkerHtml(useNewWindow); @@ -208,9 +227,11 @@ function createPlunkerHtml(postData) { form.appendChild(ele) }); var html = doc.documentElement.outerHTML; + return html; } + function createBasePlunkerHtml(useNewWindow) { var url = 'http://plnkr.co/edit/?p=preview'; // If the form posts to target="_blank", pop-up blockers can cause it not to work. diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000000..490c4bd51d --- /dev/null +++ b/tslint.json @@ -0,0 +1,107 @@ +{ + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-unreachable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + + "directive-selector-name": [true, "camelCase"], + "component-selector-name": [true, "kebab-case"], + "directive-selector-type": [true, "attribute"], + "component-selector-type": [true, "element"], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } +}