mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-19 12:01:07 +00:00
doc(devguide) - Fix typos and small grammatical errors in the developer guide.
This commit is contained in:
parent
0ccc445d53
commit
f66836fee4
9 changed files with 20 additions and 20 deletions
|
|
@ -24,7 +24,7 @@ initialization.
|
||||||
</html>
|
</html>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
* Place the `script` tag at the buttom of the page. Placing script tags at the end of the page
|
* Place the `script` tag at the bottom of the page. Placing script tags at the end of the page
|
||||||
improves app load time because the HTML loading is not blocked by loading of the `angular.js`
|
improves app load time because the HTML loading is not blocked by loading of the `angular.js`
|
||||||
script. You can get the latest bits from {@link http://code.angularjs.org}. Please don't link
|
script. You can get the latest bits from {@link http://code.angularjs.org}. Please don't link
|
||||||
your production code to this URL, as it will expose a security hole on your site. For
|
your production code to this URL, as it will expose a security hole on your site. For
|
||||||
|
|
@ -34,12 +34,12 @@ initialization.
|
||||||
* Choose: `angular-[version].min.js` for a compressed and obfuscated file, suitable for use in
|
* Choose: `angular-[version].min.js` for a compressed and obfuscated file, suitable for use in
|
||||||
production.
|
production.
|
||||||
* Place `ng-app` to the root of your application, typically on the `<html>` tag if you want
|
* Place `ng-app` to the root of your application, typically on the `<html>` tag if you want
|
||||||
anugular to auto-bootstrap your application.
|
angular to auto-bootstrap your application.
|
||||||
|
|
||||||
<html ng-app>
|
<html ng-app>
|
||||||
|
|
||||||
* If you choose to use the old style directive syntax `ng:` then include xml-namespace in `html`
|
* If you choose to use the old style directive syntax `ng:` then include xml-namespace in `html`
|
||||||
to make IE happy. (This is here for historical resons, and we no longer recomend use of
|
to make IE happy. (This is here for historical reasons, and we no longer recommend use of
|
||||||
`ng:`.)
|
`ng:`.)
|
||||||
|
|
||||||
<html xmlns:ng="http://angularjs.org">
|
<html xmlns:ng="http://angularjs.org">
|
||||||
|
|
|
||||||
|
|
@ -331,11 +331,11 @@ to entry point of your application (e.g. index.html)
|
||||||
|
|
||||||
### Crawling your app
|
### Crawling your app
|
||||||
|
|
||||||
If you want your AJAX application to be indexed by web crawlers, you rill need to add the following
|
If you want your AJAX application to be indexed by web crawlers, you will need to add the following
|
||||||
meta tag to the HEAD section of your document:
|
meta tag to the HEAD section of your document:
|
||||||
<pre><meta name="fragment" content="!" /></pre>
|
<pre><meta name="fragment" content="!" /></pre>
|
||||||
|
|
||||||
This statement causes a crawler to request links with empty `_escaped_fragment_` parameter so that
|
This statement causes a crawler to request links with an empty `_escaped_fragment_` parameter so that
|
||||||
your server can recognize the crawler and serve it HTML snapshots. For more information about this
|
your server can recognize the crawler and serve it HTML snapshots. For more information about this
|
||||||
technique, see {@link http://code.google.com/web/ajaxcrawling/docs/specification.html Making AJAX
|
technique, see {@link http://code.google.com/web/ajaxcrawling/docs/specification.html Making AJAX
|
||||||
Applications Crawlable}.
|
Applications Crawlable}.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ it('should clear messages after alert', function() {
|
||||||
* {@link dev_guide.services.understanding_services Understanding Angular Services}
|
* {@link dev_guide.services.understanding_services Understanding Angular Services}
|
||||||
* {@link dev_guide.services.creating_services Creating Angular Services}
|
* {@link dev_guide.services.creating_services Creating Angular Services}
|
||||||
* {@link dev_guide.services.managing_dependencies Managing Service Dependencies}
|
* {@link dev_guide.services.managing_dependencies Managing Service Dependencies}
|
||||||
* {@link dev_guide.services.injecting_controllers Injecting Services Into Conrollers}
|
* {@link dev_guide.services.injecting_controllers Injecting Services Into Controllers}
|
||||||
|
|
||||||
## Related API
|
## Related API
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ because first the template (which is the uncompiled HTML along with any addition
|
||||||
directives) is compiled on the browser, and second, the compilation step produces a live view. We
|
directives) is compiled on the browser, and second, the compilation step produces a live view. We
|
||||||
say live because any changes to the view are immediately reflected in the model, and any changes in
|
say live because any changes to the view are immediately reflected in the model, and any changes in
|
||||||
the model are propagated to the view. This makes the model always the single-source-of-truth for
|
the model are propagated to the view. This makes the model always the single-source-of-truth for
|
||||||
the application state, greatly simplifying the programing model for the developer. You can think of
|
the application state, greatly simplifying the programming model for the developer. You can think of
|
||||||
the view as simply an instant projection of your model.
|
the view as simply an instant projection of your model.
|
||||||
|
|
||||||
Because the view is just a projection of the model, the controller is completely separated from the
|
Because the view is just a projection of the model, the controller is completely separated from the
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ this may seem obvious it usually is very difficult to be able to call an individ
|
||||||
typical project. The reason is that the developers often time mix concerns, and they end up with a
|
typical project. The reason is that the developers often time mix concerns, and they end up with a
|
||||||
piece of code which does everything. It reads the data from XHR, it sorts it and then it
|
piece of code which does everything. It reads the data from XHR, it sorts it and then it
|
||||||
manipulates the DOM. With angular we try to make it easy for you to do the right thing, and so we
|
manipulates the DOM. With angular we try to make it easy for you to do the right thing, and so we
|
||||||
provide dependency injection for your XHR (which you can mock out) and we crated abstraction which
|
provide dependency injection for your XHR (which you can mock out) and we created abstraction which
|
||||||
allow you to sort your model without having to resort to manipulating the DOM. So that in the end,
|
allow you to sort your model without having to resort to manipulating the DOM. So that in the end,
|
||||||
it is easy to write a sort function which sorts some data, so that your test can create a data set,
|
it is easy to write a sort function which sorts some data, so that your test can create a data set,
|
||||||
apply the function, and assert that the resulting model is in the correct order. The test does not
|
apply the function, and assert that the resulting model is in the correct order. The test does not
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ simplified as:
|
||||||
});
|
});
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Most directives concern themselves only with instances not with template transformations allowing
|
Most directives concern themselves only with instances, not with template transformations, allowing
|
||||||
further simplification:
|
further simplification:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
@ -342,7 +342,7 @@ compiler}. The attributes are:
|
||||||
`scope: { localFn:'increment()' }`, then isolate scope property `localFn` will point to
|
`scope: { localFn:'increment()' }`, then isolate scope property `localFn` will point to
|
||||||
a function wrapper for the `increment()` expression. Often it's desirable to pass data from
|
a function wrapper for the `increment()` expression. Often it's desirable to pass data from
|
||||||
the isolate scope via an expression and to the parent scope, this can be done by passing a
|
the isolate scope via an expression and to the parent scope, this can be done by passing a
|
||||||
map of local variable names and values into the expression wrapper fn. For example if the
|
map of local variable names and values into the expression wrapper fn. For example, if the
|
||||||
expression is `increment(amount)` then we can specify the amount value by calling the
|
expression is `increment(amount)` then we can specify the amount value by calling the
|
||||||
`localFn` as `localFn({amount: 22})`.
|
`localFn` as `localFn({amount: 22})`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
@description
|
@description
|
||||||
|
|
||||||
Expressions are JavaScript-like code snippets that are usually placed in bindings such as `{{
|
Expressions are JavaScript-like code snippets that are usually placed in bindings such as `{{
|
||||||
expression }}`. Expressions are process by the {@link api/ng.$parse $parse}
|
expression }}`. Expressions are processed by {@link api/ng.$parse $parse}
|
||||||
service.
|
service.
|
||||||
|
|
||||||
For example, these are all valid expressions in angular:
|
For example, these are all valid expressions in angular:
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ The **important** parts are:
|
||||||
|
|
||||||
# Long Version
|
# Long Version
|
||||||
|
|
||||||
IE has an issues with element tag names which are not standard HTML tag names. These fall into two
|
IE has issues with element tag names which are not standard HTML tag names. These fall into two
|
||||||
categories, and each category has its own fix.
|
categories, and each category has its own fix.
|
||||||
|
|
||||||
* If the tag name starts with `my:` prefix than it is considered an XML namespace and must
|
* If the tag name starts with `my:` prefix than it is considered an XML namespace and must
|
||||||
|
|
@ -65,7 +65,7 @@ categories, and each category has its own fix.
|
||||||
* If the tag has no `:` but it is not a standard HTML tag, then it must be pre-created using
|
* If the tag has no `:` but it is not a standard HTML tag, then it must be pre-created using
|
||||||
`document.createElement('my-tag')`
|
`document.createElement('my-tag')`
|
||||||
|
|
||||||
* If you have are planning on styling the custom tag with CSS selectors, then it must be
|
* If you are planning on styling the custom tag with CSS selectors, then it must be
|
||||||
pre-created using `document.createElement('my-tag')` regardless of XML namespace.
|
pre-created using `document.createElement('my-tag')` regardless of XML namespace.
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ result):
|
||||||
</html>
|
</html>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
It should pares into the following DOM:
|
It should parse into the following DOM:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#document
|
#document
|
||||||
|
|
@ -122,12 +122,12 @@ In IE, the behavior is that the `BODY` element has three children:
|
||||||
|
|
||||||
3. A corrupt self closing `/mytag`. This is corrupt since element names are not allowed to have
|
3. A corrupt self closing `/mytag`. This is corrupt since element names are not allowed to have
|
||||||
the `/` character. Furthermore this closing element should not be part of the DOM since it is
|
the `/` character. Furthermore this closing element should not be part of the DOM since it is
|
||||||
only used to delimitate the structure of the DOM.
|
only used to delineate the structure of the DOM.
|
||||||
|
|
||||||
|
|
||||||
## CSS Styling of Custom Tag Names
|
## CSS Styling of Custom Tag Names
|
||||||
|
|
||||||
The to make CSS selector work with custom elements the custom element name must be shived with the
|
To make CSS selectors work with custom elements, the custom element name must be pre-created with
|
||||||
`document.createElement('my-tag')` regardless of XML namespace.
|
`document.createElement('my-tag')` regardless of XML namespace.
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
||||||
|
|
@ -231,9 +231,9 @@ directive listens on DOM events, such as {@link
|
||||||
api/ng.directive:ngClick `ng-click`} it must evaluate the
|
api/ng.directive:ngClick `ng-click`} it must evaluate the
|
||||||
expression inside the `$apply` method.
|
expression inside the `$apply` method.
|
||||||
|
|
||||||
After evaluating the expression `$apply` method performs a {@link
|
After evaluating the expression, the `$apply` method performs a {@link
|
||||||
api/ng.$rootScope.Scope#$digest `$digest`}. In $digest phase the scope examines all
|
api/ng.$rootScope.Scope#$digest `$digest`}. In the $digest phase the scope examines all
|
||||||
of the `$watch` expressions and compares them with previous value. This dirty checking, is done
|
of the `$watch` expressions and compares them with the previous value. This dirty checking is done
|
||||||
asynchronously. This means that assignment such as `$scope.username="angular"` will not
|
asynchronously. This means that assignment such as `$scope.username="angular"` will not
|
||||||
immediately cause a `$watch` to be notified, instead the `$watch` notification is delayed until
|
immediately cause a `$watch` to be notified, instead the `$watch` notification is delayed until
|
||||||
the `$digest` phase. This delay is desirable, since it coalesces multiple model updates into one
|
the `$digest` phase. This delay is desirable, since it coalesces multiple model updates into one
|
||||||
|
|
@ -250,7 +250,7 @@ the `$digest` phase. This delay is desirable, since it coalesces multiple model
|
||||||
2. **Watcher registration**
|
2. **Watcher registration**
|
||||||
|
|
||||||
During template linking directives register {@link
|
During template linking directives register {@link
|
||||||
api/ng.$rootScope.Scope#$watch watches} on the scope. This watches will be
|
api/ng.$rootScope.Scope#$watch watches} on the scope. These watches will be
|
||||||
used to propagate model values to the DOM.
|
used to propagate model values to the DOM.
|
||||||
|
|
||||||
3. **Model mutation**
|
3. **Model mutation**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue