选择带有ng-options的样式选项

时间:2019-05-07 15:33:30

标签: angularjs select

我需要样式的选项(类似AngularJs材质),该样式在内部使用ng-options进行选择。我该怎么办?最好和简单的方法是什么?

index.html:

<select ng-model="$ctrl.orderBy" 
ng-options="option.name for option in $ctrl.options.sort">
</select>

contoller.js:

this.options = {
            sort: [
                {
                    name: 'alphabetically',
                    value: 'name',
                    reverse: false
                },
                {
                    name: 'index',
                    value: 'code',
                    reverse: false
                }                
            ]
        };

this.orderBy = this.options.sort[0];

0 个答案:

没有答案
相关问题