X Tutup
Skip to content

Commit 63be222

Browse files
committed
docs(input): Fix some broken links, add missing $, use ng- in examples
1 parent a29c2cf commit 63be222

File tree

8 files changed

+70
-70
lines changed

8 files changed

+70
-70
lines changed

docs/content/api/angular.module.ng.$compileProvider.directive.ngdoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ To understand this, lets look at a real world example with repeater:
115115
<pre>
116116
Hello {{user}}, you have these actions:
117117
<ul>
118-
<li ng:repeat="action in user.actions">
118+
<li ng-repeat="action in user.actions">
119119
{{action.description}}
120120
</li>
121121
</ul>
@@ -126,8 +126,8 @@ a change in DOM structure such as in repeaters.
126126

127127
When the above example is compiled, the compiler visits every node and looks for directives. The
128128
`{{user}}` is an example of {@link angular.module.ng.$interpolate interpolation} directive. {@link
129-
angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} is another directive. But {@link
130-
angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} has a dilemma. It needs to be
129+
angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} is another directive. But {@link
130+
angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} has a dilemma. It needs to be
131131
able to quickly stamp out new `li`s for every `action` in `user.actions`. This means that it needs
132132
to save a clean copy of the `li` element for cloning purposes and as new `action`s are inserted,
133133
the template `li` element needs to be cloned and inserted into `ul`. But cloning the `li` element
@@ -143,12 +143,12 @@ the directives are identified and sorted by priority, and a linking phase where
143143
links a specific instance of the {@link angular.module.ng.$rootScope.Scope scope} and the specific
144144
instance of an `li` is performed.
145145

146-
{@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} works by preventing the
146+
{@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} works by preventing the
147147
compilation process form descending into `li` element. Instead the {@link
148-
angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} directive compiles `li`
148+
angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} directive compiles `li`
149149
seperatly. The result of of the `li` element compilation is a linking function which contains all
150150
of the directives contained in the `li` element ready to be attached to a specific clone of `li`
151-
element. At runtime the {@link angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat}
151+
element. At runtime the {@link angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat}
152152
watches the expression and as items are added to the array it clones the `li` element, creates a
153153
new {@link angular.module.ng.$rootScope.Scope scope} for the cloned `li` element and calls the
154154
link function on the cloned `li`.
@@ -415,8 +415,8 @@ compiler}. The attributes are:
415415
append the template to the element.
416416

417417
* `transclude` - compile the content of the element and make it available to the directive.
418-
Typically used with {@link api/angular.module.ng.$compileProvider.directive.ng:transclude
419-
ng:transclude}. The advantage of transclusion is that the linking function receives a
418+
Typically used with {@link api/angular.module.ng.$compileProvider.directive.ng-transclude
419+
ng-transclude}. The advantage of transclusion is that the linking function receives a
420420
transclusion function which is pre-bound to the correct scope. In a typical setup the widget
421421
creates an `isolate` scope, but the transclusion is not a child, but a sibling of the `isolate`
422422
scope. This makes it possible for the widget to have private state, and the transclusion to
@@ -440,8 +440,8 @@ compiler}. The attributes are:
440440
Compile function deals with transforming the template DOM. Since most directives do not do
441441
template transformation, it is not used often. Examples which require compile functions are
442442
directives which transform template DOM such as {@link
443-
angular.module.ng.$compileProvider.directive.ng:repeat ng:repeat} or load the contents
444-
asynchronously such as {@link angular.module.ng.$compileProvider.directive.ng:view ng:view}. The
443+
angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat} or load the contents
444+
asynchronously such as {@link angular.module.ng.$compileProvider.directive.ng-view ng-view}. The
445445
compile functions takes the following arguments.
446446

447447
* `tElement` - template element - The element where the directive has been declared. It is

