From fc256f60d95e6016418e4998569365a7fb0004ad Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 9 Mar 2017 07:47:36 -0800 Subject: [PATCH 1/3] docs(structural-directives): copyedits and some tweaks to code - Fix variable name `li` --> `i` - a --> an `UnlessDirective` - Jade had both #ngswitch and #ngSwitch as link targets; fixed to use same capitalization as template syntax page. - Fixed broke fragment target (was missing #) - Other copy edits and post-review comments from @wardbell --- .../ts/src/app/app.component.html | 12 +- .../ts/src/app/unless.directive.ts | 8 +- .../docs/ts/latest/guide/displaying-data.jade | 2 +- .../latest/guide/structural-directives.jade | 187 +++++++++++------- 4 files changed, 119 insertions(+), 90 deletions(-) diff --git a/public/docs/_examples/structural-directives/ts/src/app/app.component.html b/public/docs/_examples/structural-directives/ts/src/app/app.component.html index 2758553e39..309d2bb5f7 100644 --- a/public/docs/_examples/structural-directives/ts/src/app/app.component.html +++ b/public/docs/_examples/structural-directives/ts/src/app/app.component.html @@ -38,11 +38,11 @@

NgIf

- Expression sets display to "block"" . + Expression sets display to "block". This paragraph is visible.

- Expression sets display to "none" . + Expression sets display to "none". This paragraph is hidden but still in the DOM.

@@ -152,11 +152,9 @@

NgSwitch

Pick your favorite hero

- - - +

diff --git a/public/docs/_examples/structural-directives/ts/src/app/unless.directive.ts b/public/docs/_examples/structural-directives/ts/src/app/unless.directive.ts index 19d48b4453..470bbd932f 100644 --- a/public/docs/_examples/structural-directives/ts/src/app/unless.directive.ts +++ b/public/docs/_examples/structural-directives/ts/src/app/unless.directive.ts @@ -1,7 +1,6 @@ // #docplaster // #docregion -// #docregion no-docs -// #docregion skeleton +// #docregion no-docs, skeleton import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; // #enddocregion skeleton @@ -18,7 +17,7 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; * * * ### Syntax - * * + * * - `
...
` * - `
...
` * - `` @@ -50,6 +49,3 @@ export class UnlessDirective { // #enddocregion set // #docregion skeleton } -// #enddocregion skeleton -// #enddocregion no-docs -// #enddocregion diff --git a/public/docs/ts/latest/guide/displaying-data.jade b/public/docs/ts/latest/guide/displaying-data.jade index b32c0ec8f5..6584a1d170 100644 --- a/public/docs/ts/latest/guide/displaying-data.jade +++ b/public/docs/ts/latest/guide/displaying-data.jade @@ -147,7 +147,7 @@ figure.image-display :marked Notice the `hero` in the `ngFor` double-quoted instruction; it is an example of a template input variable. Read - more about template input variables in the [microsyntax](./template-syntax.html#ngForMicrosyntax) section of + more about template input variables in the [microsyntax](./template-syntax.html#microsyntax) section of the [Template Syntax](./template-syntax.html) page. Angular duplicates the `
  • ` for each item in the list, setting the `hero` variable diff --git a/public/docs/ts/latest/guide/structural-directives.jade b/public/docs/ts/latest/guide/structural-directives.jade index 45680e44e3..bd5ebbccf7 100644 --- a/public/docs/ts/latest/guide/structural-directives.jade +++ b/public/docs/ts/latest/guide/structural-directives.jade @@ -1,7 +1,7 @@ block includes include ../_util-fns -// The docs standard h4 style uppercases, making code terms unreadable. Override it. +//- The docs standard h4 style uppercases, making code terms unreadable. Override it. style. h4 {font-size: 17px !important; text-transform: none !important;} .syntax { font-family: Consolas, 'Lucida Sans', Courier, sans-serif; color: black; font-size: 85%; } @@ -15,13 +15,13 @@ style. - [What are structural directives?](#definition) - [*NgIf* case study](#ngIf) - [Group sibling elements with <ng-container>](#ng-container) - - [The asterisk (\*) prefix](#asterisk) - - [Inside *NgFor*](#ngfor) + - [The asterisk (*) prefix](#asterisk) + - [Inside *NgFor*](#ngFor) - [microsyntax](#microsyntax) - [template input variables](#template-input-variable) - [one structural directive per element](#one-per-element) - [Inside the *NgSwitch* directives](#ngSwitch) - - [Prefer the (\*) prefix](#prefer-asterisk) + - [Prefer the (*) prefix](#prefer-asterisk) - [The <template> element](#template) - [Write a structural directive](#unless) @@ -40,13 +40,16 @@ a#definition The directive then does whatever it's supposed to do with that host element and its descendents. Structural directives are easy to recognize. - An asterisk (\*) precedes the directive attribute name as in this example. -+makeExample('structural-directives/ts/src/app/app.component.html', 'ngif')(format=".") + An asterisk (*) precedes the directive attribute name as in this example. + ++makeExcerpt('src/app/app.component.html', 'ngif', '') + :marked No brackets. No parentheses. Just `*ngIf` set to a string. - You'll learn in this guide that the [asterisk (\*) is a convenience notation](#asterisk) - and the string is a [_microsyntax_](#microsyntax) rather than the usual [template expression](template-syntax.html#template-expressions). + You'll learn in this guide that the [asterisk (*) is a convenience notation](#asterisk) + and the string is a [_microsyntax_](#microsyntax) rather than the usual + [template expression](template-syntax.html#template-expressions). Angular "de-sugars" this notation into a marked-up `