angular-period
v0.1.1
Published
AngularJS Directive for switching the DOM in the period.
Downloads
283
Readme
angular-period
AngularJS directive for switching the DOM in the period.
Installation
use bower:
bower install --save angular-period
use npm:
npm install --save angular-period
Usage
Include angular-period
with angular
in your application.
<script src="/js/angular.min.js"></script>
<script src="/js/angular-period.min.js"></script>
Add the module angularPeriod
as a dependency to your app module.
angular.module('app', ['angularPeriod']);
Add the directive in your module.
<body>
<div ng-period ng-period-start="'2015-06-22T00:00:00'" ng-period-end="'2015-06-29T23:59:59'">
<div ng-period-when="previous">
<p>The previous period when this section is displayed.</p>
</div>
<div ng-period-when="during">
<p>The duration when this section is displayed.</p>
</div>
<div ng-period-when="after">
<p>The after period when this section is displayed.</p>
</div>
</div>
</body>
About date parsing
ngPeriod
dosen't support date string parsing.
If you seek safety, please specify the Date Object
or momentjs etc.
Date class that compatible with the library in ngperiod.
LICENSE
MIT