我有C#数组的字符串变量,我只是想在使用AngularJS的下拉框中填充它。有人可以帮我把它分配给ng-init变量,以便我可以重复这些值吗?如何在Angular ng-init中使用C#字符串数组?
@{string[] strArray = new string[length]}
<div ng-init="[email protected]">
<select class="custom-select-style" ng-options="c as c for c in FieldOptions">
<option value="">[email protected]</option>
</select>
</div>
当我试图像上面的代码段,它引发错误“语法错误:令牌‘]’不是在表达的30列中的一次式[FieldOptions = [System.String []]]起始于[]]]“
在此先感谢。
显示您想要实现的HTML结果*可能*允许更多人回答您的问题。 –