input[email]

input in module ng Text input with email validation. Sets the email validation error key if not a valid email address. Note: input[email] uses a regex to validate email addresses that is derived from the regex used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can use ng-pattern or modify the built-in validators (see the Forms guide) Directive Info This directive executes at priority level 0. Usage <input type="email" ng-model="string"

input[date]

input in module ng Input with date validation and transformation. In browsers that do not yet support the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 date format (yyyy-MM-dd), for example: 2009-01-06. Since many modern browsers do not yet support this input type, it is important to provide cues to users on the expected input format via a placeholder or label. The model must always be a Date object, otherwise Angular will throw an er

input[datetime-local]

input in module ng Input with datetime validation and transformation. In browsers that do not yet support the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 local datetime format (yyyy-MM-ddTHH:mm:ss), for example: 2010-12-28T14:57:00. The model must always be a Date object, otherwise Angular will throw an error. Invalid Date objects (dates whose getTime() is NaN) will be rendered as an empty string. The timezone to be used to read

input[checkbox]

input in module ng HTML checkbox. Directive Info This directive executes at priority level 0. Usage <input type="checkbox" ng-model="string" [name="string"] [ng-true-value="expression"] [ng-false-value="expression"] [ng-change="string"]> Arguments Param Type Details ngModel string Assignable angular expression to data-bind to. name (optional) string Property name of the form under which the control is published. ngTrueValue (optional)

input

directive in module ng HTML input element control. When used together with ngModel, it provides data-binding, input state control, and validation. Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. Note: Not every feature offered is available for all input types. Specifically, data binding and event handling via ng-model is unsupported for input[file]. Directive Info This directive executes at priority level 0. Usage as element: <

Guide: Unit Testing

Improve this Doc JavaScript is a dynamically typed language which comes with great power of expression, but it also comes with almost no help from the compiler. For this reason we feel very strongly that any code written in JavaScript needs to come with a strong set of tests. We have built many features into Angular which make testing your Angular applications easy. With Angular, there is no excuse for not testing. Separation of Concerns Unit testing, as the name implies, is about testing ind

Guide: Templates

In Angular, templates are written with HTML that contains Angular-specific elements and attributes. Angular combines the template with information from the model and controller to render the dynamic view that a user sees in the browser. These are the types of Angular elements and attributes you can use: Directive â An attribute or element that augments an existing DOM element or represents a reusable DOM component. Markup â The double curly brace notation {{ }} to bind expressions to elements

Guide: Services

Angular services are substitutable objects that are wired together using dependency injection (DI). You can use services to organize and share code across your app. Angular services are: Lazily instantiated â Angular only instantiates a service when an application component depends on it. Singletons â Each component dependent on a service gets a reference to the single instance generated by the service factory. Angular offers several useful services (like $http), but for most applications you

Guide: Security

This document explains some of AngularJS's security features and best practices that you should keep in mind as you build your application. Reporting a security issue Email us at security@angularjs.org to report any potential security issues in AngularJS. Please keep in mind the points below about Angular's expression language. Use the latest AngularJS possible Like any software library, it is critical to keep AngularJS up to date. Please track the CHANGELOG and make sure you are aware of upcom

Guide: Scopes

Scope is an object that refers to the application model. It is an execution context for expressions. Scopes are arranged in hierarchical structure which mimic the DOM structure of the application. Scopes can watch expressions and propagate events. Scope characteristics Scopes provide APIs ($watch) to observe model mutations. Scopes provide APIs ($apply) to propagate any model changes through the system into the view from outside of the "Angular realm" (controllers, services, Angular event ha