Angular.js选为整合 [英] Angular.js Chosen integration

查看:114
本文介绍了Angular.js选为整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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).

这篇关于Angular.js选为整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