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


TypeScript jb-rx.Subject类代码示例

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


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

示例1: constructor

	 constructor(public ctx, public cmp, public $el) {
	 	var data_ref = ctx.vars.$model.databind;
		this.editableNumber = ctx.vars.editableNumber;
		this.scaleElement = $el.find('.slider_scale')[0];
		this.thumbElement = $el.find('.slider_thumb')[0];
		this.inputElement = $el.find('.slider_input')[0];
		this.textElement = $el.find('.slider_text')[0];

		this.thumbElement.tabIndex = 1;
		$(this.thumbElement).bind('mousedown', e => this.dragBegin(e) );
		$(this.thumbElement).bind('keydown', e => this.keyDown(e) ); 
		$(this.inputElement).bind('keydown', e => this.inputKeyDown(e)); 
		$(this.inputElement).bind('blur', e => this.setInputValue());
		$(this.inputElement).hide();
		$(this.textElement).bind('mousedown', e => this.mouseDown(e) );

		this.numericValue = this.editableNumber.numericPart(jb.val(data_ref));
		this.$el.addClass('noselect');

		this.valueChangeEm = new jb_rx.Subject();
		this.valueChangeEm.distinctUntilChanged()
			.debounceTime(100)
			.filter(x => 
				x != jb.val(data_ref))
			.subscribe(x=>{
				jb.writeValue(data_ref,x); 
				jb_ui.apply(this.ctx); // to fix with ChangeDetectionStrategy
			})
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:29,代码来源:slider.ts

示例2: isNaN

	setValue(val) {
		var fix1 = this.applyRangeAndResolution(val);
		this.numericValue = isNaN(fix1) ? '' : '' + fix1;
		var value_to_save = this.editableNumber.calcDataString(fix1,this.ctx);
		this.valueChangeEm.next(value_to_save);
		return this;
	}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:7,代码来源:slider.ts

示例3:

 init: cmp =>  
   modifyOperationsEm
     .takeUntil( cmp.jbEmitter.filter(x=>x =='destroy') )
     .filter(e=>
       e.path == path)
     .subscribe(e=>
         jb.writeValue(data_ref,true)
     ),
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:8,代码来源:studio-utils.ts

示例4: notifyModification

export function notifyModification(path,before,ctx,ngPath) {
	var comp = path.split('~')[0];
	modifyOperationsEm.next({ comp: comp, before: before, after: compAsStr(comp), path: path, ctx: ctx, jbart: findjBartToLook(path), ngPath: ngPath });
}
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:4,代码来源:studio-utils.ts


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