Skip to content

Commit f4d338d

Browse files
committed
chore(*): refactor all ng: to ng-
1 parent 0bfaa57 commit f4d338d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+766
-764
lines changed

docs/src/templates/doc_widgets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ angular.module('ngdocs.directives', [], function($compileProvider) {
1414

1515
var HTML_TEMPLATE =
1616
'<!doctype html>\n' +
17-
'<html xmlns:ng="http://angularjs.org/" ng:app_MODULE_>\n' +
17+
'<html ng-app_MODULE_>\n' +
1818
' <script src="' + angularJsUrl + '"></script>\n' +
1919
'_SCRIPT_SOURCE_' +
2020
' <body>\n' +

src/Angular.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ function makeMap(str){
445445

446446

447447
/**
448-
* HTML class which is the only class which can be used in ng:bind to inline HTML for security
448+
* HTML class which is the only class which can be used in ng-bind to inline HTML for security
449449
* reasons.
450450
*
451451
* @constructor
@@ -831,7 +831,7 @@ function encodeUriQuery(val, pctEncodeSpaces) {
831831

832832
/**
833833
* @ngdoc directive
834-
* @name angular.module.ng.$compileProvider.directive.ng:app
834+
* @name angular.module.ng.$compileProvider.directive.ng-app
835835
*
836836
* @element ANY
837837
* @param {angular.Module} module on optional application
@@ -844,11 +844,11 @@ function encodeUriQuery(val, pctEncodeSpaces) {
844844
* designates the root of the application and is typically placed
845845
* ot the root of the page.
846846
*
847-
* In the example below if the `ng:app` directive would not be placed
847+
* In the example below if the `ng-app` directive would not be placed
848848
* on the `html` element then the document would not be compiled
849849
* and the `{{ 1+2 }}` would not be resolved to `3`.
850850
*
851-
* `ng:app` is the easiest way to bootstrap an application.
851+
* `ng-app` is the easiest way to bootstrap an application.
852852
*
853853
<doc:example>
854854
<doc:source>

src/directive/a.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
* Modifies the default behavior of html A tag, so that the default action is prevented when href
55
* attribute is empty.
66
*
7-
* The reasoning for this change is to allow easy creation of action links with ng:click without
7+
* The reasoning for this change is to allow easy creation of action links with ng-click without
88
* changing the location or causing page reloads, e.g.:
9-
* <a href="" ng:click="model.$save()">Save</a>
9+
* <a href="" ng-click="model.$save()">Save</a>
1010
*/
1111
var htmlAnchorDirective = valueFn({
1212
restrict: 'E',
1313
compile: function(element, attr) {
14-
// turn <a href ng:click="..">link</a> into a link in IE
14+
// turn <a href ng-click="..">link</a> into a link in IE
1515
// but only if it doesn't have name attribute, in which case it's an anchor
1616
if (!attr.href) {
1717
attr.$set('href', '');

src/directive/booleanAttrDirs.js

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
/**
44
* @ngdoc directive
5-
* @name angular.module.ng.$compileProvider.directive.ng:href
5+
* @name angular.module.ng.$compileProvider.directive.ng-href
66
*
77
* @description
88
* Using <angular/> markup like {{hash}} in an href attribute makes
99
* the page open to a wrong URL, if the user clicks that link before
1010
* angular has a chance to replace the {{hash}} with actual URL, the
1111
* link will be broken and will most likely return a 404 error.
12-
* The `ng:href` solves this problem by placing the `href` in the
13-
* `ng:` namespace.
12+
* The `ng-href` solves this problem by placing the `href` in the
13+
* `ng-` namespace.
1414
*
1515
* The buggy way to write it:
1616
* <pre>
@@ -19,7 +19,7 @@
1919
*
2020
* The correct way to write it:
2121
* <pre>
22-
* <a ng:href="http://www.gravatar.com/avatar/%7B%7Bhash%7D%7D"/>
22+
* <a ng-href="http://www.gravatar.com/avatar/%7B%7Bhash%7D%7D"/>
2323
* </pre>
2424
*
2525
* @element ANY
@@ -29,47 +29,47 @@
2929
* This example uses `link` variable inside `href` attribute:
3030
<doc:example>
3131
<doc:source>
32-
<input ng:model="value" /><br />
33-
<a id="link-1" href ng:click="value = 1">link 1</a> (link, don't reload)<br />
34-
<a id="link-2" href="" ng:click="value = 2">link 2</a> (link, don't reload)<br />
35-
<a id="link-3" ng:href="http://github.com/%7B%7B'123'}}" ng:ext-link>link 3</a> (link, reload!)<br />
36-
<a id="link-4" href="" name="xx" ng:click="value = 4">anchor</a> (link, don't reload)<br />
37-
<a id="link-5" name="xxx" ng:click="value = 5">anchor</a> (no link)<br />
38-
<a id="link-6" ng:href="http://github.com/%7B%7Bvalue%7D%7D" ng:ext-link>link</a> (link, change hash)
32+
<input ng-model="value" /><br />
33+
<a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
34+
<a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
35+
<a id="link-3" ng-href="http://github.com/%7B%7B'123'}}" ng-ext-link>link 3</a> (link, reload!)<br />
36+
<a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
37+
<a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
38+
<a id="link-6" ng-href="http://github.com/%7B%7Bvalue%7D%7D" ng-ext-link>link</a> (link, change hash)
3939
</doc:source>
4040
<doc:scenario>
41-
it('should execute ng:click but not reload when href without value', function() {
41+
it('should execute ng-click but not reload when href without value', function() {
4242
element('#link-1').click();
4343
expect(input('value').val()).toEqual('1');
4444
expect(element('#link-1').attr('href')).toBe("");
4545
});
4646
47-
it('should execute ng:click but not reload when href empty string', function() {
47+
it('should execute ng-click but not reload when href empty string', function() {
4848
element('#link-2').click();
4949
expect(input('value').val()).toEqual('2');
5050
expect(element('#link-2').attr('href')).toBe("");
5151
});
5252
53-
it('should execute ng:click and change url when ng:href specified', function() {
53+
it('should execute ng-click and change url when ng-href specified', function() {
5454
expect(element('#link-3').attr('href')).toBe("/123");
5555
5656
element('#link-3').click();
5757
expect(browser().window().path()).toEqual('/123');
5858
});
5959
60-
it('should execute ng:click but not reload when href empty string and name specified', function() {
60+
it('should execute ng-click but not reload when href empty string and name specified', function() {
6161
element('#link-4').click();
6262
expect(input('value').val()).toEqual('4');
6363
expect(element('#link-4').attr('href')).toBe("");
6464
});
6565
66-
it('should execute ng:click but not reload when no href but name specified', function() {
66+
it('should execute ng-click but not reload when no href but name specified', function() {
6767
element('#link-5').click();
6868
expect(input('value').val()).toEqual('5');
6969
expect(element('#link-5').attr('href')).toBe("");
7070
});
7171
72-
it('should only change url when only ng:href', function() {
72+
it('should only change url when only ng-href', function() {
7373
input('value').enter('6');
7474
expect(element('#link-6').attr('href')).toBe("/6");
7575
@@ -82,14 +82,14 @@
8282

8383
/**
8484
* @ngdoc directive
85-
* @name angular.module.ng.$compileProvider.directive.ng:src
85+
* @name angular.module.ng.$compileProvider.directive.ng-src
8686
*
8787
* @description
8888
* Using <angular/> markup like `{{hash}}` in a `src` attribute doesn't
8989
* work right: The browser will fetch from the URL with the literal
9090
* text `{{hash}}` until <angular/> replaces the expression inside
91-
* `{{hash}}`. The `ng:src` attribute solves this problem by placing
92-
* the `src` attribute in the `ng:` namespace.
91+
* `{{hash}}`. The `ng-src` attribute solves this problem by placing
92+
* the `src` attribute in the `ng-` namespace.
9393
*
9494
* The buggy way to write it:
9595
* <pre>
@@ -98,7 +98,7 @@
9898
*
9999
* The correct way to write it:
100100
* <pre>
101-
* <img ng:src="http://www.gravatar.com/avatar/%7B%7Bhash%7D%7D"/>
101+
* <img ng-src="http://www.gravatar.com/avatar/%7B%7Bhash%7D%7D"/>
102102
* </pre>
103103
*
104104
* @element ANY
@@ -107,27 +107,27 @@
107107

108108
/**
109109
* @ngdoc directive
110-
* @name angular.module.ng.$compileProvider.directive.ng:disabled
110+
* @name angular.module.ng.$compileProvider.directive.ng-disabled
111111
*
112112
* @description
113113
*
114114
* The following markup will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
115115
* <pre>
116-
* <div ng:init="scope = { isDisabled: false }">
116+
* <div ng-init="scope = { isDisabled: false }">
117117
* <button disabled="{{scope.isDisabled}}">Disabled</button>
118118
* </div>
119119
* </pre>
120120
*
121121
* The HTML specs do not require browsers to preserve the special attributes such as disabled.
122122
* (The presence of them means true and absence means false)
123123
* This prevents the angular compiler from correctly retrieving the binding expression.
124-
* To solve this problem, we introduce ng:disabled.
124+
* To solve this problem, we introduce ng-disabled.
125125
*
126126
* @example
127127
<doc:example>
128128
<doc:source>
129-
Click me to toggle: <input type="checkbox" ng:model="checked"><br/>
130-
<button ng:model="button" ng:disabled="{{checked}}">Button</button>
129+
Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
130+
<button ng-model="button" ng-disabled="{{checked}}">Button</button>
131131
</doc:source>
132132
<doc:scenario>
133133
it('should toggle button', function() {
@@ -145,18 +145,18 @@
145145

146146
/**
147147
* @ngdoc directive
148-
* @name angular.module.ng.$compileProvider.directive.ng:checked
148+
* @name angular.module.ng.$compileProvider.directive.ng-checked
149149
*
150150
* @description
151151
* The HTML specs do not require browsers to preserve the special attributes such as checked.
152152
* (The presence of them means true and absence means false)
153153
* This prevents the angular compiler from correctly retrieving the binding expression.
154-
* To solve this problem, we introduce ng:checked.
154+
* To solve this problem, we introduce ng-checked.
155155
* @example
156156
<doc:example>
157157
<doc:source>
158-
Check me to check both: <input type="checkbox" ng:model="master"><br/>
159-
<input id="checkSlave" type="checkbox" ng:checked="{{master}}">
158+
Check me to check both: <input type="checkbox" ng-model="master"><br/>
159+
<input id="checkSlave" type="checkbox" ng-checked="{{master}}">
160160
</doc:source>
161161
<doc:scenario>
162162
it('should check both checkBoxes', function() {
@@ -174,19 +174,19 @@
174174

175175
/**
176176
* @ngdoc directive
177-
* @name angular.module.ng.$compileProvider.directive.ng:multiple
177+
* @name angular.module.ng.$compileProvider.directive.ng-multiple
178178
*
179179
* @description
180180
* The HTML specs do not require browsers to preserve the special attributes such as multiple.
181181
* (The presence of them means true and absence means false)
182182
* This prevents the angular compiler from correctly retrieving the binding expression.
183-
* To solve this problem, we introduce ng:multiple.
183+
* To solve this problem, we introduce ng-multiple.
184184
*
185185
* @example
186186
<doc:example>
187187
<doc:source>
188-
Check me check multiple: <input type="checkbox" ng:model="checked"><br/>
189-
<select id="select" ng:multiple="{{checked}}">
188+
Check me check multiple: <input type="checkbox" ng-model="checked"><br/>
189+
<select id="select" ng-multiple="{{checked}}">
190190
<option>Misko</option>
191191
<option>Igor</option>
192192
<option>Vojta</option>
@@ -209,18 +209,18 @@
209209

210210
/**
211211
* @ngdoc directive
212-
* @name angular.module.ng.$compileProvider.directive.ng:readonly
212+
* @name angular.module.ng.$compileProvider.directive.ng-readonly
213213
*
214214
* @description
215215
* The HTML specs do not require browsers to preserve the special attributes such as readonly.
216216
* (The presence of them means true and absence means false)
217217
* This prevents the angular compiler from correctly retrieving the binding expression.
218-
* To solve this problem, we introduce ng:readonly.
218+
* To solve this problem, we introduce ng-readonly.
219219
* @example
220220
<doc:example>
221221
<doc:source>
222-
Check me to make text readonly: <input type="checkbox" ng:model="checked"><br/>
223-
<input type="text" ng:readonly="{{checked}}" value="I'm Angular"/>
222+
Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
223+
<input type="text" ng-readonly="{{checked}}" value="I'm Angular"/>
224224
</doc:source>
225225
<doc:scenario>
226226
it('should toggle readonly attr', function() {
@@ -238,20 +238,20 @@
238238

239239
/**
240240
* @ngdoc directive
241-
* @name angular.module.ng.$compileProvider.directive.ng:selected
241+
* @name angular.module.ng.$compileProvider.directive.ng-selected
242242
*
243243
* @description
244244
* The HTML specs do not require browsers to preserve the special attributes such as selected.
245245
* (The presence of them means true and absence means false)
246246
* This prevents the angular compiler from correctly retrieving the binding expression.
247-
* To solve this problem, we introduce ng:selected.
247+
* To solve this problem, we introduce ng-selected.
248248
* @example
249249
<doc:example>
250250
<doc:source>
251-
Check me to select: <input type="checkbox" ng:model="checked"><br/>
251+
Check me to select: <input type="checkbox" ng-model="checked"><br/>
252252
<select>
253253
<option>Hello!</option>
254-
<option id="greet" ng:selected="{{checked}}">Greetings!</option>
254+
<option id="greet" ng-selected="{{checked}}">Greetings!</option>
255255
</select>
256256
</doc:source>
257257
<doc:scenario>

src/directive/form.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ function FormController($scope, name) {
113113
*
114114
* If `name` attribute is specified, the controller is published to the scope as well.
115115
*
116-
* # Alias: `ng:form`
116+
* # Alias: `ng-form`
117117
*
118118
* In angular forms can be nested. This means that the outer form is valid when all of the child
119119
* forms are valid as well. However browsers do not allow nesting of `<form>` elements, for this
120-
* reason angular provides `<ng:form>` alias which behaves identical to `<form>` but allows
120+
* reason angular provides `<ng-form>` alias which behaves identical to `<form>` but allows
121121
* element nesting.
122122
*
123123
*
@@ -141,19 +141,19 @@ function FormController($scope, name) {
141141
* You can use one of the following two ways to specify what javascript method should be called when
142142
* a form is submitted:
143143
*
144-
* - ng:submit on the form element (add link to ng:submit)
145-
* - ng:click on the first button or input field of type submit (input[type=submit])
144+
* - ng-submit on the form element (add link to ng-submit)
145+
* - ng-click on the first button or input field of type submit (input[type=submit])
146146
*
147-
* To prevent double execution of the handler, use only one of ng:submit or ng:click. This is
147+
* To prevent double execution of the handler, use only one of ng-submit or ng-click. This is
148148
* because of the following form submission rules coming from the html spec:
149149
*
150150
* - If a form has only one input field then hitting enter in this field triggers form submit
151-
* (`ng:submit`)
151+
* (`ng-submit`)
152152
* - if a form has has 2+ input fields and no buttons or input[type=submit] then hitting enter
153153
* doesn't trigger submit
154154
* - if a form has one or more input fields and one or more buttons or input[type=submit] then
155155
* hitting enter in any of the input fields will trigger the click handler on the *first* button or
156-
* input[type=submit] (`ng:click`) *and* a submit handler on the enclosing form (`ng:submit`)
156+
* input[type=submit] (`ng-click`) *and* a submit handler on the enclosing form (`ng-submit`)
157157
*
158158
* @param {string=} name Name of the form. If specified, the form controller will be published into
159159
* related scope, under this name.
@@ -166,9 +166,9 @@ function FormController($scope, name) {
166166
$scope.text = 'guest';
167167
}
168168
</script>
169-
<form name="myForm" ng:controller="Ctrl">
170-
text: <input type="text" name="input" ng:model="text" required>
171-
<span class="error" ng:show="myForm.input.error.REQUIRED">Required!</span>
169+
<form name="myForm" ng-controller="Ctrl">
170+
text: <input type="text" name="input" ng-model="text" required>
171+
<span class="error" ng-show="myForm.input.error.REQUIRED">Required!</span>
172172
<tt>text = {{text}}</tt><br/>
173173
<tt>myForm.input.valid = {{myForm.input.valid}}</tt><br/>
174174
<tt>myForm.input.error = {{myForm.input.error}}</tt><br/>

0 commit comments

Comments
 (0)