This is based on Jacob Carter's project angular-cron-jobs but provides us the Quartz compatible cron instead of the classic cron syntax.
All the capabilities of this project have been merged into the angular-cron-jobs project, which adds a lot of features to the module. I would highly recommend using the angular-cron-jobs
module over this one.
Play around with the demo.
You can easily get the project using bower
.
bower install angular-quartz-cron
Include the component in the app:
angular.module('my-app', ['angular-quartz-cron'])
Insert the directive:
<quartz-cron-selection></quartz-cron-selection>
You can interact with the directive using the following attributes:
- output
- init(optional)
- template(optional)
- config(optional)
Binds the output cron generated by this directive to the provided variable.
Lets you initialize the UI based on the cron string provided. It can be set after the directive has loaded.
Lets you use custom templates. It should be set to the url of the custom template you are trying to use.
This is an object in your controller you can use to remove options from the user. For example if you would like the user to be able to set Minute, Hour, and Day but not Week, Month, and Year you would create the following object in your controller:
$scope.myConfig = {
options: {
allowWeek : false,
allowMonth : false,
allowYear : false
}
}
Currently the config object accepts an options property with an object of allowed selections. These include:
- allowMinute
- allowHour
- allowDay
- allowWeek
- allowMonth
- allowYear
Setting the keys as booleans will turn the selection on and off.