docs/content/cookbook/advancedform.ngdoc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,35 @@ detection, and preventing invalid form submission.
5858
$scope.cancel();
5959
}
6060
</script>
61-
<div ng:controller="UserForm">
61+
<div ng-controller="UserForm">
6262

6363
<form name="myForm">
6464

6565
<label>Name:</label><br/>
66-
<input type="text" ng:model="form.name" required/> <br/><br/>
66+
<input type="text" ng-model="form.name" required/> <br/><br/>
6767

6868
<label>Address:</label> <br/>
69-
<input type="text" ng:model="form.address.line1" size="33" required/> <br/>
70-
<input type="text" ng:model="form.address.city" size="12" required/>,
71-
<input type="text" ng:model="form.address.state" size="2"
72-
ng:pattern="state" required/>
73-
<input type="text" ng:model="form.address.zip" size="5"
74-
ng:pattern="zip" required/><br/><br/>
69+
<input type="text" ng-model="form.address.line1" size="33" required/> <br/>
70+
<input type="text" ng-model="form.address.city" size="12" required/>,
71+
<input type="text" ng-model="form.address.state" size="2"
72+
ng-pattern="state" required/>
73+
<input type="text" ng-model="form.address.zip" size="5"
74+
ng-pattern="zip" required/><br/><br/>
7575

7676
<label>Contacts:</label>
77-
[ <a href="" ng:click="addContact()">add</a> ]
78-
<div ng:repeat="contact in form.contacts">
79-
<select ng:model="contact.type">
77+
[ <a href="" ng-click="addContact()">add</a> ]
78+
<div ng-repeat="contact in form.contacts">
79+
<select ng-model="contact.type">
8080
<option>email</option>
8181
<option>phone</option>
8282
<option>pager</option>
8383
<option>IM</option>
8484
</select>
85-
<input type="text" ng:model="contact.value" required/>
86-
[ <a href="" ng:click="removeContact(contact)">X</a> ]
85+
<input type="text" ng-model="contact.value" required/>
86+
[ <a href="" ng-click="removeContact(contact)">X</a> ]
8787
</div>
88-
<button ng:click="cancel()" ng:disabled="{{isCancelDisabled()}}">Cancel</button>
89-
<button ng:click="save()" ng:disabled="{{isSaveDisabled()}}">Save</button>
88+
<button ng-click="cancel()" ng-disabled="{{isCancelDisabled()}}">Cancel</button>
89+
<button ng-click="save()" ng-disabled="{{isSaveDisabled()}}">Save</button>
9090
</form>
9191

9292
<hr/>

docs/content/cookbook/buzz.ngdoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ to retrieve Buzz activity and comments.
3131
}
3232
};
3333
</script>
34-
<div ng:controller="BuzzController">
35-
<input ng:model="userId"/>
36-
<button ng:click="fetch()">fetch</button>
34+
<div ng-controller="BuzzController">
35+
<input ng-model="userId"/>
36+
<button ng-click="fetch()">fetch</button>
3737
<hr/>
38-
<div class="buzz" ng:repeat="item in activities.data.items">
38+
<div class="buzz" ng-repeat="item in activities.data.items">
3939
<h1 style="font-size: 15px;">
40-
<img ng:src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
41-
<a ng:href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
42-
<a href ng:click="expandReplies(item)" style="float: right;">
40+
<img ng-src="{{item.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
41+
<a ng-href="{{item.actor.profileUrl}}">{{item.actor.name}}</a>
42+
<a href ng-click="expandReplies(item)" style="float: right;">
4343
Expand replies: {{item.links.replies[0].count}}
4444
</a>
4545
</h1>
4646
{{item.object.content | html}}
47-
<div class="reply" ng:repeat="reply in item.replies.data.items" style="margin-left: 20px;">
48-
<img ng:src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
49-
<a ng:href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
47+
<div class="reply" ng-repeat="reply in item.replies.data.items" style="margin-left: 20px;">
48+
<img ng-src="{{reply.actor.thumbnailUrl}}" style="max-height:30px;max-width:30px;"/>
49+
<a ng-href="{{reply.actor.profileUrl}}">{{reply.actor.name}}</a>:
5050
{{reply.content | html}}
5151
</div>
5252
</div>

