Thanks for your reply and sorry - I meant to put:
<table>
<tr ng-repeat="question in questions"
ng-include="{{question.HtmlTemplate}}"></tr>
</table>
which didn't work.
Isn't what you're suggesting very similar to this?
On Thursday, 9 January 2014 16:31:23 UTC, Pan Stav wrote:
>
> I don't know know about setting ngRepeat on a table tag, but.. What is
> best for your app.
>
> Regrading your question, I'd suggest an ngRepeat that fills a custom
> directive with some attributes according to question type.
> The directive then constructs the appropriate html chunk for the
> particular question type. If you say you have 12 types, a directive with 12
> different scenarios then.
>
> Hope that helps
>
> On Thursday, January 9, 2014 5:49:35 PM UTC+2, Fordio wrote:
>>
>> Hi, I am working on an application that captures responses to questions,
>> a bit like a survey, and am looking for ideas to help me solve the
>> following problem.
>>
>> My app requests a list of questions from the a web service to ask the
>> user. The response to a question will be of a particular type. The response
>> could be an integer response, a text, a date etc. (There are 12 different
>> types).
>>
>> For each question type, there is a different piece of HTML markup to
>> display the question and capture the response.
>>
>> There could be any number of questions returned from the web service,
>> with any combination of types.
>>
>> How can I use AngularJS to list the questions with the right markup for
>> each one?
>>
>> I have tried:
>>
>> <table ng-repeat="question in questions">
>> <tr ng-include="{{question.HtmlTemplate}}"></tr>
>> </table>
>>
>> Where question.HtmlTemplate is the url for the template for this question
>> type - but this doesn't work.
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.