0

我设法制作了一个链式下拉列表,但我不能让它们具有初始值。我正在做这样的事情:

<select ng-model="check" ng-options="check.name for check in checks"></select>
              <select ng-show="check.params" ng-model="parameter" ng-options="p.name for p in check.params"></select>

以下是单次检查的示例:

 [0] => Array
        (
            [id] => 1
            [name] => existing_client
            [params] => Array
                (
                    [0] => Array
                        (
                            [id] => 3
                            [name] => IsEnabled
                            [type] => boolean
                            [check_id] => 1
                        )

                    [1] => Array
                        (
                            [id] => 18
                            [name] => country
                            [type] => country_comparison
                            [check_id] => 1
                        )

                    [2] => Array
                        (
                            [id] => 19
                            [name] => affiliate_id
                            [type] => string_comparison
                            [check_id] => 1
                        )

                    [3] => Array
                        (
                            [id] => 14
                            [name] => created_at
                            [type] => date
                            [check_id] => 1
                        )

                    [4] => Array
                        (
                            [id] => 15
                            [name] => muid
                            [type] => string_comparison
                            [check_id] => 1
                        )

                    [5] => Array
                        (
                            [id] => 20
                            [name] => region
                            [type] => string_comparison
                            [check_id] => 1
                        )

                    [6] => Array
                        (
                            [id] => 24
                            [name] => created_at_interval
                            [type] => interval
                            [check_id] => 1
                        )

                )

        )
4

1 回答 1

0

ng-model<select>就是checked

您将需要为要设置的项目过滤数组$scope.checked,或使用任何逻辑来确定该值

于 2013-11-19T17:51:58.273 回答