我有以下代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="YourCustomStyle" parent="android:Theme">
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
完美无缺。我甚至将Dialog dialog = new Dialog(context, R.style.YourCustomStyle);
绑定在页面的不同位置,并且连接正常等等。
我的问题是,当我到达页面时,我希望默认的,预选的选择是最高的实际年份,而不是&#34;所有年份&#34;。我尝试了几件事:
1)我在我的控制器中设置了$ scope.sortYear。我知道它已设置它,因为页面后面的绑定dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
在初始加载时显示正常。
2)我尝试使用ng-init将其设置为明确的一年,并尝试
<capabilities policy='default'>
<mknod state='on'/>
<sys_chroot state='on'/>
</capabilities>
我在控制器中定义了一个函数getCurYear(并验证我实际上是在击中该函数和设置/返回我认为应该是的东西)但是nada。
我错过了什么?
答案 0 :(得分:1)
在ng-value
的选项标记中使用ng-repeat
,如
<option ng-value="article.year" ng-repeat="article in news | orderObjectBy:'year':true | unique: 'year'">{{article.year}}</option>