Files
NativeScript/apps/tests/ui/search-bar/search-bar-tests.ts
Vladimir Enchev 63f9509432 XML examples added
2015-03-09 08:32:30 +02:00

31 lines
949 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import observable = require("data/observable");
// <snippet module="ui/search-bar" title="search-bar">
// # SearchBar
// Using the SearchBar requires the "ui/search-bar" module.
// ``` JavaScript
import searchBarModule = require("ui/search-bar");
// ```
// </snippet>
// ### Declaring a SearchBar.
//```XML
// <Page>
// <SearchBar text="{{ search }}" />
// </Page>
//```
// </snippet>
export function test_DummyTestForSnippetOnly() {
// <snippet module="ui/search-bar" title="search-bar">
// ### Searching
// ``` JavaScript
var searchBar = new searchBarModule.SearchBar();
searchBar.on(searchBarModule.knownEvents.submit, function (args: observable.EventData) {
console.log("Search for " + (<searchBarModule.SearchBar>args.object).text);
});
searchBar.on(searchBarModule.knownEvents.clear, function (args: observable.EventData) {
console.log("Clear");
});
// ```
// </snippet>
}