For example, I have a partial in car-list.html, and I want to render it in several places with different collections of cars. Maybe something like this:
You can achieve that easily with a directive.
Something like that:
angular.module('myModule')
.directive('cars', function () {
return {
restrict: 'E',
scope: { 'cars': '=data' },
template: "\n" +
" {{car.year}} {{car.make}} {{car.model}}\n" +
""
};
});
Then you can use it like that:
All New Cars
All Toyotas
You can find more info about directives here.