My template file is getting large and too complex (~200 (long) lines of code, 9 levels of indentation) and therefore it's becoming error prone too. I'm looking for a simple solution which allows me to access $scope
variables and functions without too much headache.
My first idea was to use ngInclude
, but as I saw it's getting hacky if I want to access variables.
The other idea would be to use directives, but that also doesn't seem to be a way to go as I don't want to add separate directives for every template.
My last idea is to write a general directive which uses its parents $scope
and can access it's functions. Is that considered to be a good practice? What are possible pitfalls/disadvantages of transclusion?