当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Observable.set方法代码示例

本文整理汇总了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;
}
开发者ID:emiloberg,项目名称:NativeScript,代码行数:7,代码来源:tab-view.ts

示例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", "");
    }
}
开发者ID:emiloberg,项目名称:NativeScript,代码行数:10,代码来源:tab-view.ts

示例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;
    }
开发者ID:RasmusTG,项目名称:nativescript-ionic,代码行数:11,代码来源:radiobutton.ts

示例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);
开发者ID:m-abs,项目名称:testing-nativescript,代码行数:12,代码来源:main-page.ts

示例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; 

开发者ID:NickIliev,项目名称:NativeScript-issues,代码行数:29,代码来源:main-page.ts

示例6: setTimeout

 setTimeout(function() {
         obj.set("selected", args.object.id);
     }, 100);
开发者ID:RasmusTG,项目名称:nativescript-ionic,代码行数:3,代码来源:radiobutton.ts

示例7: constructor

 constructor(){
    this.imageLibrary =Images;
    this.content= new Observable();
    this.content.set("isLoading", true);    
    this.imglistSer = new ImageListServices();
 }
开发者ID:tsonevn,项目名称:Angular2-Sample-Project,代码行数:6,代码来源:app.component.ts

示例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);
}
开发者ID:mkloubert,项目名称:nativescript-enumerable,代码行数:98,代码来源:ScriptExecutor.ts

示例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",
开发者ID:ignaciofuentes,项目名称:nativescript-twitterclone,代码行数:31,代码来源:list.ts


注:本文中的data/observable.Observable.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。