mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-09 17:10:34 +08:00
docs(debugInfo): add docs for $compileProvider.debugInfoEnabled()
This commit is contained in:
@@ -81,6 +81,7 @@ This is a short list of libraries with specific support and documentation for wo
|
||||
|
||||
### General
|
||||
|
||||
* **Docs Page:** {@link guide/production Running an AngularJS App in Production}
|
||||
* **Javascript minification: **[Background](http://thegreenpizza.github.io/2013/05/25/building-minification-safe-angular.js-applications/), [ng-annotate automation tool](https://github.com/olov/ng-annotate)
|
||||
* **Analytics and Logging:** [Angularyitcs (Google Analytics)](http://ngmodules.org/modules/angularytics), [Angulartics (Analytics)](https://github.com/luisfarzati/angulartics), [Logging Client-Side Errors](http://www.bennadel.com/blog/2542-Logging-Client-Side-Errors-With-AngularJS-And-Stacktrace-js.htm)
|
||||
* **SEO:** [By hand](http://www.yearofmoo.com/2012/11/angularjs-and-seo.html), [prerender.io](http://prerender.io/), [Brombone](http://www.brombone.com/), [SEO.js](http://getseojs.com/), [SEO4Ajax](http://www.seo4ajax.com/)
|
||||
|
||||
42
docs/content/guide/production.ngdoc
Normal file
42
docs/content/guide/production.ngdoc
Normal file
@@ -0,0 +1,42 @@
|
||||
@ngdoc overview
|
||||
@name Running in Production
|
||||
@description
|
||||
|
||||
# Running an AngularJS App in Production
|
||||
|
||||
There are a few things you might consider when running your AngularJS application in production.
|
||||
|
||||
|
||||
## Disabling Debug Data
|
||||
|
||||
By default AngularJS attaches information about scopes to DOM nodes, and adds CSS classes
|
||||
to data-bound elements. The information that is not included is:
|
||||
|
||||
As a result of `ngBind`, `ngBindHtml` or `{{...}}` interpolations, binding data and CSS class
|
||||
`ng-class` is attached to the corresponding element.
|
||||
|
||||
Where the compiler has created a new scope, the scope and either `ng-scope` or `ng-isolated-scope`
|
||||
CSS class are attached to the corresponding element. These scope references can then be accessed via
|
||||
`element.scope()` and `element.isolateScope()`.
|
||||
|
||||
Tools like [Protractor](github.com/angular/protractor) and
|
||||
[Batarang](https://github.com/angular/angularjs-batarang) need this information to run,
|
||||
but you can disable this in production for a significant performance boost with:
|
||||
|
||||
```js
|
||||
myApp.config(['$compileProvider', function ($compileProvider) {
|
||||
$compileProvider.debugInfoEnabled(false);
|
||||
}]);
|
||||
```
|
||||
|
||||
If you wish to debug an application with this information then you should open up a debug
|
||||
console in the browser then call this method directly in this console:
|
||||
|
||||
```js
|
||||
angular.reloadWithDebugInfo();
|
||||
```
|
||||
|
||||
The page should reload and the debug information should now be available.
|
||||
|
||||
For more see the docs pages on {@link ng.$compileProvider#debugInfoEnabled `$compileProvider`}
|
||||
and {@link ng/function/angular.reloadWithDebugInfo `angular.reloadWithDebugInfo`}.
|
||||
Reference in New Issue
Block a user