diff options
| author | Igor Minar | 2011-06-15 22:31:40 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-06-15 22:31:40 -0700 |
| commit | b842642b574a2b95c53b791308ed1bf8ff9d304d (patch) | |
| tree | fb26431c5372be74de2105df77e94dea4f198489 /docs/content/misc | |
| parent | d428c9910e66246c2af46602499acaeaf187d75b (diff) | |
| download | angular.js-b842642b574a2b95c53b791308ed1bf8ff9d304d.tar.bz2 | |
docs - stripping extra new lines
Diffstat (limited to 'docs/content/misc')
| -rw-r--r-- | docs/content/misc/contribute.ngdoc | 108 | ||||
| -rw-r--r-- | docs/content/misc/downloading.ngdoc | 16 | ||||
| -rw-r--r-- | docs/content/misc/faq.ngdoc | 29 | ||||
| -rw-r--r-- | docs/content/misc/started.ngdoc | 46 |
4 files changed, 0 insertions, 199 deletions
diff --git a/docs/content/misc/contribute.ngdoc b/docs/content/misc/contribute.ngdoc index 2a398400..d519a819 100644 --- a/docs/content/misc/contribute.ngdoc +++ b/docs/content/misc/contribute.ngdoc @@ -3,8 +3,6 @@ @description - - * <a href="#H1_1">License</a> * <a href="#H1_2">Contributing to Source Code</a> * <a href="#H1_3">Applying Code Standards</a> @@ -12,349 +10,243 @@ * <a href="#H1_5">Submitting Your Changes</a> - - <a name="H1_1"></a> # License - `Angular` is an open source project licensed under the {@link http://github.com/angular/angular.js/blob/master/LICENSE MIT license}. Your contributions are always welcome. When working with `angular` source base, please follow the guidelines provided on this page. - - <a name="H1_2"></a> # Contributing to Source Code - We'd love for you to contribute to our source code and to make `angular` even better than it is today! Here are the guidelines we'd like you to use: - * Major changes that you intend to contribute to the project must be discussed first on our {@link https://groups.google.com/forum/?hl=en#!forum/angular mailing list} so that we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted upstream. - * Small changes and bug fixes can be crafted and submitted to Github as a <a href="#H1_5">pull request</a>. - - - <a name="H1_3"></a> # Applying Code Standards - To ensure consistency throughout the source code, keep these rules in mind as you are working: - * All features or bug fixes must be tested by one or more <a href="#unit-tests">specs</a>. - * All public API methods must be documented with ngdoc, an extended version of jsdoc (we added support for markdown and templating via `@ngdoc` tag). To see how we document our APIs, please check out the existing ngdocs. - * With the exceptions listed below, we follow the rules contained in {@link http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml Google's JavaScript Style Guide}: - * Do not use namespaces: Instead, we wrap the entire `angular` code base in an anonymous closure and export our API explicitly rather than implicitly. - * Wrap all code at 100 characters. - * Instead of complex inheritance hierarchies, we prefer simple objects. We use prototypical inheritance only when absolutely necessary. - * We love functions and closures and, whenever possible, prefer them over objects. - * To write concise code that can be better minified, internally we use aliases that map to the external API. See our existing code to see what we mean. - * We don't go crazy with type annotations for private internal APIs unless it's an internal API that is used throughout `angular`. The best guidance is to do what makes the most sense. - - <a name="H1_4"></a> # Checking Out and Building Angular - The `angular` source code is hosted at {@link http://github.com Github}, which we also use to accept code contributions. Several steps are needed to check out and build `angular`: - - ## Installation Dependencies - Before you can build `angular`, you must install or configure the following dependencies on your machine: - * {@link http://rake.rubyforge.org Rake}: We use Rake as our build system, which is pre-installed on most Macintosh and Linux machines. If that is not true in your case, you can grab it from the Rake website. - * {@link http://nodejs.org Node.js}: We use Node to generate the documentation and to run a development web server. Depending on your system, you can install Node either from source or as a pre-packaged bundle. - * Java: The Java runtime is used to run {@link http://code.google.com/p/js-test-driver JsTestDriver} (JSTD), which we use to run our unit test suite. JSTD binaries are part of the `angular` source base, which means there is no need to install or configure it separately. - * Git: The {@link http://help.github.com/mac-git-installation Github Guide to Installing Git} is quite a good source for information on Git. - - ## Creating a Github Account and Forking Angular - To create a Github account, follow the instructions {@link https://github.com/signup/free here}. Afterwards, go ahead and {@link http://help.github.com/forking fork} the {@link https://github.com/angular/angular.js main angular repository}. - - ## Building `Angular` - To build `angular`, you check out the source code and use Rake to generate the non-minified and minified `angular` files: - 1. To clone your Github repository, run: - git clone git@github.com:<github username>/angular.js.git - 2. To go to the `angular` directory, run: - cd angular.js - 3. To add the main `angular` repository as an upstream remote to your repository, run: - git remote add upstream https://github.com/angular/angular.js.git - 4. To build `angular`, run: - rake package - The build output can be located under the `build` directory. It consists of the following files and directories: - * `angular-<version>.tgz` — This is the complete tarball, which contains all of the release build artifacts. - * `angular.js` — The non-minified `angular` script. - * `angular.min.js` — The minified `angular` script. - * `angular-scenario.js` — The `angular` End2End test runner. - * `angular-ie-compat.js` — The Internet Explorer compatibility patch file. - * `docs/` — A directory that contains all of the files needed to run `docs.angularjs.org`. - * `docs/index.html` — The main page for the documentation. - * `docs/docs-scenario.html` — The End2End test runner for the documentation application. - - ## Running a Local Development Web Server - To debug or test code, it is often useful to have a local HTTP server. For this purpose, we have made available a local web server based on Node.js. - 1. To start the web server, run: - ./nodeserver.sh - 2. To access the local server, go to this website: - http://localhost:8000/ - By default, it serves the contents of the `angular` project directory. - - <a name="unit-tests"></a> ## Running the Unit Test Suite - Our unit and integration tests are written with Jasmine and executed with JsTestDriver. To run the tests: - 1. To start the JSTD server, run: - ./server.sh - 2. To capture one or more browsers, go to this website: - http://localhost:9876/ - 3. To trigger a test execution, run: - ./test.sh - 4. To automatically run the test suite each time one or more of the files in the project directory is changed, you can install `watchr` and then run: - watchr watchr.rb - 5. To view the output of each test run, you can tail this log file: - ./logs/jstd.log - - ## Running the End2End Test Suite - To run the End2End test suite: - 1. Start the local web server. 2. In a browser, go to: - http://localhost:8000/build/docs/docs-scenario.html - The tests are executed automatically. - - - <a name="H1_5"></a> # Submitting Your Changes - To create and submit a change: - 1. Create a new branch off the master for your changes: - git branch my-fix-branch - 2. Check out the branch: - git checkout my-fix-branch - 3. Create your patch, make sure to have plenty of tests (that pass). - 4. Commit your changes: - git commit -a - 5. Run JavaScript Lint and be sure to address all new warnings and errors: - rake lint - 6. Push your branch to Github: - git push origin my-fix-branch - 7. In Github, send a pull request to `angular:master`. - 8. When the patch is reviewed and merged, delete your branch and pull yours — and other — changes from the main (upstream) repository: 1. To delete the branch in Github, run: - git push origin :my-fix-branch - 2. To check out the master branch, run: - git checkout master - 3. To delete a local branch, run: - git branch -D my-fix-branch - 4. To update your master with the latest upstream version, run: - git pull --ff upstream master - That's it! Thank you for your contribution! diff --git a/docs/content/misc/downloading.ngdoc b/docs/content/misc/downloading.ngdoc index 9406d49c..f111991f 100644 --- a/docs/content/misc/downloading.ngdoc +++ b/docs/content/misc/downloading.ngdoc @@ -3,27 +3,22 @@ @name Downloading @description - # Including angular scripts from the angular server The quickest way to get started is to point your html `<script>` tag to a <http://code.angularjs.org/> URL. This way, you don't have to download anything or maintain a local copy. - There are two types of angular script URLs you can point to, one for development and one for production: - * __angular-<version>.js__ — This is the human-readable, non-minified version, suitable for web development. * __angular-<version>.min.js__ — This is the minified version, which we strongly suggest you use in production. - To point your code to an angular script on the angular server, use the following template. This example points to (non-minified) version 0.9.12: - <pre> <!doctype html> <html xmlns:ng="http://angularjs.org"> @@ -37,51 +32,40 @@ example points to (non-minified) version 0.9.12: </pre> - - # Downloading and hosting angular files locally This option is for those who want to work with angular offline, or those who want to host the angular files on their own servers. - If you navigate to <http://code.angularjs.org/>, you'll see a directory listing with all of the angular versions since we started releasing versioned build artifacts (quite late in the project lifetime). Each directory contains all artifacts that we released for a particular version. Download the version you want and have fun. - Each directory under <http://code.angularjs.org/> includes the following set of files: - * __`angular-<version>.js`__ — This file is non-obfuscated, non-minified, and human-readable by opening it it any editor or browser. In order to get better error messages during development, you should always use this non-minified angular script. - * __`angular-<version>.min.js`__ — This is a minified and obfuscated version of `angular-<version>.js` created with the Closure compiler. Use this version for production in order to minimize the size of the application that is downloaded by your user's browser. - * __`angular-<version>.tgz`__ — This is a tarball archive that contains all of the files released for this angular version. Use this file to get everything in a single download. - * __`angular-ie-compat-<version>.js`__ — This is a special file that contains code and data specifically tailored for getting Internet Explorer to work with angular. If you host your own copy of angular files, make sure that this file is available for download, and that it resides under the same parent path as `angular-<version>.js` or `angular-<version>.min.js`. - * __`angular-mocks-<version>.js`__ — This file contains an implementation of mocks that makes testing angular apps even easier. Your unit/integration test harness should load this file after `angular-<version>.js` is loaded. - * __`angular-scenario-<version>.js`__ — This file is a very nifty JavaScript file that allows you to write and execute end-to-end tests for angular applications. - * __`docs-<version>`__ — this directory contains all the files that compose the <http://docs.angularjs.org/> documentation app. These files are handy to see the older version of our docs, or even more importantly, view the docs offline. diff --git a/docs/content/misc/faq.ngdoc b/docs/content/misc/faq.ngdoc index 8e52660b..cf9f2647 100644 --- a/docs/content/misc/faq.ngdoc +++ b/docs/content/misc/faq.ngdoc @@ -3,49 +3,36 @@ @name FAQ @description - #FAQ - ### Why is this project called "angular"? Why is the namespace called "ng"? - Because HTML has angular brackets and "ng" sounds like "angular". - ### Is <angular/> an HTML5 tag? - No, <angular/> is not an HTML5 tag. angular is an orthogonal project to HTML5; you can use the two together. - ### Is angular a {library, framework, DOM manipulation library, widget library, native plugin}? - No, angular is none of these. You don't call its functions, it does not call your functions, it does not provide a way to manipulate DOM, but does provide primitives to create UI projections of your data. There are lots of existing widget libraries which you can integrate with angular. It is 100% JavaScript, 100% client side and compatible with both desktop and mobile browsers. - ### Do I need to worry about security holes in angular? - Like with any technology, angular is not impervious to attack. angular does, however, provide built-in protection from basic security holes including cross-site scripting and HTML injection attacks. angular does round-trip escaping on all strings for you. - ### Can I download the source, build, and host the angular environment locally? - Yes. See instructions in {@link downloading}. - ### Is angular a templating system? - At the highest level, angular does look like a just another templating system. But there is one important reason why angular templating system is different and makes it very good fit for application development: bidirectional data binding. The template is compiled on the browser and @@ -53,59 +40,43 @@ the compilation step produces a live view. This means you, the developer, don't code to constantly sync the view with the model and the model with the view as in other templating systems. - ### What browsers does angular work with? - Webkit-based browsers (Safari, Chrome, iPhone, Android, WebOS, BlackBerry 6), Firefox, IE6 and above. Note that CSS only works on IE7 and above. - ### What's angular's performance like? - angular takes ~300ms to load, render, and compile. In Chrome it uses about 2-5MB of memory. Your app's performance will vary depending on how many bindings you use. - ### How big is the angular bootstrap JS file that I need to include? - The size of the library itself is < 50KB compressed and obfuscated. - ### Can I use the open-source Closure Library with angular? - Yes, you can use widgets from the {@link http://code.google.com/closure/library Closure Library} in angular. - ### Does angular use the jQuery library? - Yes, angular uses {@link http://jquery.com/ jQuery}, the open source DOM manipulation library. If jQuery is not present in your script path, angular falls back on its own implementation of {@link api/angular.element jQuery lite}. If jQuery is present in the path, angular uses it to manipulate the DOM. - ### What is testability like in angular? - Very testable. It has an integrated dependency injection framework. See {@link api/angular.service service} for details. - ### How can I learn more about angular? - Watch the July 28, 2010 talk "{@link http://www.youtube.com/watch?v=elvcgVSynRg| Angular: A Radically Different Way of Building AJAX Apps}". - ### How is angular licensed? - The MIT License. diff --git a/docs/content/misc/started.ngdoc b/docs/content/misc/started.ngdoc index b162a8f8..7ea8015c 100644 --- a/docs/content/misc/started.ngdoc +++ b/docs/content/misc/started.ngdoc @@ -2,89 +2,69 @@ @name Getting Started @description - # Hello World! - A great way for you to get started with `angular` is to create the tradtional "Hello World!" app: - 1. In your favorite text editor, create an HTML file (for example, `helloworld.html`). 2. From the __Source__ box below, copy and paste the code into your HTML file. (Double-click on the source to easily select all.) 3. Open the file in your web browser. - <doc:example> <doc:source> Hello {{'World'}}! </doc:source> </doc:example> - The resulting web page should look something like the following: - <img class="center" src="img/helloworld.png" border="1" /> - Now let's take a closer look at that code, and see what is going on behind the scenes. - The first line of interest defines the `ng` namespace, which makes `angular` work across all browsers (especially important for IE): - <pre> <html xmlns:ng="http://angularjs.org"> </pre> - The next line downloads the `angular` script, and instructs `angular` to process the entire HTML page when it is loaded: - <pre> <script type="text/javascript" src="http://code.angularjs.org/angular-?.?.?.min.js" ng:autobind></script> </pre> - (For details on what happens when `angular` processes an HTML page, see {@link guide/dev_guide.bootstrap Bootstrap}.) - Finally, this line in the `<body>` of the page is the template that describes how to display our greeting in the UI: - <pre> Hello {{'World'}}! </pre> - Note the use of the double curly brace markup (`{{ }}`) to bind the expression to the greeting text. Here the expression is the string literal 'World'. - Next let's look at a more interesting example, that uses `angular` to bind a dynamic expression to our greeting text. - # Hello <angular/> World! - This example demonstrates `angular`'s two-way data binding: - 1. Edit the HTML file you created in the "Hello World!" example above. 2. Replace the contents of `<body>` with the code from the __Source__ box below. 3. Refresh your browswer window. - <doc:example> <doc:source> Your name: <input type="text" name="yourname" value="World"/> @@ -93,24 +73,18 @@ This example demonstrates `angular`'s two-way data binding: </doc:source> </doc:example> - After the refresh, the page should look something like this: - <img class="left" src="img/helloworld_2way.png" border="1" /> - These are some of the important points to note from this example: - * The text input {@link api/angular.widget widget} called `yourname` is bound to a model variable called `yourname`. * The double curly braces notation binds the `yourname` model to the greeting text. - * You did not need to explicitly register an event listener or define an event handler for events! - Now try typing your name into the input box, and notice the immediate change to the displayed greeting. This demonstrates the concept of `angular`'s {@link guide/dev_guide.templates.databinding bi-directional data binding}. Any changes to the input @@ -119,70 +93,50 @@ reflected in the model (one direction), and any changes to the model are reflected in the greeting text (the other direction). - - # Anatomy Of An Angular App - This section describes the 3 parts of an angular app, and explains how they map to the Model-View-Controller design pattern: - ## Templates - Templates, which you write in HTML and CSS, serve as the View. You add elements, attributes, and markup to HTML, which serve as instructions to the angular compiler. The angular compiler is fully extensible, meaning that with angular you can build your own declarative language on top of HTML! - - ## Application Logic and Behavior - Application Logic and Behavior, which you define in JavaScript, serve as the Controller. With angular (unlike with standard AJAX applications) you don't need to write additional listeners or DOM manipulators, because they are built-in. This feature makes your application logic very easy to write, test, maintain, and understand. - - ## Data - The Model is referenced from properties on {@link guide/dev_guide.scopes angular scope objects}. The data in your model could be Javascript objects, arrays, or primitives, it doesn't matter. What matters is that these are all referenced by the scope object. - Angular employs scopes to keep your data model and your UI in sync. Whenever something occurs to change the state of the model, angular immediately reflects that change in the UI, and vice versa. - The following illustration shows the parts of an angular application and how they work together: - <img class="left" src="img/angular_parts.png" border="0" /> - In addition, angular comes with a set of Services, which have the following properties: - * The services provided are very useful for building web applications. * You can extend and add application-specific behavior to services. * Services include Dependency-Injection, XHR, caching, URL routing, and browser abstraction. - - # Where To Go Next - * For explanations and examples of the angular concepts presented on this page, see the {@link guide/index Developer Guide}. - * For additional hands-on examples of using `angular`, including more source code that you can copy and paste into your own pages, take a look through the `angular` {@link cookbook/ Cookbook}. |
