Open baj84 opened 8 years ago
In 80% of cases you can use function which provides you correct template for your component.
In other cases you could just add templates to templateCache manually and use ngInclude, but personally I consider usage of ngInclude
as bad practice.
Ah ok, thanks.
In my main template I have some bits of the template that may need to be included in several parts of the template. How would you do this without ng-include?
Cheers
@baj84 I will create separate reusable component with own template. Or if you have some "main" component which have the same layout from screen to screen and should contain differen components - multi transclude.
Hi,
I have a component that needs to have it's template split into multiple parts so that the logic can be shared. I need to have the main template including others (from the same directory) with all of them sharing the same scope and vm properties.
I've noticed that doing a simple
does not work.I can load the template in via the controller and pass it to the view via a VM variable, but this does not share scope and seems to be messy.
Has anyone found a good way of doing this?
Cheers