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


TypeScript observable.Observable类代码示例

本文整理汇总了TypeScript中data/observable.Observable的典型用法代码示例。如果您正苦于以下问题:TypeScript Observable类的具体用法?TypeScript Observable怎么用?TypeScript Observable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Observable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6:

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

示例7: join

export function join(args) {
    socketIO =  new SocketIO('http://192.168.56.1:3000', {});
 socketIO.emit('add user', { username: pageData.get("username") });
 
 socketIO.on('login', function(data) {
  frameModule.topmost().navigate({ moduleName: 'main-page', context: { username: pageData.get("username"),socket:socketIO.getInstance() } })
})

}
开发者ID:dwilanang,项目名称:nativescript-socketio,代码行数:9,代码来源:login.ts

示例8: join

export function join(args) {
  socketIO.emit('add user', { username: pageData.get("username") });
}
开发者ID:aderbas,项目名称:nativescript-socketio,代码行数:3,代码来源:login.ts

示例9: function

 socketIO.on('login', function (data) {
   frameModule.topmost().navigate({ moduleName: 'main-page', context: { username: pageData.get("username"), socket: socketIO.instance } })
 })
开发者ID:aderbas,项目名称:nativescript-socketio,代码行数:3,代码来源:login.ts

示例10: setTimeout

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


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