I'm using views and controllers and everything seems to be going well,
except when the template grows very big. I split the template into various
partials and include it using ng-include. Now would it make sense to create
directive and specify templateUrl attribute only. Apart from syntax sugar,
do I gain anything else.
Correct me if I'm wrong, using directives would make sense if the same code
piece is being repeated at multiple places. For example, a UI component
like the ones in Angular UI bootstrap. Does it make sense to create a
directive for business components, for example a dropdown that lists say
two options "men's apparel", "women's apparel" and other options nested
under it. So, the template would look like:
<div top-menu-bar></div>
<div shopping-cart>
<cartobject
id="10"
title="title"
quantity=1>
</cartobject>
</div>
Although I like the syntax, but I accomplish the same using html elements
in view and then tie it to controller for talking to service and getting
the data. I need to know the pros and cons of both of these approaches.
--
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.