var app = angular.module('testApp', [ ]);
app.directive('telDropdownmutiple', ['$http', function ($http) {
return {
restrict: 'E',
scope: {
array: '=',
validate: '@',
ngModel: '=',
title: '@',
checkId: '@',
ngmaxLength: '@',
ngminLength: '@',
lblvalue: '@',
textboxSize: '@',
lblSize: '@',
ngShow: '@',
textboxtype: '@',
getString: '@',
multiple: '@',
},
template:'<div id="{{ checkId }}" > <span>{{ title }}</span>:<select {{ multiple }} class="{{className}}" ng-model="ngModel" ng-options="a[optValue] as a[optDescription] for a in array" requireiftrue="{{ validate }}"></div>'+
'<option style="display: none" value="">{{title}}</option>' +
'</select> </div>',
link: function (scope, element, attrs) {
scope.lblvalue = attrs.lblvalue;
scope.title = attrs.title;
scope.optValue = attrs.optValue;
scope.optDescription = attrs.optDescription;
}
};
}]);
app.controller('testController', ['$scope', '$location', function ($scope, $location) {
$scope.SelectMultiple = [
{Id: 1, Description: "option1"},
{Id: 2, Description: "option2"},
{Id: 3, Description: "option3"},
{Id: 4, Description: "option4"},
{Id: 5, Description: "option5"},
{Id: 6, Description: "option6"},
{Id: 7, Description: "option7"},
{Id: 8, Description: "option8"},
{Id: 9, Description: "option9"},
{Id: 10, Description: "option10"}
];
}]);
<script data-require="angular.js@~1.3.15" data-semver="1.3.15" src="https://code.angularjs.org/1.3.15/angular.js"></script>
<body class="hold-transition skin-blue sidebar-mini" data-ng-app="testApp">
<!-- Logo -->
<!-- Left side column. contains the logo and sidebar -->
<div class="content-wrapper" style=" margin-top: 50px; margin-bottom: 10px; height: 350px; overflow-y: auto; " ng-controller="testController">
<tel-Dropdownmutiple multiple ng-model="registration.multipledropGender" lblvalue="Gender" array="SelectMultiple" opt-value="Id" opt-description="Description" validate='true' class-Name="form-controlselect select2" ></tel-Dropdownmutiple>
</div>
</body>