angular / angular/components

[Dialog] Add a directive to simplify dialog interaction

Ouverte
#14,483 6 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
area: material/dialog feature P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Please describe the feature you would like to request.
A directive that accepts a TemplateRef and a dialog configuration object
When the button this directive is placed on is clicked a dialog containing that Template is created

#### What is the use-case or motivation for this proposal?
Allows users to interact with dialogs like other components - through their markup bindings. No need to use poorly understood _entry components_. Dialog templates are part of the component template; input and output bindings are fully accessible (as are pipes.)

The existing programmatic only approach feels like there is a lot of ceremony over creating dialogs - many of which would otherwise be simple components.

#### Is there anything else we should know?
I've stubbed out what the implementation might look like here. I've used a version of this in production for over a year now. I've also included 2 examples of usage.
https://github.com/adammedford/material2/blob/open-dialog-directive/src/lib/dialog/dialog-open-directive.ts

I will submit a PR if there is interest in this; this version is to just convey what I'm talking about. I didn't want to go through the effort of a full implementation and docs if nobody cares to use it.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par lire l’implémentation proposée dans src/lib/dialog/dialog-open-directive.ts et par examiner les deux exemples d’utilisation liés. Comparez cette approche aux API de dialogue existantes et déterminez le périmètre requis pour la directive, la configuration, le template, le binding et la documentation. La tâche est considérée comme terminée lorsqu’une implémentation et des exemples documentés ont été convenus, mais l’issue n’identifie ni les tests ni une conception arrêtée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.