docs/content/cookbook/deeplinking.ngdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ In this example we have a simple app which consist of two screens:
3333

3434
The two partials are defined in the following URLs:
3535

36-
* <a href="./examples/settings.html" ng:ext-link>./examples/settings.html</a>
37-
* <a href="./examples/welcome.html" ng:ext-link>./examples/welcome.html</a>
36+
* <a href="./examples/settings.html" ng-ext-link>./examples/settings.html</a>
37+
* <a href="./examples/welcome.html" ng-ext-link>./examples/welcome.html</a>
3838

3939
<doc:example module="deepLinking">
4040
<doc:source jsfiddle="false">
@@ -73,7 +73,7 @@ The two partials are defined in the following URLs:
7373
$scope.cancel();
7474
}
7575
</script>
76-
<div ng:controller="AppCntl">
76+
<div ng-controller="AppCntl">
7777
<h1>Your App Chrome</h1>
7878
[ <a href="welcome">Welcome</a> | <a href="settings">Settings</a> ]
7979
<hr/>
@@ -106,7 +106,7 @@ The two partials are defined in the following URLs:
106106
routes.
107107
* The {@link api/angular.module.ng.$route $route} service then watches the URL and instantiates the
108108
appropriate controller when the URL changes.
109-
* The {@link api/angular.module.ng.$compileProvider.directive.ng:view ng:view} widget loads the
109+
* The {@link api/angular.module.ng.$compileProvider.directive.ng-view ng-view} widget loads the
110110
view when the URL changes. It also sets the view scope to the newly instantiated controller.
111111
* Changing the URL is sufficient to change the controller and view. It makes no difference whether
112112
the URL is changed programatically or by the user.

docs/content/cookbook/form.ngdoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,30 @@ allow a user to enter data.
3232
};
3333
}
3434
</script>
35-
<div ng:controller="FormController" class="example">
35+
<div ng-controller="FormController" class="example">
3636

3737
<label>Name:</label><br/>
38-
<input type="text" ng:model="user.name" required/> <br/><br/>
38+
<input type="text" ng-model="user.name" required/> <br/><br/>
3939

4040
<label>Address:</label><br/>
41-
<input type="text" ng:model="user.address.line1" size="33" required> <br/>
42-
<input type="text" ng:model="user.address.city" size="12" required>,
43-
<input type="text" ng:model="user.address.state" size="2"
44-
ng:pattern="state" required>
45-
<input type="text" ng:model="user.address.zip" size="5"
46-
ng:pattern="zip" required><br/><br/>
41+
<input type="text" ng-model="user.address.line1" size="33" required> <br/>
42+
<input type="text" ng-model="user.address.city" size="12" required>,
43+
<input type="text" ng-model="user.address.state" size="2"
44+
ng-pattern="state" required>
45+
<input type="text" ng-model="user.address.zip" size="5"
46+
ng-pattern="zip" required><br/><br/>
4747

4848
<label>Phone:</label>
49-
[ <a href="" ng:click="addContact()">add</a> ]
50-
<div ng:repeat="contact in user.contacts">
51-
<select ng:model="contact.type">
49+
[ <a href="" ng-click="addContact()">add</a> ]
50+
<div ng-repeat="contact in user.contacts">
51+
<select ng-model="contact.type">
5252
<option>email</option>
5353
<option>phone</option>
5454
<option>pager</option>
5555
<option>IM</option>
5656
</select>
57-
<input type="text" ng:model="contact.value" required/>
58-
[ <a href="" ng:click="removeContact(contact)">X</a> ]
57+
<input type="text" ng-model="contact.value" required/>
58+
[ <a href="" ng-click="removeContact(contact)">X</a> ]
5959
</div>
6060
<hr/>
6161
Debug View:
@@ -102,7 +102,7 @@ allow a user to enter data.
102102

