本文整理汇总了TypeScript中data/observable.Observable.set方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Observable.set方法的具体用法?TypeScript Observable.set怎么用?TypeScript Observable.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data/observable.Observable
的用法示例。
在下文中一共展示了Observable.set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: onPageLoaded
function onPageLoaded(args) {
var page = args.object;
vm.set("firstTitle", "fiiiirst");
vm.set("secondTitle", "secondTitle");
vm.set("secondIcon", "res://icon");
page.bindingContext = vm;
}
示例2: onTap
function onTap() {
i++;
vm.set("firstTitle", "changed " + i);
if (i === 3) {
vm.set("firstIcon", "res://ic_action");
}
if (i === 4) {
vm.set("firstIcon", "");
}
}
示例3: mainContentLoaded
mainContentLoaded(args: EventData) {
var obj = new Observable();
obj.set("selected", "rb-3");
obj.set("tap", function(args){
setTimeout(function() {
obj.set("selected", args.object.id);
}, 100);
});
args.object.bindingContext = obj;
}
示例4:
const interval = timer.setInterval(() => {
let playing, duration, position;
if (myPlayer) {
playing = myPlayer.isPlaying();
duration = myPlayer.getDuration();
position = myPlayer.getCurrentPosition();
}
data.set('playing', playing);
data.set('duration', duration);
data.set('position', position);
}, 250);
示例5: require
"use strict";
var observable_1 = require("data/observable");
var countriesItems = [
{ Country: "Germany", Amount: -5, SecondVal: 14 },
{ Country: "France", Amount: 13, SecondVal: -3 },
{ Country: "Bulgaria", Amount: -10, SecondVal: 17 },
{ Country: "Spain", Amount: 11, SecondVal: -9 },
{ Country: "USA", Amount: 18, SecondVal: 8 }
];
var yearItems = [
{ Year: 200, Amount: 15 },
{ Year: 456, Amount: -8 },
{ Year: 366, Amount: 25 },
{ Year: 100, Amount: -5 },
{ Year: 340, Amount: 17 },
{ Year: 135, Amount: 20 },
];
var viewModel = new observable_1.Observable();
viewModel.set("countriesSource", countriesItems);
viewModel.set("yearSource", countriesItems);
function navigatingTo(args) {
var page = args.object;
page.bindingContext = viewModel;
}
exports.navigatingTo = navigatingTo;
示例6: setTimeout
setTimeout(function() {
obj.set("selected", args.object.id);
}, 100);
示例7: constructor
constructor(){
this.imageLibrary =Images;
this.content= new Observable();
this.content.set("isLoading", true);
this.imglistSer = new ImageListServices();
}
示例8: executeScript
export function executeScript(__36D7F6225B5F4B40879B87355C0AB2F0: string,
__F5B18AC600944FA5AA22262C7B3F79DB: Observable) {
var print = function(msg) {
if (arguments.length < 1) {
msg = "";
}
var vm = __F5B18AC600944FA5AA22262C7B3F79DB;
console.log("executeSource(): " + msg);
var executionResult = vm.get("executionResult");
executionResult += "" + msg;
vm.set("executionResult", executionResult);
};
var Print = print;
var PRINT = print;
var printLine = function(msg) {
if (arguments.length < 1) {
msg = "";
}
print(msg + "\r\n");
};
var Printline = printLine;
var PrintLine = printLine;
var PRINTLINE = printLine;
var value = function(v) {
var vm = __F5B18AC600944FA5AA22262C7B3F79DB;
if (arguments.length > 0) {
vm.set("value", "" + arguments[0]);
}
return vm.get("value");
};
var Value = value;
var VALUE = value;
var items = function(i) {
var vm = __F5B18AC600944FA5AA22262C7B3F79DB;
if (arguments.length > 0) {
var seq = Enumerable.asEnumerable(i);
var array;
if (seq) {
array = seq.select(function(x) {
return {
value: x
};
}).toArray();
}
vm.set("items", array);
}
return vm.get("items");
};
var Items = items;
var ITEMS = items;
var toStringList = function(items, separator) {
items = Enumerable.asEnumerable(items);
if (arguments.length < 2) {
separator = "; ";
}
return "" + items.aggregate(function(result, x) {
return result += "" + separator + x;
});
};
var Tostringlist = toStringList;
var ToStringlist = toStringList;
var ToStringList = toStringList;
var tostringList = toStringList;
var tostringlist = toStringList;
__F5B18AC600944FA5AA22262C7B3F79DB.set("isExecuting", true);
__F5B18AC600944FA5AA22262C7B3F79DB.set("executionResult", "");
value(undefined);
try {
eval(__36D7F6225B5F4B40879B87355C0AB2F0);
}
catch (e) {
__F5B18AC600944FA5AA22262C7B3F79DB.set("executionResult",
"[EXECUTION ERROR]: " + e);
}
__F5B18AC600944FA5AA22262C7B3F79DB.set("isExecuting", false);
}
示例9: Observable
var dataLoaded;
let observableTweets;
var that;
let vm:Observable;
interface Tweet {
imageUrl:string;
author:string;
body: string;
handle:string;
}
vm = new Observable();
observableTweets = new ObservableArray([]);
vm.set("tweets", observableTweets);
export function loaded (args:EventData){
view = args.object;
view.bindingContext = vm;
observableTweets.push(fetchData().map(function(item){
return new Observable(item);
}));
};
function fetchData():Array<Tweet>{
let tweets: Array<Tweet> = [
{ imageUrl:"https://bs2.cdn.telerik.com/v1/fuhh34x1s2f0jgyz/356f6310-fdad-11e5-b02f-f17031d4570f", author:"Ignacio Fuentes", handle:"@ignacioafuentes",
body:"Does this mean that third-party Whatsapp clients are basically impossible to build? Or nothing has changed on this?" },
{ imageUrl:"https://bs3.cdn.telerik.com/v1/fuhh34x1s2f0jgyz/356f6311-fdad-11e5-b02f-f17031d4570f", author:"Business Insider", handle:"@businessinsider",