angular-mn-select
v0.0.10
Published
An angular directive to mn-select
Downloads
9
Maintainers
Readme
angular-mn-select
An angular directive to mn-select
See the demo
Install
npm install --save angular-mn-select
And bundle dependencies and main files in dist/ with your preferred tool.
usage
// add dependency in you module
angular.module('app', [
'mn-select'
]);
in your controller, you just need a array to be the values, similar to
angular
.module('app')
.controller('HousesController', HousesController)
function HousesController() {
// or $scope.options if you use $scope
this.options = [
{text: 'Stark', value: 'stark'},
{text: 'Lannister', value: 'lannister'},
{text: 'Targaryen', value: 'targaryen'},
{text: 'Baratheon', value: 'baratheon'},
]
}
finally in html, use the tags mn-select
and option
, and directives ng-repeat
and ng-value
, e.g.
<mn-select ng-model='houses' placeholder='Houses'>
<option ng-repeat="option in options" ng-value="option.value">{{ option.text }}</option>
</mn-select>
For more details check mn-select docs.