0.2.8 • Published 8 years ago

angular-dayparts v0.2.8

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

angular dayparts

Angular directive for select hours in a week

Code based on this StackOverflow answer

Sample

Install it with Bower or npm

bower install angular-dayparts
npm install angular-dayparts

Include the module in your app

angular.module('myapp', ['angular-dayparts'])

Configure the directive inside the controller

$scope.options = {
    // Reset button
    reset: true, // default false
    
    // Event triggered when selecting a cell
    onChange: function(selected) {
        console.log('selected: ', selected)
    },
    
    // Prepopulated cells
    selected: ['monday-14', 'monday-15'],
    
    // When true clicking on the day name it will select the entire row
    disableRowSelection: true, // default false
    
    // When true clicking on the hour it will select the entire columns
    disableColumnSelection: true // default false
};

Call the directive from your page

<angular-dayparts options="options"></angular-dayparts>

License

Released under the terms of MIT License.