I'm facing a problem I can't solve alone with Angular.. I've a news page which will be full of different kind of news (it cans be weather news, flash news, ...). And every news has its own template.
My angular's controller use AJAX to bring in the news in Json, and I'm using ng-repeat to display those news to the user' screen. I'm also using a directive to do so. The thing is, that is a news example bring in by AJAX :
news: {
title: "sdijfdslfkndc",
template: "default_template.html",
....
}
and in ng-repeat :
<div ng-repeat="info in news">
<info-directive template="info.template"></info-directive>
</div>
I wish the infoDirective uses to right template defined in the current news. The problem is the info.template attribute is handled as a String and not as an object..
If anyone has an idea about that, I'll thank him so much !
Bye bye !
PS : just for giving you an idea of my infoDirective :
app.directive('infoDirective', function() {
return {
restrict: 'E',
scope: {
template: '='
},
templateUrl: template
};
});