The elements are in the index.  It's to get the state of the accordion/feature tree root into the directive. We only request features when the tree is opened.

Not ideal for sure, but it will be different in the final solution. I envision a simple directive attachable to any accordion element and broadcasting state changes as well as triggering state changes from application code.