當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Renderer2.setProperty方法代碼示例

本文整理匯總了TypeScript中@angular/core.Renderer2.setProperty方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Renderer2.setProperty方法的具體用法?TypeScript Renderer2.setProperty怎麽用?TypeScript Renderer2.setProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/core.Renderer2的用法示例。


在下文中一共展示了Renderer2.setProperty方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

        this.menuService.getSelectedItem().subscribe((event: {tag: string, item: any}) => {
          if (event && event.item && event.item.data) {
            this.currentItem = event.item.data;

            this.renderer.setProperty(document.body, 'scrollTop', 0);
          }
        });
開發者ID:ManigandanRaamanathan,項目名稱:react-native-ui-kitten,代碼行數:7,代碼來源:page.component.ts

示例2: disableElement

 disableElement(){
     if (this.el.nativeElement.tagName === 'INPUT'){
         this.renderer.setProperty(this.el.nativeElement, 'disabled', true);
     }
     if (this.el.nativeElement.tagName === 'DIV'){
         this.el.nativeElement.style.display = 'none';
     }
 }
開發者ID:dhanzhang,項目名稱:dcm4chee-arc-light,代碼行數:8,代碼來源:placeholderchanger.directive.ts

示例3: updateVisibility

	// I get called by the LazyViewport service when the element associated with this
	// directive has its visibility changed.
	public updateVisibility( isVisible: boolean, ratio: number ) : void {

		// When this target starts being tracked by the viewport, the initial visibility
		// will be reported, even if it is not visible. As such, let's ignore the first
		// visibility update.
		if ( ! isVisible ) {

			return;

		}

		// Now that the element is visible, load the underlying SRC value. And, since we
		// no longer need to worry about loading, we can detach from the LazyViewport.
		this.lazyViewport.removeTarget( this );
		this.lazyViewport = null;
		this.renderer.setProperty( this.element, "src", this.src );

		// If an active class has been provided, add it to the element.
		( this.visibleClass ) && this.renderer.addClass( this.element, this.visibleClass );

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:23,代碼來源:lazy-src.directive.ts

示例4: setProperty

 private setProperty(r: Renderer2, el: any, name: string, value: any) {
   r.setProperty(el, name, value);
 }
開發者ID:Cammisuli,項目名稱:angular,代碼行數:3,代碼來源:renderer.ts

示例5: ngAfterViewInit

 ngAfterViewInit() {
     const hasAllowableOperations = this.contentService.hasAllowableOperations(this.node, AllowableOperationsEnum.LOCK);
     this.renderer.setProperty(this.element.nativeElement, 'disabled', !hasAllowableOperations);
 }
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:4,代碼來源:node-lock.directive.ts

示例6: onClick

  @HostListener('click') onClick() {
    const description = this.element.nativeElement.nextElementSibling;
    const state = description.hidden;

    this.renderer.setProperty(description, 'hidden', !state);
  }
開發者ID:IZhuhan,項目名稱:news-app,代碼行數:6,代碼來源:show-description.directive.ts

示例7: setInputValue

 private setInputValue(val: string): void {
   this.rndr.setProperty(this.el.nativeElement, 'value', val);
 }
開發者ID:kumi20,項目名稱:wyprawka,代碼行數:3,代碼來源:datepickerAutofill.directive.ts

示例8: ngOnChanges

 ngOnChanges(_: SimpleChanges) {
     if (this.content && this.elementRef) {
         this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', this.markdownService.compile(this.content));
     }
 }
開發者ID:kencinder,項目名稱:steam-rom-manager,代碼行數:5,代碼來源:markdown.component.ts

示例9: constructor

 constructor(private renderer: Renderer2) {
   this.renderer.setProperty(document.body, "scrollTop", 0);
 }
開發者ID:AhmedFawzy,項目名稱:react-native-ui-kitten,代碼行數:3,代碼來源:homepage.component.ts

示例10: ngOnInit

 ngOnInit() {
     this.renderer.setStyle(this.el.nativeElement, 'color', 'red');
    this.renderer.setAttribute(this.el.nativeElement, 'color', 'success');
   this.renderer.setProperty(this.el.nativeElement, 'color', 'success');
   // this.el.nativeElement.setValue('test');
 }
開發者ID:harishfysx,項目名稱:AngDashBoard2,代碼行數:6,代碼來源:style-result.directive.ts


注:本文中的@angular/core.Renderer2.setProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。