Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit a6478bc

Browse files
chalinwardbell
authored andcommitted
docs(attribute-directives): minor updates incl. e2e fix (#3330)
- Prose: copyedits, including fix to misnamed directive class (`MyHighlightDirective` --> `HighlightDirective`). - E2E update to avoid warning of multiple matching elements. - Code: remove obsolete template region. - Remove obsolete Jade blocks (no longer required by Dart). - Replace old Jade syntax with plain markdown. - Remove a few unnecessary `:marked`.
1 parent ffdf5ca commit a6478bc

File tree

8 files changed

+141
-116
lines changed

8 files changed

+141
-116
lines changed

public/docs/_examples/attribute-directives/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Attribute directives', function () {
1515
});
1616

1717
it('should be able to select green highlight', function () {
18-
let highlightedEle = element(by.cssContainingText('p', 'Highlight me'));
18+
let highlightedEle = element(by.cssContainingText('p', 'Highlight me!'));
1919
let lightGreen = 'rgba(144, 238, 144, 1)';
2020

2121
expect(highlightedEle.getCssValue('background-color')).not.toEqual(lightGreen);

public/docs/_examples/attribute-directives/ts/src/app/app.component.1.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
<h1>My First Attribute Directive</h1>
33
<!-- #docregion applied -->
44
<p myHighlight>Highlight me!</p>
5-
<!-- #enddocregion applied -->
6-
<!-- #enddocregion -->
5+
<!-- #enddocregion applied, -->
76

87
<!-- #docregion color-1 -->
98
<p myHighlight highlightColor="yellow">Highlighted in yellow</p>
109
<p myHighlight [highlightColor]="'orange'">Highlighted in orange</p>
11-
1210
<!-- #enddocregion color-1 -->
1311

1412
<!-- #docregion color-2 -->
1513
<p myHighlight [highlightColor]="color">Highlighted with parent component's color</p>
1614
<!-- #enddocregion color-2 -->
17-
18-
<!-- #docregion p-style-background -->
19-
<p [style.background]="'lime'">I am green with envy!</p>
20-
<!-- #enddocregion p-style-background -->

public/docs/_examples/attribute-directives/ts/src/app/app.component.1.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ import { Component } from '@angular/core';
99
export class AppComponent {
1010
color = 'yellow';
1111
}
12-
// #enddocregion class

public/docs/_examples/attribute-directives/ts/src/app/app.component.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<!-- #docregion -->
2-
<!-- #docregion v2 -->
1+
<!-- #docregion v2, -->
32
<h1>My First Attribute Directive</h1>
43

54
<h4>Pick a highlight color</h4>
@@ -10,15 +9,13 @@ <h4>Pick a highlight color</h4>
109
</div>
1110
<!-- #docregion color -->
1211
<p [myHighlight]="color">Highlight me!</p>
13-
<!-- #enddocregion color -->
14-
<!-- #enddocregion v2 -->
12+
<!-- #enddocregion color, v2 -->
1513

1614
<!-- #docregion defaultColor -->
1715
<p [myHighlight]="color" defaultColor="violet">
1816
Highlight me too!
1917
</p>
20-
<!-- #enddocregion defaultColor -->
21-
<!-- #enddocregion -->
18+
<!-- #enddocregion defaultColor, -->
2219

2320
<hr>
2421
<p><i>Mouse over the following lines to see fixed highlights</i></p>

public/docs/_examples/attribute-directives/ts/src/app/app.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ import { Component } from '@angular/core';
1010
export class AppComponent {
1111
color: string;
1212
}
13-
// #enddocregion class
14-
// #enddocregion

public/docs/_examples/attribute-directives/ts/src/app/highlight.directive.2.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ export class HighlightDirective {
1010
// #docregion ctor
1111
constructor(private el: ElementRef) { }
1212
// #enddocregion ctor
13-
// #enddocregion
14-
15-
// #docregion color
16-
@Input() highlightColor: string;
17-
// #enddocregion color
18-
19-
// #docregion color-2
20-
@Input() myHighlight: string;
21-
// #enddocregion color-2
22-
23-
// #docregion
2413

2514
// #docregion mouse-methods, host
2615
@HostListener('mouseenter') onMouseEnter() {
@@ -39,7 +28,14 @@ export class HighlightDirective {
3928
private highlight(color: string) {
4029
this.el.nativeElement.style.backgroundColor = color;
4130
}
42-
// #enddocregion mouse-methods
31+
// #enddocregion mouse-methods,
4332

33+
// #docregion color
34+
@Input() highlightColor: string;
35+
// #enddocregion color
36+
37+
// #docregion color-2
38+
@Input() myHighlight: string;
39+
// #enddocregion color-2
4440
}
45-
// #enddocregion
41+

public/docs/_examples/attribute-directives/ts/src/app/highlight.directive.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* tslint:disable:member-ordering */
2-
// #docplaster
3-
// #docregion
4-
// #docregion imports
2+
// #docregion imports,
53
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
64
// #enddocregion imports
75

0 commit comments

Comments
 (0)