Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

Can someone please tell me how I can use angularJS variable in the below statements. So Instead of scenario.InterestRate I want to add a angular variable {{x.rate}} and in place of scenario.Rate I want {{x.flat}}

<td class="text-right">
                    @String.Format("{0:F4}", scenario.InterestRate)
                </td>
              @if (scenario.Rate != null) 

Thanks

share|improve this question
    
Why do you need 2 templating engines in the first place? Your server code and angular variables are not interchangeable...they run in completely different environments and at different times. What exactly are you trying to accomplish? – charlietfl Jul 27 at 16:31

1 Answer 1

What you're trying to do isn't possible. Razor templates are executed server-side, before they reach the browser -- which is where angular runs.

It looks like your intention is to use razor to format the value coming from angular. The appropriate way to do this would be to use angular filters, specifically the number formatter.

<td class="text-right">
    {{x.rate | number:4}}
</td>
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.