From a0e8c45880c71838fc92a9251b278d507b30dec9 Mon Sep 17 00:00:00 2001
From: Igor Minar
Date: Tue, 23 Nov 2010 16:10:14 -0800
Subject: docs for angular.Array.remove
---
src/apis.js | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
(limited to 'src/apis.js')
diff --git a/src/apis.js b/src/apis.js
index e39c7c04..e17447eb 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -66,6 +66,44 @@ var angularArray = {
* @ngdoc function
* @name angular.Array.remove
* @function
+ *
+ * @description
+ * Modifies `array` by removing an element from it. The element will be looked up using the
+ * {@link angular.Array.indexOf indexOf} function on the `array` and only the first instance of
+ * the element will be removed.
+ *
+ * @param {Array} array Array from which an element should be removed.
+ * @param {*} value Element to be removed.
+ * @returns {*} The removed element.
+ *
+ * @example
+
+
+ tasks = {{tasks}}
+
+ @scenario
+ it('should initialize the task list with for tasks', function() {
+ expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(4);
+ expect(repeater('.doc-example ul li', 'task in tasks').column('task')).
+ toEqual(['Learn Angular', 'Read Documentation', 'Check out demos',
+ 'Build cool applications']);
+ });
+
+ it('should initialize the task list with for tasks', function() {
+ element('.doc-example ul li a:contains("X"):first').click();
+ expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(3);
+
+ element('.doc-example ul li a:contains("X"):last').click();
+ expect(repeater('.doc-example ul li', 'task in tasks').count()).toBe(2);
+
+ expect(repeater('.doc-example ul li', 'task in tasks').column('task')).
+ toEqual(['Read Documentation', 'Check out demos']);
+ });
*/
'remove':function(array, value) {
var index = indexOf(array, value);
--
cgit v1.2.3