Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
Angular Material2 MdDialog load at the end

Hello i am making a dialog with angularMaterial2 for typescript and i can generate the dialog, but this load at the end of the page not over the other elements like this is expected.

This is my .TS

import { Component, OnInit, Input } from '@angular/core';
import {Sponsor} from '../entitys/sponsor'
import {MdDialog, MdDialogRef} from '@angular/material';

@Component({
  selector: '[sponsor-tile]',
  templateUrl: './sponsor-tile.component.html',
  styleUrls: ['./sponsor-tile.component.css']
})

export class SponsorTileComponent implements OnInit {

  @Input() sponsor: Sponsor;

  constructor(public dialog: MdDialog) {}

  ngOnInit() {
    console.log(this.sponsor);
  }

  descModal(): void{
    let dialogRef = this.dialog.open(DialogSponsorTileComponent);
    dialogRef.afterClosed().subscribe(result => {
      console.log(result);
    });
  }

}

@Component({
  selector: 'dialog-sponsor-tile',
  templateUrl: './dialog-sponsor-tile.html'
})
export class DialogSponsorTileComponent{
  constructor(public dialogRef: MdDialogRef<DialogSponsorTileComponent>){}
}

and my HTML:

<img src="{{sponsor.Logoogo}}" class="speaker-img">
<h3>{{sponsor.Name}}</h3>
<p (click)="descModal()" >{{sponsor.Description}}</p>
<ul class="speaker-social">
  <li *ngIf="sponsor.Facebook !== null" ><a href="{{sponsor.Facebook}}"><span class="ti-facebook"></span></a></li>
  <li *ngIf="sponsor.Twitter !== null" ><a href="{{sponsor.Twitter}}"><span class="ti-twitter-alt"></span></a></li>
  <li *ngIf="sponsor.Linkedin !== null" ><a href="{{sponsor.Linkedin}}"><span class="ti-linkedin"></span></a></li>
</ul>

And the HTML of the Dialog:

<h1 md-dialog-title>Dialog</h1>
<div md-dialog-content>What would you like to do?</div>
<div md-dialog-actions>
  <button md-button (click)="dialogRef.close('Option 1')">Option 1</button>
  <button md-button (click)="dialogRef.close('Option 2')">Option 2</button>
</div>

I made that in base at the examples of material.angular.io

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I think there must not have [ ] in selector: '[sponsor-tile]'

that is, like this: selector: 'sponsor-tile',

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda