I'm using the same portion of html code in different parts of a page and I'd like to avoid duplicating it.
The only things that change are a few ones that can be parametrised.
Reading here, I saw one option could be to use a directive: http://fdietz.github.io/recipes-with-angular-js/directives/rendering-an-html-snippet-in-a-directive.html
Would this be the best approach?
The snippet of code I'd like to use is not very short.
I at first tried using ng-include with ng-init to set the parameters but this wasn't a good idea since I was changes them in the scope and so they where changing everywhere. (I saw that this works inside of a ng-repeat because then you have a different scope for it)
Thanks.