Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a27b4cf

Browse files
gdenniepetebacondarwin
authored andcommitted
docs(guide/directive): clarify use of binding to scopes
The use of 'angular' as sample text is confusing to the newbie in that they are forced to confirm that the text 'angular' is not a keyword or otherwise referring to a system component. This is changed to a more obvious sample text. The most common form of `ngBind` is moved to the top of the list. Closes #4237
1 parent 333e337 commit a27b4cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/content/guide/directive.ngdoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,28 @@ attribute only.)
2727
<!-- directive: my-dir exp -->
2828
</pre>
2929

30-
Directives can be invoked in many different ways, but are equivalent in the end result as shown in
31-
the following example.
30+
The following demonstrates the various ways a Directive (ngBind in this case) can be referenced from within a template.
3231

3332
<doc:example>
3433
<doc:source >
3534
<script>
3635
function Ctrl1($scope) {
37-
$scope.name = 'angular';
36+
$scope.name = 'Max Karl Ernst Ludwig Planck (April 23, 1858 – October 4, 1947)';
3837
}
3938
</script>
4039
<div ng-controller="Ctrl1">
4140
Hello <input ng-model='name'> <hr/>
41+
&lt;span ng-bind="name"&gt; <span ng-bind="name"></span> <br/>
4242
&lt;span ng:bind="name"&gt; <span ng:bind="name"></span> <br/>
4343
&lt;span ng_bind="name"&gt; <span ng_bind="name"></span> <br/>
44-
&lt;span ng-bind="name"&gt; <span ng-bind="name"></span> <br/>
4544
&lt;span data-ng-bind="name"&gt; <span data-ng-bind="name"></span> <br/>
4645
&lt;span x-ng-bind="name"&gt; <span x-ng-bind="name"></span> <br/>
4746
</div>
4847
</doc:source>
4948
<doc:scenario>
5049
it('should show off bindings', function() {
51-
expect(element('div[ng-controller="Ctrl1"] span[ng-bind]').text()).toBe('angular');
50+
expect(element('div[ng-controller="Ctrl1"] span[ng-bind]').text())
51+
.toBe('Max Karl Ernst Ludwig Planck (April 23, 1858 – October 4, 1947)');
5252
});
5353
</doc:scenario>
5454
</doc:example>

0 commit comments

Comments
 (0)