@angular/core#TemplateRef TypeScript Examples

The following examples show how to use @angular/core#TemplateRef. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: channel-participant-list.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 6 votes vote down vote up
openPopup(dialog: TemplateRef<any>, folderId = "", participantId = "") {
        if(folderId != ""){
          this.editedFolderId = folderId;
          this.editedFolderName = this.getFolderNameForId(folderId);
        }
        if(participantId != ""){
          this.editedParticipantId = participantId;
          this.editedParticipantName = this.getParticipantNameForId(participantId);
        }

        this.popupRef.push(this.dialog.open(dialog, { context: 'this is some additional data passed to dialog' }));
    }
Example #2
Source File: dialog.service.ts    From alauda-ui with MIT License 6 votes vote down vote up
open<T, D = any, R = any>(
    compOrTempRef: ComponentType<T> | TemplateRef<T>,
    config: DialogConfig<D> = null,
  ): DialogRef<T, R> {
    this.hiddenPrevDialog();

    config = { ...new DialogConfig(), ...config };

    const overlayRef = this.createOverlay(config);
    const dialogIns = this.attachDialog(overlayRef, config);
    const dialogRef = this.attachDialogContent<T, D, R>(
      compOrTempRef,
      dialogIns,
      overlayRef,
      config,
    );
    this.openDialogs.push(dialogRef);
    dialogRef.updatePosition().updateSize();
    dialogRef.afterClosed().subscribe(() => {
      this.removeDialog(dialogRef);
      this.showPrevDialog();
    });

    return dialogRef;
  }
Example #3
Source File: dxc-row-def.directive.ts    From halstack-angular with Apache License 2.0 6 votes vote down vote up
// TODO(andrewseguin): Add an input for providing a switch function to determine
  //   if this template should be used.
  constructor(
    template: TemplateRef<any>,
    _differs: IterableDiffers,
    @Inject(DXC_RESULTSET_TABLE) @Optional() public _table?: any
  ) {
    super(template, _differs);
  }
Example #4
Source File: pager-items-comp.ts    From ui-pager with Apache License 2.0 6 votes vote down vote up
public registerTemplate(key: string, template: TemplateRef<ItemContext>) {
        if (Trace.isEnabled()) {
            PagerLog(`registerTemplate for key: ${key}`);
        }

        if (!this._templateMap) {
            this._templateMap = new Map<string, KeyedTemplate>();
        }

        const keyedTemplate = {
            key,
            createView: this.getItemTemplateViewFactory(template)
        };

        this._templateMap.set(key, keyedTemplate);
    }
Example #5
Source File: np-accordion-item.component.ts    From np-ui-lib with MIT License 6 votes vote down vote up
ngOnInit(): void {
    if (this.title instanceof TemplateRef) {
      this.isTitleTemplate = true;
    }
    if (this.isOpen) {
      if (!this._contentPortal && this._explicitContent) {
        this._contentPortal = new TemplatePortal(
          this._explicitContent,
          this._viewContainerRef
        );
      }
    }
  }
Example #6
Source File: base.component.ts    From 1hop with MIT License 5 votes vote down vote up
@ViewChild('connectTemplate')
    connectTemplate: TemplateRef<any>;
Example #7
Source File: base.component.ts    From 1x.ag with MIT License 5 votes vote down vote up
@ViewChild('connectTemplate')
    connectTemplate: TemplateRef<any>;
Example #8
Source File: tutorial-dialog.component.ts    From bdc-walkthrough with MIT License 5 votes vote down vote up
@ViewChild(TemplateRef, {static: true}) templateRef: TemplateRef<any>;
Example #9
Source File: rubic-language-select.component.ts    From rubic-app with GNU General Public License v3.0 5 votes vote down vote up
@ViewChildren('dropdownOptionTemplate') dropdownOptionsTemplates: QueryList<TemplateRef<unknown>>;
Example #10
Source File: basic-list.component.ts    From ng-devui-admin with MIT License 5 votes vote down vote up
@ViewChild('EditorTemplate', { static: true })
  EditorTemplate: TemplateRef<any>;
Example #11
Source File: key-value-table.component.ts    From RcloneNg with MIT License 5 votes vote down vote up
@ContentChild(TemplateRef, { static: true }) public addonTemplate: TemplateRef<any>;
Example #12
Source File: ngx-splide-slide.component.ts    From ngx-splide with MIT License 5 votes vote down vote up
@ViewChild('slideContent')
    public slideContent: TemplateRef<any>;
Example #13
Source File: accordion-item-content.directive.ts    From canopy with Apache License 2.0 5 votes vote down vote up
constructor(public _template: TemplateRef<any>) {}
Example #14
Source File: integration-bar.component.ts    From leapp with Mozilla Public License 2.0 5 votes vote down vote up
@ViewChild("ssoModalTemplate", { static: false })
  ssoModalTemplate: TemplateRef<any>;
Example #15
Source File: app-datagrid.component.ts    From barista with Apache License 2.0 5 votes vote down vote up
@Input() headerTemplate: TemplateRef<any>;
Example #16
Source File: if-not.directive.ts    From Angular-Cookbook with MIT License 5 votes vote down vote up
constructor(
    private templateRef: TemplateRef<any>,
    private viewContainerRef: ViewContainerRef
  ) {}
Example #17
Source File: channel-favorites.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 5 votes vote down vote up
open(dialog: TemplateRef<any>) {
        this.popupRef.push(this.dialog.open(dialog, { context: 'this is some additional data passed to dialog' }));
    }
Example #18
Source File: info-dialog.component.ts    From nghacks with MIT License 5 votes vote down vote up
@ViewChild('infoTemplateRef') private infoTemplateRef: TemplateRef<any>;
Example #19
Source File: dialog.component.ts    From ngx-admin-dotnet-starter with MIT License 5 votes vote down vote up
open2(dialog: TemplateRef<any>) {
    this.dialogService.open(
      dialog,
      { context: 'this is some additional data passed to dialog' });
  }
Example #20
Source File: accordion-item.component.ts    From alauda-ui with MIT License 5 votes vote down vote up
@ContentChild(AccordionItemContentDirective, {
    read: TemplateRef,
    static: true,
  })
  _lazyContentTpl: TemplateRef<unknown>;