mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
how-to's fixed slashes in code comments
This commit is contained in:
@@ -134,12 +134,12 @@ export var test_ObservableArray_popShouldRemoveTheLastElementAndRaiseChangeEvent
|
||||
// << (hide)
|
||||
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "delete".
|
||||
//// args.index is equal to the array length - 1.
|
||||
//// args.removed.length is 1.
|
||||
//// args.addedCount is 0.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "delete".
|
||||
// args.index is equal to the array length - 1.
|
||||
// args.removed.length is 1.
|
||||
// args.addedCount is 0.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -173,12 +173,12 @@ export var test_ObservableArray_pushShouldAppendNewElementAndRaiseChangeEventWit
|
||||
// >> observable-array-change-push
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "add".
|
||||
//// args.index is equal to the array length.
|
||||
//// args.removed.length is 0.
|
||||
//// args.addedCount is 1.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "add".
|
||||
// args.index is equal to the array length.
|
||||
// args.removed.length is 0.
|
||||
// args.addedCount is 1.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -212,12 +212,12 @@ export var test_ObservableArray_pushShouldAppendNewElementsAndRaiseChangeEventWi
|
||||
// >> observable-array-push-multiple-info
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "add".
|
||||
//// args.index is equal to the array length.
|
||||
//// args.removed.length is 0.
|
||||
//// args.addedCount is equal to the number of added items.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "add".
|
||||
// args.index is equal to the array length.
|
||||
// args.removed.length is 0.
|
||||
// args.addedCount is equal to the number of added items.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -251,12 +251,12 @@ export var test_ObservableArray_pushShouldAppendNewElementsFromSourceArrayAndRai
|
||||
// >> observable-array-push-source-info
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "add".
|
||||
//// args.index is equal to the array length.
|
||||
//// args.removed.length is 0.
|
||||
//// args.addedCount is equal to the number of added items.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "add".
|
||||
// args.index is equal to the array length.
|
||||
// args.removed.length is 0.
|
||||
// args.addedCount is equal to the number of added items.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -299,12 +299,12 @@ export var test_ObservableArray_shiftShouldRemoveTheFirstElementAndRaiseChangeEv
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "delete".
|
||||
//// args.index is 0.
|
||||
//// args.removed.length is 1.
|
||||
//// args.addedCount is 0.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "delete".
|
||||
// args.index is 0.
|
||||
// args.removed.length is 1.
|
||||
// args.addedCount is 0.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -372,12 +372,12 @@ export var test_ObservableArray_spliceShouldRemoveSpecifiedNumberOfElementsStart
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "splice".
|
||||
//// args.index is the start index.
|
||||
//// args.removed.length is equal to the number of deleted items.
|
||||
//// args.addedCount is 0.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "splice".
|
||||
// args.index is the start index.
|
||||
// args.removed.length is equal to the number of deleted items.
|
||||
// args.addedCount is 0.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -407,12 +407,12 @@ export var test_ObservableArray_spliceShouldRemoveAndInertSpecifiedNumberOfEleme
|
||||
var array = new observableArrayModule.ObservableArray(["one", "two", "three"]);
|
||||
|
||||
array.on(observableArrayModule.ObservableArray.changeEvent, (args: observableArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "splice".
|
||||
//// args.index is the start index.
|
||||
//// args.removed.length is equal to the number of deleted items.
|
||||
//// args.addedCount is equal to the delta between number of inserted items and number of deleted items but not less than 0.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "splice".
|
||||
// args.index is the start index.
|
||||
// args.removed.length is equal to the number of deleted items.
|
||||
// args.addedCount is equal to the delta between number of inserted items and number of deleted items but not less than 0.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
|
||||
@@ -25,7 +25,7 @@ export var test_Observable_Constructor = function () {
|
||||
var name = person.get("Name");
|
||||
var age = person.get("Age");
|
||||
var married = person.get("Married");
|
||||
//// console.log(name + " " + age + " " + married); // Prints out "John 34 true" if uncommented.
|
||||
// console.log(name + " " + age + " " + married); // Prints out "John 34 true" if uncommented.
|
||||
// << observable-creating
|
||||
TKUnit.assert(name === "John", "Expected name is John");
|
||||
TKUnit.assert(age === 34, "Expected age is 34");
|
||||
@@ -43,9 +43,9 @@ export var tests_DummyTestForCodeSnippet = function () {
|
||||
});
|
||||
person.set("Age", 35);
|
||||
person.set("Married", false);
|
||||
//// If uncommented, the console.log above produces the following output:
|
||||
//// propertyChange Age 35
|
||||
//// propertyChange Married false
|
||||
// If uncommented, the console.log above produces the following output:
|
||||
// propertyChange Age 35
|
||||
// propertyChange Married false
|
||||
// << observable-property-change
|
||||
}
|
||||
|
||||
|
||||
@@ -46,16 +46,16 @@ export var test_VirtualArray_setItemShouldRaiseChangeEventWhenYouSetDifferentIte
|
||||
// << (hide)
|
||||
|
||||
array.on(virtualArrayModule.VirtualArray.itemsLoadingEvent, (args: virtualArrayModule.ItemsLoading) => {
|
||||
//// Argument (args) is ItemsLoading.
|
||||
//// args.index is start index of the page where the requested index is located.
|
||||
//// args.count number of requested items.
|
||||
////
|
||||
//// Note: Virtual array will divide total number of items to pages using "loadSize" property value. When you request an
|
||||
//// item at specific index the array will raise "itemsLoading" event with "ItemsLoading" argument index set to the first index of the requested page
|
||||
//// and count set to number of items in this page.
|
||||
////
|
||||
//// Important: If you have already loaded items in the requested page the array will raise multiple times "itemsLoading" event to request
|
||||
//// all ranges of still not loaded items in this page.
|
||||
// Argument (args) is ItemsLoading.
|
||||
// args.index is start index of the page where the requested index is located.
|
||||
// args.count number of requested items.
|
||||
//
|
||||
// Note: Virtual array will divide total number of items to pages using "loadSize" property value. When you request an
|
||||
// item at specific index the array will raise "itemsLoading" event with "ItemsLoading" argument index set to the first index of the requested page
|
||||
// and count set to number of items in this page.
|
||||
//
|
||||
// Important: If you have already loaded items in the requested page the array will raise multiple times "itemsLoading" event to request
|
||||
// all ranges of still not loaded items in this page.
|
||||
|
||||
var itemsToLoad = new Array<number>();
|
||||
for (var i = 0; i < args.count; i++) {
|
||||
@@ -78,10 +78,10 @@ export var test_VirtualArray_loadShouldRaiseChangeEventWithCorrectArgs = functio
|
||||
// << (hide)
|
||||
|
||||
array.on(virtualArrayModule.VirtualArray.changeEvent, (args: virtualArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "update".
|
||||
//// args.removed.length and result.addedCount are equal to number of loaded items with load() method.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "update".
|
||||
// args.removed.length and result.addedCount are equal to number of loaded items with load() method.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -109,10 +109,10 @@ export var test_VirtualArray_lengthIncreaseShouldRaiseChangeEventWithCorrectArgs
|
||||
// << (hide)
|
||||
|
||||
array.on(virtualArrayModule.VirtualArray.changeEvent, (args: virtualArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "add".
|
||||
//// args.removed.length is 0, result.addedCount is equal to the delta between new and old "length" property values.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "add".
|
||||
// args.removed.length is 0, result.addedCount is equal to the delta between new and old "length" property values.
|
||||
|
||||
// >> (hide)
|
||||
result = args;
|
||||
@@ -140,10 +140,10 @@ export var test_VirtualArray_lengthDecreaseShouldRaiseChangeEventWithCorrectArgs
|
||||
// </hide>
|
||||
|
||||
array.on(virtualArrayModule.VirtualArray.changeEvent, (args: virtualArrayModule.ChangedData<number>) => {
|
||||
//// Argument (args) is ChangedData<T>.
|
||||
//// args.eventName is "change".
|
||||
//// args.action is "remove".
|
||||
//// result.addedCount is 0, args.removed.length is equal to the delta between new and old "length" property values.
|
||||
// Argument (args) is ChangedData<T>.
|
||||
// args.eventName is "change".
|
||||
// args.action is "remove".
|
||||
// result.addedCount is 0, args.removed.length is equal to the delta between new and old "length" property values.
|
||||
|
||||
// <hide>
|
||||
result = args;
|
||||
|
||||
Reference in New Issue
Block a user