Angular.js选为整合Angular、js

2023-09-14 00:11:06 作者:来自星☆的你-_﹏

我的选择,我想加选择的功能我的角度视图中:

my select inside my angular view where i want to add chosen functionality:

<select ng-options="value for value in deutscheBankEvent.dates" ng-init="" ng-model="chosenA" class="chzn-select">
 <option style="display:none" value="">Wählen Sie ein Datum</option>
 </select><br/>

我的控制器:当我在这里注入.chosen功能,清除选项

my controller: when i inject here the .chosen function, it clears the options.

function Ctrl($scope,$http) {

  $scope.text = '';
  $scope.user = {name: '', last: '', location: ''};
  $scope.value = 0;
  $scope.sendForm = function (){
       $http.post('/Submit/To/Url', $scope.data).success(function(data) {
           alert('done!');
       });
    };
}

我的页脚:

<g:javascript>
 $(".chzn-select").chosen(); $(".chzn-select-deselect").chosen({allow_single_deselect:true});
            jQuery(".adressen1_chzn-select").chosen();jQuery(".adressen0_chzn-select").chosen();
        });
</g:javascript>

我不知道,如何让所选择的工作。内部控制它清除选项和不适,其余没有任何差异。任何想法AP preciated

i have no idea, how to get the chosen working. inside controller it clears options and does not apply, the rest does not make any difference. any ideas appreciated

推荐答案

您应该也许尝试 HTTP://angular-ui.github。 COM /

这是角指令的套件。其中,你会发现选择2指令,它作为代理的选上的的插件(的选择二的插件是precise)。

It's a suite of angular directives. Among them you'll find 'select2' directive which serves as a proxy to Chosen plugin (Select2 plugin to be precise).

 
精彩推荐
图片推荐