I am trying to render the thing like this:
<thead ng-init="isDoctor = @(User.IsInRole("Doctor"))">
I expect it to be "isDoctor = true|false" (my server side code renders this template returning PartialView), btw I always get an error like: Syntax Error: Token 'undefined' not a primary expression at column null of the expression [isDoctor =] starting at [isDoctor = at Error ()]. So, what is the reason for that?
Try this way:
<thead ng-init="isDoctor = @(User.IsInRole("Doctor") ? "true" : "false")">
Because C# boolean renders with capital first letter:
<thead ng-init="isDoctor = True|False">
And True or False is undefined
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With