Forked version from diosney/angular-bootstrap-datetimepicker-directive substantially to add a package.json and allow the dependency to be managed through npm.
npm install angular-bootstrap-datetimepicker-directiveA wrapper directive around the bootstrap-datetimepicker component.
1- Install the directive via bower (or download it manually, as you prefer)
bower install angular-bootstrap-datetimepicker-directive --save
2- Load all required scripts by eonasdan-bootstrap-datetimepicker.
Refer to the official guide.
3- Include the angular-bootstrap-datetimepicker-directive.js into your HTML.
A minified variant is provided for production named angular-bootstrap-datetimepicker-directive.min.js.
4- Inject the datetimepicker directive in you angular app:
angular
.module('myApp', [
// Other injected modules.
'datetimepicker'
]);
5- You can start using the directive in your HTML in several ways like:
a) Passing in a JSON object with the options datetimepicker placeholder="..."
``html`
datetimepicker-options="{icons:{next:'glyphicon glyphicon-arrow-right',previous:'glyphicon glyphicon-arrow-left',up:'glyphicon glyphicon-arrow-up',down:'glyphicon glyphicon-arrow-down'}}"
name="time"
ng-model="ctrl.time">
b) Passing in an angular scoped variable that holds the options
` datetimepicker placeholder="..."html`
datetimepicker-options="{{ ctrl.datetimepicker_options }}"
name="time"
ng-model="ctrl.time">
c) Set the default options with the provider and use the datepicker with those
default options.
` datetimepicker placeholder="..." html`
name="time"
ng-model="ctrl.time">
All options are named identically with the same letter case.
optionsAll of them :) If you find anyone that is causing havoc file an issue. Please,
first test that is the directive and not the original jQuery plugin which is
causing it.
Use the datetimepickerProvider` to set them
Those default options will be overwritten by the provided in the inline definition.
Just one word: simplicity.
The option by option variant have a lot of related issues, one of them is that
the directive has to know every single option of the original plugin, how to parse
it, how to include it into the directive with the isolated scope and so on.
Besides, this limit future options since have to be added too.
There are a lot more but that isn't the goal of this README after all, so I won't
do a full enumeration of them.
The MIT License (MIT)
Copyright (c) 2015 Diosney Sarmiento
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.