103103
# Things to notice
104104

105-
* The user data model is initialized {@link api/angular.module.ng.$compileProvider.directive.ng:controller controller} and is
105+
* The user data model is initialized {@link api/angular.module.ng.$compileProvider.directive.ng-controller controller} and is
106106
available in the {@link api/angular.module.ng.$rootScope.Scope scope} with the initial data.
107107
* For debugging purposes we have included a debug view of the model to better understand what
108108
is going on.

docs/content/cookbook/helloworld.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
$scope.name = 'World';
1010
}
1111
</script>
12-
<div ng:controller="HelloCntl">
13-
Your name: <input type="text" ng:model="name" value="World"/>
12+
<div ng-controller="HelloCntl">
13+
Your name: <input type="text" ng-model="name" value="World"/>
1414
<hr/>
1515
Hello {{name}}!
1616
</div>

docs/content/cookbook/mvc.ngdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ no connection between the controller and the view.
8080
</script>
8181

8282
<h3>Tic-Tac-Toe</h3>
83-
<div ng:controller="TicTacToeCntl">
83+
<div ng-controller="TicTacToeCntl">
8484
Next Player: {{nextMove}}
85-
<div class="winner" ng:show="winner">Player {{winner}} has won!</div>
85+
<div class="winner" ng-show="winner">Player {{winner}} has won!</div>
8686
<table class="board">
87-
<tr ng:repeat="row in board" style="height:15px;">
88-
<td ng:repeat="cell in row" ng:style="cellStyle"
89-
ng:click="dropPiece($parent.$index, $index)">{{cell}}</td>
87+
<tr ng-repeat="row in board" style="height:15px;">
88+
<td ng-repeat="cell in row" ng-style="cellStyle"
89+
ng-click="dropPiece($parent.$index, $index)">{{cell}}</td>
9090
</tr>
9191
</table>
92-
<button ng:click="reset()">reset board</button>
92+
<button ng-click="reset()">reset board</button>
9393
</div>
9494
</doc:source>
9595
<doc:scenario>

src/directive/input.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -724,20 +724,20 @@ var inputDirective = [function() {
724724
* @ngdoc object
725725
* @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController
726726
*
727-
* @property {string} viewValue Actual string value in the view.
728-
* @property {*} modelValue The value in the model, that the control is bound to.
729-
* @property {Array.<Function>} parsers Whenever the control reads value from the DOM, it executes
727+
* @property {string} $viewValue Actual string value in the view.
728+
* @property {*} $modelValue The value in the model, that the control is bound to.
729+
* @property {Array.<Function>} $parsers Whenever the control reads value from the DOM, it executes
730730
* all of these functions to sanitize / convert the value as well as validate.
731731
*
732-
* @property {Array.<Function>} formatters Whenever the model value changes, it executes all of
732+
* @property {Array.<Function>} $formatters Whenever the model value changes, it executes all of
733733
* these functions to convert the value as well as validate.
734734
*
735-
* @property {Object} error An bject hash with all errors as keys.
735+
* @property {Object} $error An bject hash with all errors as keys.
736736
*
737-
* @property {boolean} pristine True if user has not interacted with the control yet.
738-
* @property {boolean} dirty True if user has already interacted with the control.
739-
* @property {boolean} valid True if there is no error.
740-
* @property {boolean} invalid True if at least one error on the control.
737+
* @property {boolean} $pristine True if user has not interacted with the control yet.
738+
* @property {boolean} $dirty True if user has already interacted with the control.
739+
* @property {boolean} $valid True if there is no error.
740+
* @property {boolean} $invalid True if at least one error on the control.
741741
*
742742
* @description
743743
*

0 commit comments

Comments
 (0)
X Tutup