diff --git a/public/docs/_examples/styleguide/js/app.js b/public/docs/_examples/styleguide/js/app.js index a590cd7ed7..7ac0466c2c 100644 --- a/public/docs/_examples/styleguide/js/app.js +++ b/public/docs/_examples/styleguide/js/app.js @@ -4,11 +4,9 @@ var AppComponent = ng // #docregion component .Component({ - selector: 'my-app' - }) + selector: 'my-app', // #enddocregion // #docregion view - .View({ template: '

My First Angular 2 App

' }) // #enddocregion diff --git a/public/docs/_examples/styleguide/js/index.html b/public/docs/_examples/styleguide/js/index.html index 789b38144a..27c8930e59 100644 --- a/public/docs/_examples/styleguide/js/index.html +++ b/public/docs/_examples/styleguide/js/index.html @@ -6,9 +6,19 @@ - - + + + + + + + + + + foo2 diff --git a/public/docs/_examples/styleguide/ts/app.ts b/public/docs/_examples/styleguide/ts/app.ts index e6d0d92e49..68eb2b4348 100644 --- a/public/docs/_examples/styleguide/ts/app.ts +++ b/public/docs/_examples/styleguide/ts/app.ts @@ -1,13 +1,13 @@ // #docregion // #docregion import -import {Component, View, bootstrap} from '@angular/angular2'; +import { Component } from '@angular/core'; +import { bootstrap } from '@angular/platform-browser-dynamic'; + // #enddocregion // #docregion class-w-annotations @Component({ - selector: 'my-app' -}) -@View({ + selector: 'my-app', template: '

My First Angular 2 App

' }) // #docregion class @@ -18,4 +18,4 @@ class AppComponent { } // #docregion bootstrap bootstrap(AppComponent); // #enddocregion -// #enddocregion \ No newline at end of file +// #enddocregion diff --git a/public/docs/_includes/styleguide/_code-examples.jade b/public/docs/_includes/styleguide/_code-examples.jade index 47dbb56c1b..102b7694c1 100644 --- a/public/docs/_includes/styleguide/_code-examples.jade +++ b/public/docs/_includes/styleguide/_code-examples.jade @@ -113,11 +113,9 @@ include ../../../_includes/_util-fns var AppComponent = ng // #docregion component .Component({ - selector: 'my-app' - }) + selector: 'my-app', // #enddocregion component // #docregion view - .View({ template: '

My First Angular 2 App

' }) // #enddocregion view @@ -139,13 +137,13 @@ include ../../../_includes/_util-fns // #docplaster more code here // #docregion import,twoparts - import {Component, View, bootstrap} from 'angular2/angular2'; + import { Component } from '@angular/core'; + import { bootstrap } from '@angular/platform-browser-dynamic'; + // #enddocregion twoparts, import @Component({ - selector: 'my-app' - }) - @View({ - template: '

My first Angular 2 App

' + selector: 'my-app', + template: '

My first Angular 2 App

' }) class AppComponent { } diff --git a/public/docs/ts/latest/guide/typescript-configuration.jade b/public/docs/ts/latest/guide/typescript-configuration.jade index affa2b2928..a2454e98ce 100644 --- a/public/docs/ts/latest/guide/typescript-configuration.jade +++ b/public/docs/ts/latest/guide/typescript-configuration.jade @@ -76,7 +76,7 @@ a(id="typings") Many libraries include their definition files in their npm packages where both the TypeScript compiler and editors can find them. Angular is one such library. - Peek into the `node_modules/angular2/` folder of any Angular application to see several `...d.ts` files that describe parts of Angular. + Peek into the `node_modules/@angular/core/` folder of any Angular application to see several `...d.ts` files that describe parts of Angular. **We need do nothing to get *typings* files for library packages which include *d.ts* files — as all Angular packages do.** @@ -121,7 +121,7 @@ code-example(format=""). The following command installs the typings file for the Jasmine test library and updates the `typings.config` so we that we get it automatically the next time. code-example(format=""). - npm run typings -- install jasmine --ambient --save + npm run typings -- install jasmine --global --save .l-sub-section :marked The [–– option](https://docs.npmjs.com/cli/run-script) is important; @@ -129,43 +129,3 @@ code-example(format=""). Learn about the features of the *typings* tool at its [site on github](https://github.com/typings/typings/blob/master/README.md). -:marked - ### Typing file collisions - - The TypeScript compiler does not tolerate redefinition of a type. For example, it throws an error if it's given two definitions for - the `Promise` type. - - Double definitions are common. In fact, the `typings` tool deliberately creates - duplicate sets of typings (for reasons best explained elsewhere). - Look in the project structure for the *typings folder* where we should find something like: -.filetree - .file typings - .children - .file browser - .children - .file ambient - .children - .file core-js - .children - .file index.d.ts - .file ... - - .children - .file main - .children - .file ambient - .children - .file core-js - .children - .file index.d.ts - .file ... - .children - .file browser.d.ts - .file main.d.ts -:marked - The `core-js` typings are duplicated and the `browser.d.ts` and `main.d.ts` have overlapping content. - - We must tell the compiler to ignore one or the other. - We removed the `main` set from consideration in the `exclude` section of our `tsconfig.json` file: -+makeJson('quickstart/ts/tsconfig.1.json', {paths: 'exclude'}, 'tsconfig.json (exclude)')(format=".") -:marked diff --git a/public/docs/ts/latest/guide/upgrade.jade b/public/docs/ts/latest/guide/upgrade.jade index 95ee9314b9..a58d298998 100644 --- a/public/docs/ts/latest/guide/upgrade.jade +++ b/public/docs/ts/latest/guide/upgrade.jade @@ -864,12 +864,12 @@ code-example(format=""). project, which contains metadata about the type definitions we've installed: code-example(format=""). - npm run typings install jquery -- --save --ambient - npm run typings install angular -- --save --ambient - npm run typings install angular-route -- --save --ambient - npm run typings install angular-resource -- --save --ambient - npm run typings install angular-mocks -- --save --ambient - npm run typings install jasmine -- --save --ambient + npm run typings install jquery -- --save --global + npm run typings install angular -- --save --global + npm run typings install angular-route -- --save --global + npm run typings install angular-resource -- --save --global + npm run typings install angular-mocks -- --save --global + npm run typings install jasmine -- --save --global :marked In `index.html`, let's now enable SystemJS. Add a couple of `