$interval.cancel()

cancel([promise]); Cancels a task associated with the promise. Parameters Param Type Details promise (optional) Promise returned by the $interval function. Returns boolean Returns true if the task was successfully canceled.

ngTouch.$touch

$touchProvider service in module ngTouch Provides the ngClickOverrideEnabled method. Methods ngClickOverrideEnabled(); Returns * current value of ngClickOverrideEnabled set in the $touchProvider, i.e. if ngTouch's ngClick directive is enabled.

ngMock.$httpBackend.resetExpectations()

resetExpectations(); Resets all request expectations, but preserves all backend definitions. Typically, you would call resetExpectations during a multiple-phase test when you want to reuse the same instance of $httpBackend mock.

$animate.enter()

enter(element, parent, [after], [options]); Inserts the element into the DOM either after the after element (if provided) or as the first child within the parent element and then triggers an animation. A promise is returned that will be resolved during the next digest once the animation has completed. Parameters Param Type Details element DOMElement the element which will be inserted into the DOM parent DOMElement the parent element which will append the element as a child (so long

$animate.addClass()

addClass(element, className, [options]); Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon execution, the addClass operation will only be handled after the next digest and it will not trigger an animation if element already contains the CSS class or if the class is removed at a later step. Note that class-based animations are treated differently compared to structural animations (like enter, move and leave) since the CSS classes may be added/removed at

$anchorScrollProvider

$anchorScroll provider in module ng Use $anchorScrollProvider to disable automatic scrolling whenever $location.hash() changes. Methods disableAutoScrolling(); By default, $anchorScroll() will automatically detect changes to $location.hash() and scroll to the element matching the new hash. Use this method to disable automatic scrolling. If automatic scrolling is disabled, one must explicitly call $anchorScroll() in order to scroll to the element related to the current hash.

$anchorScroll.yOffset

yOffset numberfunction()jqLite If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc. yOffset can be specified in various ways: number: A fixed number of pixels to be used as offset. function: A getter function called everytime $anchorScroll() is executed. Must return a number representing the offset (in pixels). jqLite: A jqLite/jQuery element to be used for specifying the offset. The

ngRoute.ngView

directive in module ngRoute Overview ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service. Requires the ngRoute module to be installed. Directive Info This directive creates new scope. This directive executes at priority level 400. Usage as element: (This directive

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

ngMockE2E.$httpBackend.whenJSONP()

whenJSONP(url, [keys]); Creates a new backend definition for JSONP requests. For more info see when(). Parameters Param Type Details url stringRegExpfunction(string) HTTP url or function that receives a url and returns true if the url matches the current definition. keys (optional) Array Array of keys to assign to regex matches in request url described on $httpBackend mock. Returns requestHandler Returns an object with respond and passThrough methods that control how a matched