ngTouch.$swipe

service in module ngTouch The $swipe service is a service that abstracts the messier details of hold-and-drag swipe behavior, to make implementing swipe-related directives more convenient. Requires the ngTouch module to be installed. $swipe is used by the ngSwipeLeft and ngSwipeRight directives in ngTouch. Usage The $swipe service is an object with a single method: bind. bind takes an element which is to be watched for swipes, and an object with four handler functions. See the documentatio

ngTouch

Installation First include angular-touch.js in your HTML: <script src="angular.js"> <script src="angular-touch.js"> You can download this file from the following places: Google CDN e.g. //ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-touch.js Bower e.g. bower install angular-touch@X.Y.Z code.angularjs.org e.g. "//code.angularjs.org/X.Y.Z/angular-touch.js" where X.Y.Z is the AngularJS version you are running. Then load the module in your application by adding it as a

ngSwitch

directive in module ng The ngSwitch directive is used to conditionally swap DOM structure on your template based on a scope expression. Elements within ngSwitch but without ngSwitchWhen or ngSwitchDefault directives will be preserved at the location as specified in the template. The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it from the template cache), ngSwitch simply chooses one of the nested elements and makes it visible based

ngSubmit

directive in module ng Enables binding angular expressions to onsubmit events. Additionally it prevents the default action (which for form means sending the request to the server and reloading the current page), but only if the form does not contain action, data-action, or x-action attributes. Warning: Be careful not to cause "double-submission" by using both the ngClick and ngSubmit handlers together. See the form directive documentation for a detailed discussion of when ngSubmit may be

ngStyle

directive in module ng The ngStyle directive allows you to set CSS style on an HTML element conditionally. Directive Info This directive executes at priority level 0. Usage as attribute: <ANY ng-style="expression"> ... </ANY> as CSS class: <ANY class="ng-style: expression;"> ... </ANY> Arguments Param Type Details ngStyle expression Expression which evals to an object whose keys are CSS style names and values are corresponding values for those CSS keys.

ngSrcset

directive in module ng Using Angular markup like {{hash}} in a srcset attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrcset directive solves this problem. The buggy way to write it: <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description"/> The correct way to write it: <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description" />

ngSrc

directive in module ng Using Angular markup like {{hash}} in a src attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrc directive solves this problem. The buggy way to write it: <img src="http://www.gravatar.com/avatar/{{hash}}" alt="Description"/> The correct way to write it: <img ng-src="http://www.gravatar.com/avatar/{{hash}}" alt="Description" /> Directive Info T

ngShow

directive in module ng The ngShow directive shows or hides the given HTML element based on the expression provided to the ngShow attribute. The element is shown or hidden by removing or adding the .ng-hide CSS class onto the element. The .ng-hide CSS class is predefined in AngularJS and sets the display style to none (using an !important flag). For CSP mode please add angular-csp.css to your html file (see ngCsp). <!-- when $scope.myValue is truthy (element is visible) --> <div ng

ngSelected

directive in module ng Sets the selected attribute on the element, if the expression inside ngSelected is truthy. A special directive is necessary because we cannot use interpolation inside the selected attribute. See the interpolation guide for more info. Directive Info This directive executes at priority level 100. Usage as attribute: <OPTION ng-selected="expression"> ... </OPTION> Arguments Param Type Details ngSelected expression If the expression is truthy, the

ngSanitize.service

Name Description $sanitize Sanitizes an html string by stripping all potentially dangerous tokens.