I\'ve got a page in my AngularJS app in which I would like to include the same html partial, but with different variables. If I do this in my main html:
I could be wrong but wouldn't it be better to use a Directive?
.directive('foobar', [function factory() {
return {
restrict: 'E',
replace: true,
templateUrl: '/toBeIncluded.html',
scope: {
"var": "="
}
};
}]);
And your HTML
Now the foobar element should be replaced with your template. Each having it's own scope.