angular-mn-select

0.0.10 • Public • Published

npm version Dependency Status MIT Licence

angular-mn-select

An angular directive to mn-select

See the demo

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

Package Sidebar

Install

npm i angular-mn-select

Weekly Downloads

1

Version

0.0.10

License

MIT

Last publish

Collaborators

  • darlanmendonca