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

Commit a01cf6d

Browse files
dandoyonIgorMinar
authored andcommitted
doc(typos): fix couple of typos in the docs
Minor documentation fixes. Should not be any code changes. One test changed due to dependency on text in documentation.
1 parent f93e9bf commit a01cf6d

14 files changed

+45
-38
lines changed

src/Angular.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ var _undefined = undefined,
145145
* @param {Object|Array} obj Object to iterate over.
146146
* @param {function()} iterator Iterator function.
147147
* @param {Object} context Object to become context (`this`) for the iterator function.
148-
* @returns {Objet|Array} Reference to `obj`.
148+
* @returns {Object|Array} Reference to `obj`.
149149
*/
150150
function forEach(obj, iterator, context) {
151151
var key;
@@ -875,7 +875,7 @@ function toKeyValue(obj) {
875875

876876

877877
/**
878-
* we need our custom mehtod because encodeURIComponent is too agressive and doesn't follow
878+
* We need our custom mehtod because encodeURIComponent is too agressive and doesn't follow
879879
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
880880
* segments:
881881
* segment = *pchar

src/Browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function Browser(window, document, body, XHR, $log) {
239239
* The listener gets called with either HashChangeEvent object or simple object that also contains
240240
* `oldURL` and `newURL` properties.
241241
*
242-
* NOTE: this api is intended for use only by the $location service. Please use the
242+
* Note: this api is intended for use only by the $location service. Please use the
243243
* {@link angular.service.$location $location service} to monitor hash changes in angular apps.
244244
*
245245
* @param {function(event)} listener Listener function to be called when url hash changes.

src/Compiler.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Template.prototype = {
8989
* The compilation is a process of walking the DOM tree and trying to match DOM elements to
9090
* {@link angular.markup markup}, {@link angular.attrMarkup attrMarkup},
9191
* {@link angular.widget widgets}, and {@link angular.directive directives}. For each match it
92-
* executes coresponding markup, attrMarkup, widget or directive template function and collects the
92+
* executes corresponding markup, attrMarkup, widget or directive template function and collects the
9393
* instance functions into a single template function which is then returned.
9494
*
9595
* The template function can then be used once to produce the view or as it is the case with
@@ -118,7 +118,7 @@ Template.prototype = {
118118
* root scope is created.
119119
* * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
120120
* `template` and call the `cloneAttachFn` function allowing the caller to attach the
121-
* cloned elements to the DOM document at the approriate place. The `cloneAttachFn` is
121+
* cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
122122
* called as: <br/> `cloneAttachFn(clonedElement, scope)` where:
123123
*
124124
* * `clonedElement` - is a clone of the original `element` passed into the compiler.
@@ -234,7 +234,7 @@ Compiler.prototype = {
234234
* not a problem, but under some circumstances the values for data
235235
* is not available until after the full view is computed. If such
236236
* values are needed before they are computed the order of
237-
* evaluation can be change using ng:eval-order
237+
* evaluation can be changed using ng:eval-order
238238
*
239239
* @element ANY
240240
* @param {integer|string=} [priority=0] priority integer, or FIRST, LAST constant

src/Scope.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function getter(instance, path, unboundFn) {
99
for ( var i = 0; i < len; i++) {
1010
key = element[i];
1111
if (!key.match(/^[\$\w][\$\w\d]*$/))
12-
throw "Expression '" + path + "' is not a valid expression for accesing variables.";
12+
throw "Expression '" + path + "' is not a valid expression for accessing variables.";
1313
if (instance) {
1414
lastInstance = instance;
1515
instance = instance[key];
@@ -202,7 +202,7 @@ function createScope(parent, providers, instanceCache) {
202202
* @description
203203
* Assigns a value to a property of the current scope specified via `property_chain`. Unlike in
204204
* JavaScript, if there are any `undefined` intermediary properties, empty objects are created
205-
* and assigned in to them instead of throwing an exception.
205+
* and assigned to them instead of throwing an exception.
206206
*
207207
<pre>
208208
var scope = angular.scope();
@@ -368,7 +368,7 @@ function createScope(parent, providers, instanceCache) {
368368
* parameters, `newValue` and `oldValue`.
369369
* @param {(function()|DOMElement)=} [exceptionHanlder=angular.service.$exceptionHandler] Handler
370370
* that gets called when `watchExp` or `listener` throws an exception. If a DOMElement is
371-
* specified as handler, the element gets decorated by angular with the information about the
371+
* specified as a handler, the element gets decorated by angular with the information about the
372372
* exception.
373373
* @param {boolean=} [initRun=true] Flag that prevents the first execution of the listener upon
374374
* registration.

src/directives.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ angularDirective("ng:bind", function(expression, element){
265265
error = formatError(e);
266266
});
267267
this.$element = oldElement;
268-
// If we are HTML than save the raw HTML data so that we don't
268+
// If we are HTML then save the raw HTML data so that we don't
269269
// recompute sanitization since it is expensive.
270270
// TODO: turn this into a more generic way to compute this
271271
if (isHtml = (value instanceof HTML))

src/filters.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
*
4141
* @param {number} amount Input to filter.
4242
* @param {string=} symbol Currency symbol or identifier to be displayed.
43-
* @returns {string} Formated number.
43+
* @returns {string} Formatted number.
4444
*
4545
* @css ng-format-negative
46-
* When the value is negative, this css class is applied to the binding making it by default red.
46+
* When the value is negative, this css class is applied to the binding making it (by default) red.
4747
*
4848
* @example
4949
<doc:example>
@@ -82,7 +82,7 @@ angularFilter.currency = function(amount, currencySymbol){
8282
* @description
8383
* Formats a number as text.
8484
*
85-
* If the input is not a number empty string is returned.
85+
* If the input is not a number an empty string is returned.
8686
*
8787
* @param {number|string} number Number to format.
8888
* @param {(number|string)=} [fractionSize=2] Number of decimal places to round the number to.
@@ -492,7 +492,7 @@ angularFilter.uppercase = uppercase;
492492
*
493493
* The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
494494
* then serialized back to properly escaped html string. This means that no unsafe input can make
495-
* it into the returned string, however since our parser is more strict than a typical browser
495+
* it into the returned string, however, since our parser is more strict than a typical browser
496496
* parser, it's possible that some obscure input, which would be recognized as valid HTML by a
497497
* browser, won't make it through the sanitizer.
498498
*
@@ -581,7 +581,7 @@ angularFilter.html = function(html, option){
581581
*
582582
* @description
583583
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
584-
* plane email address links.
584+
* plain email address links.
585585
*
586586
* @param {string} text Input text.
587587
* @returns {string} Html-linkified text.

src/formatters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @name angular.formatter
77
* @description
88
*
9-
* Formatters are used for translating data formats between those used in for display and those used
9+
* Formatters are used for translating data formats between those used for display and those used
1010
* for storage.
1111
*
1212
* Following is the list of built-in angular formatters:

src/jqLite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* focus on the most commonly needed functionality and minimal footprint. For this reason only a
2424
* limited number of jQuery methods, arguments and invocation styles are supported.
2525
*
26-
* NOTE: All element references in angular are always wrapped with jQuery (lite) and are never
26+
* Note: All element references in angular are always wrapped with jQuery (lite) and are never
2727
* raw DOM references.
2828
*
2929
* ## Angular's jQuery lite implements these functions:
@@ -152,7 +152,7 @@ function JQLiteData(element, key, value) {
152152

153153
function JQLiteHasClass(element, selector, _) {
154154
// the argument '_' is important, since it makes the function have 3 arguments, which
155-
// is neede for delegate function to realize the this is a getter.
155+
// is needed for delegate function to realize the this is a getter.
156156
var className = " " + selector + " ";
157157
return ((" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf( className ) > -1);
158158
}

src/markups.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* Markup extensions do not themselves produce linking functions. Think of markup as a way to
1313
* produce shorthand for a {@link angular.widget widget} or a {@link angular.directive directive}.
1414
*
15-
* The most prominent example of an markup in angular is the built-in double curly markup
16-
* `{{expression}}`, which is a shorthand for `<span ng:bind="expression"></span>`.
15+
* The most prominent example of a markup in angular is the built-in double curly markup
16+
* `{{expression}}`, which is shorthand for `<span ng:bind="expression"></span>`.
1717
*
1818
* Create custom markup like this:
1919
*
@@ -34,7 +34,7 @@
3434
* @description
3535
*
3636
* Attribute markup extends the angular compiler in a very similar way as {@link angular.markup}
37-
* except that it allows you to modify the state of the attribute text rather then the content of a
37+
* except that it allows you to modify the state of the attribute text rather than the content of a
3838
* node.
3939
*
4040
* Create custom attribute markup like this:
@@ -138,7 +138,7 @@ angularTextMarkup('option', function(text, textNode, parentElement){
138138
*
139139
* @description
140140
* Using <angular/> markup like {{hash}} in an href attribute makes
141-
* the page open to a wrong URL, ff the user clicks that link before
141+
* the page open to a wrong URL, if the user clicks that link before
142142
* angular has a chance to replace the {{hash}} with actual URL, the
143143
* link will be broken and will most likely return a 404 error.
144144
* The `ng:href` solves this problem by placing the `href` in the
@@ -251,7 +251,8 @@ angularTextMarkup('option', function(text, textNode, parentElement){
251251
* </div>
252252
* </pre>
253253
*
254-
* the HTML specs do not require browsers preserve the special attributes such as disabled.(The presense of them means true and absense means false)
254+
* The HTML specs do not require browsers to preserve the special attributes such as disabled.
255+
* (The presence of them means true and absence means false)
255256
* This prevents the angular compiler from correctly retrieving the binding expression.
256257
* To solve this problem, we introduce ng:disabled.
257258
*
@@ -281,7 +282,8 @@ angularTextMarkup('option', function(text, textNode, parentElement){
281282
* @name angular.directive.ng:checked
282283
*
283284
* @description
284-
* the HTML specs do not require browsers preserve the special attributes such as checked.(The presense of them means true and absense means false)
285+
* The HTML specs do not require browsers to preserve the special attributes such as checked.
286+
* (The presence of them means true and absence means false)
285287
* This prevents the angular compiler from correctly retrieving the binding expression.
286288
* To solve this problem, we introduce ng:checked.
287289
* @example
@@ -310,7 +312,8 @@ angularTextMarkup('option', function(text, textNode, parentElement){
310312
* @name angular.directive.ng:multiple
311313
*
312314
* @description
313-
* the HTML specs do not require browsers preserve the special attributes such as multiple.(The presense of them means true and absense means false)
315+
* The HTML specs do not require browsers to preserve the special attributes such as multiple.
316+
* (The presence of them means true and absence means false)
314317
* This prevents the angular compiler from correctly retrieving the binding expression.
315318
* To solve this problem, we introduce ng:multiple.
316319
*
@@ -345,7 +348,8 @@ angularTextMarkup('option', function(text, textNode, parentElement){
345348
* @name angular.directive.ng:readonly
346349
*
347350
* @description
348-
* the HTML specs do not require browsers preserve the special attributes such as readonly.(The presense of them means true and absense means false)
351+
* The HTML specs do not require browsers to preserve the special attributes such as readonly.
352+
* (The presence of them means true and absence means false)
349353
* This prevents the angular compiler from correctly retrieving the binding expression.
350354
* To solve this problem, we introduce ng:readonly.
351355
* @example
@@ -374,7 +378,8 @@ angularTextMarkup('option', function(text, textNode, parentElement){
374378
* @name angular.directive.ng:selected
375379
*
376380
* @description
377-
* the HTML specs do not require browsers preserve the special attributes such as selected.(The presense of them means true and absense means false)
381+
* The HTML specs do not require browsers to preserve the special attributes such as selected.
382+
* (The presence of them means true and absence means false)
378383
* This prevents the angular compiler from correctly retrieving the binding expression.
379384
* To solve this problem, we introduce ng:selected.
380385
* @example

src/service/updateView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* or 'XHR' (instead of {@link angular.service.$xhr}) then you may be changing the model
3535
* without angular knowledge and you may need to call '$updateView()' directly.
3636
*
37-
* NOTE: if you wish to update the view immediately (without delay), you can do so by calling
37+
* Note: if you wish to update the view immediately (without delay), you can do so by calling
3838
* {@link angular.scope.$eval} at any time from your code:
3939
* <pre>scope.$root.$eval()</pre>
4040
*

src/service/xhr.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @name angular.service.$xhr
77
* @function
88
* @requires $browser $xhr delegates all XHR requests to the `$browser.xhr()`. A mock version
9-
* of the $browser exists which allows setting expectaitions on XHR requests
9+
* of the $browser exists which allows setting expectations on XHR requests
1010
* in your tests
1111
* @requires $xhr.error $xhr delegates all non `2xx` response code to this service.
1212
* @requires $log $xhr delegates all exceptions to `$log.error()`.
@@ -83,7 +83,7 @@
8383
* cookie called `XSRF-TOKEN` on first HTTP GET request. On subsequent non-GET requests the server
8484
* can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure that only
8585
* JavaScript running on your domain could have read the token. The token must be unique for each
86-
* user and must be verifiable by the server (to prevent the JavaScript making up its own tokens).
86+
* user and must be verifiable by the server (to prevent the JavaScript making up its own tokens).
8787
* We recommend that the token is a digest of your site's authentication cookie with
8888
* {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}.
8989
*

src/validators.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ extend(angularValidator, {
287287
if (value.match(/^\+\d{2,3} (\(\d{1,5}\))?[\d ]+\d$/)) {
288288
return null;
289289
}
290-
return "Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly.";
290+
return "Phone number needs to be in 1(987)654-3210 format in North America " +
291+
"or +999 (123) 45678 906 internationally.";
291292
},
292293

293294
/**

src/widgets.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @name angular.widget
77
* @description
88
*
9-
* An angular widget can be either a custom attribute that modifies an existing DOM elements or an
9+
* An angular widget can be either a custom attribute that modifies an existing DOM element or an
1010
* entirely new DOM element.
1111
*
1212
* During html compilation, widgets are processed after {@link angular.markup markup}, but before
@@ -39,7 +39,7 @@
3939
* @description
4040
* The most common widgets you will use will be in the form of the
4141
* standard HTML set. These widgets are bound using the `name` attribute
42-
* to an expression. In addition they can have `ng:validate`, `ng:required`,
42+
* to an expression. In addition, they can have `ng:validate`, `ng:required`,
4343
* `ng:format`, `ng:change` attribute to further control their behavior.
4444
*
4545
* @usageContent
@@ -292,7 +292,7 @@ function compileFormatter(expr) {
292292
*
293293
* @description
294294
* The `ng:format` attribute widget formats stored data to user-readable text and parses the text
295-
* back to the stored form. You might find this useful for example if you collect user input in a
295+
* back to the stored form. You might find this useful, for example, if you collect user input in a
296296
* text field but need to store the data in the model as a list. Check out
297297
* {@link angular.formatter formatters} to learn more.
298298
*
@@ -437,7 +437,7 @@ function noopAccessor() { return { get: noop, set: noop }; }
437437
/*
438438
* TODO: refactor
439439
*
440-
* The table bellow is not quite right. In some cases the formatter is on the model side
440+
* The table below is not quite right. In some cases the formatter is on the model side
441441
* and in some cases it is on the view side. This is a historical artifact
442442
*
443443
* The concept of model/view accessor is useful for anyone who is trying to develop UI, and
@@ -1341,12 +1341,12 @@ angularWidget('@ng:repeat', function(expression, element){
13411341
* Sometimes it is necessary to write code which looks like bindings but which should be left alone
13421342
* by angular. Use `ng:non-bindable` to make angular ignore a chunk of HTML.
13431343
*
1344-
* NOTE: `ng:non-bindable` looks like a directive, but is actually an attribute widget.
1344+
* Note: `ng:non-bindable` looks like a directive, but is actually an attribute widget.
13451345
*
13461346
* @element ANY
13471347
*
13481348
* @example
1349-
* In this example there are two location where a siple binding (`{{}}`) is present, but the one
1349+
* In this example there are two location where a simple binding (`{{}}`) is present, but the one
13501350
* wrapped in `ng:non-bindable` is left alone.
13511351
*
13521352
* @example

test/ValidatorsSpec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ describe('ValidatorTest', function(){
6464
});
6565

6666
it('Phone', function() {
67-
var error = "Phone number needs to be in 1(987)654-3210 format in North America or +999 (123) 45678 906 internationaly.";
67+
var error = "Phone number needs to be in 1(987)654-3210 format in North America " +
68+
"or +999 (123) 45678 906 internationally.";
6869
assertEquals(angular.validator.phone("ab"), error);
6970
assertEquals(null, angular.validator.phone("1(408)757-3023"));
7071
assertEquals(null, angular.validator.phone("+421 (0905) 933 297"));

0 commit comments

Comments
 (0)