If you are using a proper modular based architecture then based on a
template/ view, a particular module would be injected.
And to be specific to your question, directive template would not exist
several times :)


On Thu, Oct 29, 2015 at 10:32 AM, Boyan Djumakov <[email protected]>
wrote:

> I'm not sure if my question would be stupid, but wouldn't adding a
> directive several times in the site, actually bring possibility for a mess
> as the code of the directive template would exist several times?
>
> On 29 October 2015 at 16:17, Tandon, Rishi <[email protected]>
> wrote:
>
>> You might want to try:
>> Directive for re-usuable template & behavior and/or
>> Service for sharing data or reusable utility.
>>
>> You can invoke APIs based on pubsub notification ($on, $emit, $braodcast)
>>
>> On Thu, Oct 29, 2015 at 8:33 AM, Boyan Djumakov <[email protected]>
>> wrote:
>>
>>> Hello everybody,
>>> I've recently dealt with a big angular app. In it we have a controller A
>>> that is in a static place, let's say header functionality. We have
>>> controllers B and C that load dynamically in an ng-view, based on route.
>>> In Ctrl B I have a UI functionality that opens a window with some data
>>> and functionality inside. This UI functionality is needed though in the
>>> other Ctrl C and at some point we might need it in Ctrl AA by various
>>> reasons.
>>> What is the right way to implement all this? At this stage we added the
>>> functionality in Ctrl A and call it through event but I think it's not the
>>> proper way to do it especially in the cases when event is emitted and the
>>> handler is actually not yet properly initialised.
>>>
>>> All ideas are welcome.
>>> Thanks in advance
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "AngularJS" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/angular.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> *Rishi Tandon*
>> Pearson Learning Technology Group
>>
>> Mobile: (310) 926-9032
>>
>> Pearson
>> Always Learning
>> Learn more at www.pearson.com
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "AngularJS" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/angular/79G5jMar4wo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Rishi Tandon*
Pearson Learning Technology Group

Mobile: (310) 926-9032

Pearson
Always Learning
Learn more at www.pearson.com

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to