mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
Fix unclosed snippet tags and duplicate snippets.
This commit is contained in:
@ -98,7 +98,7 @@ export var test_ObservableArray_joinShouldReturnStringWithAllItemsSeparatedWithC
|
||||
// >> observable-array-join
|
||||
var array = new observableArrayModule.ObservableArray([1, 2, 3]);
|
||||
var result = array.join();
|
||||
// >> observable-array-join
|
||||
// << observable-array-join
|
||||
TKUnit.assert(result === "1,2,3", "ObservableArray join() should return string with all items separated with comma!");
|
||||
};
|
||||
|
||||
|
@ -13,10 +13,10 @@ import { Page } from "ui/page";
|
||||
import listViewModule = require("ui/list-view");
|
||||
// << article-require-listview-module
|
||||
|
||||
// >> article-require-modules
|
||||
// >> article-require-modules-listview
|
||||
import observableArray = require("data/observable-array");
|
||||
import labelModule = require("ui/label");
|
||||
// << article-require-modules
|
||||
// << article-require-modules-listview
|
||||
|
||||
// >> article-item-tap
|
||||
function listViewItemTap(args) {
|
||||
|
@ -9,7 +9,7 @@ previous_url: /ApiReference/ui/list-view/HOW-TO
|
||||
Using a ListView requires the ListView module.
|
||||
<snippet id='article-require-listview-module'/>
|
||||
Other modules which will be used in the code samples in this article:
|
||||
<snippet id='article-require-modules'/>
|
||||
<snippet id='article-require-modules-listview'/>
|
||||
### Binding the ListView items property to collection in the view-model.
|
||||
``` XML
|
||||
<Page>
|
||||
|
@ -14,10 +14,10 @@ import { Label } from "ui/label";
|
||||
import repeaterModule = require("ui/repeater");
|
||||
// << article-require-repeater-module
|
||||
|
||||
// >> article-require-modules
|
||||
// >> article-require-modules-repeater
|
||||
import observableArray = require("data/observable-array");
|
||||
import labelModule = require("ui/label");
|
||||
// << article-require-modules
|
||||
// << article-require-modules-repeater
|
||||
|
||||
var ASYNC = 0.2;
|
||||
var FEW_ITEMS = [0, 1, 2];
|
||||
|
@ -9,7 +9,7 @@ previous_url: /ApiReference/ui/repeater/HOW-TO
|
||||
Using a Repeater requires the repeater module.
|
||||
<snippet id='article-require-repeater-module'/>
|
||||
Other modules which will be used in the code samples in this article:
|
||||
<snippet id='article-require-modules'/>
|
||||
<snippet id='article-require-modules-repeater'/>
|
||||
### Binding the Repeater items property to collection in the view-model.
|
||||
``` XML
|
||||
<Page>
|
||||
|
@ -15,12 +15,12 @@ import textFieldModule = require("ui/text-field");
|
||||
// Other frequently used modules when working with buttons include:
|
||||
|
||||
import bindable = require("ui/core/bindable");
|
||||
// >> require-observable
|
||||
// >> require-observable-textfield
|
||||
import observable = require("data/observable");
|
||||
// << require-observable
|
||||
// << require-observable-textfield
|
||||
|
||||
// ### Binding two TextFields text property to observable view-model property.
|
||||
// >> binding-text-property
|
||||
// >> binding-text-property-textfield
|
||||
function pageLoaded(args) {
|
||||
var page = args.object;
|
||||
var obj = new observable.Observable();
|
||||
@ -28,7 +28,7 @@ function pageLoaded(args) {
|
||||
page.bindingContext = obj;
|
||||
}
|
||||
exports.pageLoaded = pageLoaded;
|
||||
// << binding-text-property
|
||||
// << binding-text-property-textfield
|
||||
|
||||
var _createTextFieldFunc = function (): textFieldModule.TextField {
|
||||
// >> creating-textfield
|
||||
@ -252,7 +252,7 @@ export var testBindHintDirectlyToModel = function () {
|
||||
helper.buildUIAndRunTest(_createTextFieldFunc(), function (views: Array<viewModule.View>) {
|
||||
var textField = <textFieldModule.TextField>views[0];
|
||||
|
||||
// >> binding-hint-property
|
||||
// >> binding-hint-property-textfield
|
||||
var model = new observable.Observable();
|
||||
model.set("hint", "type your username here");
|
||||
var options: bindable.BindingOptions = {
|
||||
@ -271,7 +271,7 @@ export var testBindHintDirectlyToModel = function () {
|
||||
TKUnit.assert(textField.hint === "type your password here", "Actual: " + textField.text + "; Expected: " + "type your password here");
|
||||
TKUnit.assert(textFieldTestsNative.getNativeHint(textField) === "type your password here", "Actual: " + textFieldTestsNative.getNativeHint(textField) + "; Expected: " + "type your password here");
|
||||
// << (hide)
|
||||
// << binding-hint-property
|
||||
// << binding-hint-property-textfield
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ previous_url: /ApiReference/ui/text-field/HOW-TO
|
||||
# TextField
|
||||
Using a TextField requires the text-field module.
|
||||
<snippet id='require-textfield'/>
|
||||
<snippet id='require-observable'/>
|
||||
<snippet id='require-observable-textfield'/>
|
||||
### Binding two TextFields text property to observable view-model property.
|
||||
```XML
|
||||
<Page loaded="pageLoaded">
|
||||
@ -18,7 +18,7 @@ Using a TextField requires the text-field module.
|
||||
</StackLayout>
|
||||
</Page>
|
||||
```
|
||||
<snippet id='binding-text-property'/>
|
||||
<snippet id='binding-text-property-textfield'/>
|
||||
## Creating a TextField
|
||||
<snippet id='creating-textfield'/>
|
||||
### Setting the text of a TextField
|
||||
@ -30,7 +30,7 @@ Using a TextField requires the text-field module.
|
||||
### Setting the hint of a TextField
|
||||
<snippet id='setting-hint-text'/>
|
||||
### Binding hint property directly to model
|
||||
<snippet id='binding-hint-property'/>
|
||||
<snippet id='binding-hint-property-textfield'/>
|
||||
### Setting the secure property of a TextField
|
||||
<snippet id='setting-secure-property'/>
|
||||
### Binding secure property directly to model
|
||||
|
@ -13,9 +13,9 @@ import textViewModule = require("ui/text-view");
|
||||
|
||||
// Other frequently used modules when working with buttons include:
|
||||
import bindable = require("ui/core/bindable");
|
||||
// >> require-observable
|
||||
// >> require-observable-textview
|
||||
import observable = require("data/observable");
|
||||
// << require-observable
|
||||
// << require-observable-textview
|
||||
|
||||
// >> text-view-xml
|
||||
// <Page loaded="pageLoaded">
|
||||
@ -96,7 +96,7 @@ export var testBindTextDirectlyToModel = function () {
|
||||
helper.buildUIAndRunTest(_createTextViewFunc(), function (views: Array<viewModule.View>) {
|
||||
var textView = <textViewModule.TextView>views[0];
|
||||
|
||||
// >> binding-text-property
|
||||
// >> binding-text-property-textview
|
||||
var model = new observable.Observable();
|
||||
model.set("username", "john");
|
||||
var options: bindable.BindingOptions = {
|
||||
@ -115,7 +115,7 @@ export var testBindTextDirectlyToModel = function () {
|
||||
TKUnit.assert(textView.text === "mary", "Actual: " + textView.text + "; Expected: " + "mary");
|
||||
TKUnit.assert(textViewTestsNative.getNativeText(textView) === "mary", "Actual: " + textViewTestsNative.getNativeText(textView) + "; Expected: " + "mary");
|
||||
// << (hide)
|
||||
// >> binding-text-property
|
||||
// << binding-text-property-textview
|
||||
});
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ export var testBindHintDirectlyToModel = function () {
|
||||
var textView = <textViewModule.TextView>views[0];
|
||||
textView.text = "";
|
||||
|
||||
// >> binding-hint-property
|
||||
// >> binding-hint-property-textview
|
||||
var model = new observable.Observable();
|
||||
model.set("hint", "type your username here");
|
||||
var options: bindable.BindingOptions = {
|
||||
@ -195,7 +195,7 @@ export var testBindHintDirectlyToModel = function () {
|
||||
TKUnit.assert(textView.hint === "type your password here", "Actual: " + textView.hint + "; Expected: " + "type your password here");
|
||||
TKUnit.assert(textViewTestsNative.getNativeHint(textView) === "type your password here", "Actual: " + textViewTestsNative.getNativeHint(textView) + "; Expected: " + "type your password here");
|
||||
// << (hide)
|
||||
// << binding-hint-property
|
||||
// << binding-hint-property-textview
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ previous_url: /ApiReference/ui/text-view/HOW-TO
|
||||
# TextView
|
||||
Using a TextView requires the text-view module.
|
||||
<snippet id='require-textmodules'/>
|
||||
<snippet id='require-observable'/>
|
||||
<snippet id='require-observable-textview'/>
|
||||
### Binding two TextViews text property to observable view-model property.
|
||||
<snippet id='text-view-xml'/>
|
||||
<snippet id='observable-declare'/>
|
||||
@ -17,11 +17,11 @@ Using a TextView requires the text-view module.
|
||||
### Setting the text of a TextView
|
||||
<snippet id='set-text-value'/>
|
||||
### Binding text property directly to model
|
||||
<snippet id='binding-text-property'/>
|
||||
<snippet id='binding-text-property-textview'/>
|
||||
### Setting the hint of a TextView
|
||||
<snippet id='set-textview-hint'/>
|
||||
### Binding hint property directly to model
|
||||
<snippet id='binding-hint-property'/>
|
||||
<snippet id='binding-hint-property-textview'/>
|
||||
### Setting the editable property of a TextView
|
||||
<snippet id='setting-editable-property'/>
|
||||
### Binding editable property directly to model
|
||||
|
Reference in New Issue
Block a user