Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

In the code below, I have a model called 'defaultGraphMetricOption'. Now I want to pass this model value in another directive attribute eg columnTitles="Countries, {{defaultGraphMetricOption}}"

But it doesn't work. Could someone please shed some light on this?

 <select ng-model="defaultGraphMetricOption" ng-options="filter as filter.label for filter in graphMetricOptions" >
 </select>

<!-- datatable reusable component -->
<datatable class="pagination-component"
               columnTitles="Countries, {{defaultGraphMetricOption.value}}"
               columnDataFields="name,view"
               sortField="name"
               watchedProperty="locationMapTableDatas"
            ></datatable>

Update:

I expect 'defaultGraphMetricOption's value to be rendered in 'columnTitles' instead I get '{{defaultGraphMetricOption.value}}' as it is.

share|improve this question
1  
"it doesn't work" - you should replace with this what you would expect to happen and what actually happens. If defaultGraphMetricOption is an object, what kind of value are you expecting? Are you not supposed to be accessing a field? A method? How about including the model information! –  My Head Hurts Jul 12 '13 at 10:25
 
Updated with more clarification. Hope it helps –  fe-ninja Jul 12 '13 at 10:28
 
is datatable an angularjs thing? –  Ven Jul 12 '13 at 10:31
 
Is the datatable directive your own? You may be binding the columnTitles attribute using '@' instead of '=' - perhaps?? –  Max Jul 12 '13 at 10:32
 
Yes, it is an angular directive but it doesn't matter I guess. I know I can use alternative approaches to achieve this but I guess there must be a way to achieve what I'm trying to do. –  fe-ninja Jul 12 '13 at 10:33
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.