當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。