vendredi 19 juin 2015

Multiple angular directives referring to the same template

I've found myself in a situation where I have 2 isolate scope directives (each managing differentiated scope and dom state) that are referring to a single template.

.directive1...
    scope: {},
    templateUrl: 'template1',

.directive2...
    scope: {},
    templateUrl: 'template1',

I'm used to having a 1-to-1 relationship between my directives and their templates, and this model (2 directives - to - 1 template) has me veering from that pattern.

Is there a good reason I shouldn't have multiple isolate scope directives referring to the same template?

Is this in violation of some 'best practices' design pattern thought?

Are there other design considerations I should be taking into account here?

Aucun commentaire:

Enregistrer un commentaire