It seems like using a template injection may not be the best approach for what you are trying to accomplish. Instead, consider utilizing HTML and letting AngularJS handle tasks such as repeating and hiding elements for you.
Additionally, keep in mind that each time you declare ng-controller
in your HTML, a new instance of the controller is generated. These instances do not share a common $scope
, which may not align with your desired outcome.
In order to resolve any issues with AngularJS being unable to inject the application module, I suggest moving the binding of myApp
to the body tag:
<body ng-app="myApp">
You can find more information about this solution here.
I have also created a working example based on your fiddle: http://jsfiddle.net/42rpB/2/