Contents |
What is <angular/>?
<angular/> is what HTML would have been if it had been designed for building web applications. It provides your application’s plumbing so you can focus on what your app does, rather than how to get your web browser to do what you need.
Complexity kills. Use <angular/>. Here’s why:
- Write less code. A lot less. Forget about writing all that extra JavaScript to handle event listeners, DOM updates, formatters, and input validators. <angular/> comes with autobinding and built-in validators and formatters which take care of these. And you can extend or replace these services at will. With these and other services, you’ll write about 10x less code than writing your app without <angular/>.
- Automatic view/model synchronization. Tired of writing code to keep your view and model in sync? Thanks to <angular/>’s 2-way data binding, your model is always the single source of truth for your application state and your view is simply a projection of your model. You are only responsible for your business logic in a controller and the associated HTML template.
- No setup. Nothing to download. No server required. No compilers to configure. No environment variables to set. <angular/>’s UI templates run on the client so you never have to wait on the server to see your changes in the application.
- Readable code that is easy to maintain. <angular/> apps are specified declaratively through custom HTML tags and attributes that specify the intent of your application. By defining UI templates and widgets in HTML, you can read <angular/> code and understand what it’s supposed to do. Plus, less code means less to read, maintain and test.
- Testable code. <angular/> comes with a set of services that are useful for building web apps. The services are dependency injected, which makes it easy to swap services or create mocks for testing. Some services are: history management, URL router, XHR requests, and data caching out of the box.
- Build reusable components with trivial effort. <angular/> lets you write UI templates and widgets that you can reuse throughout your app.
- Plays well with others. You can easily use <angular/> with the frameworks and libraries that you are already using. Mix and match functionality freely.
Sounds awesome. But what parts do I need to write?
- HTML and CSS: Standard HTML plus custom tags, which bring dynamic nature to HTML.
- Controllers: <angular/> apps follow the model-view-controller pattern. You’re responsible for the logic that's custom to your application.
- (optional) Server-side data service. Write this in your technology of choice.
How do I get started with <angular/>?
- Work through the Getting Started example.
- Check out more examples in Cookbook.
- Read the Developer Guide.