angular-period

0.1.1 • Public • Published

angular-period

AngularJS directive for switching the DOM in the period.

npm version Bower version Build Status Codacy Badge Code Climate Test Coverage Dependency Status

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

Readme

Keywords

Package Sidebar

Install

npm i angular-period

Weekly Downloads

114

Version

0.1.1

License

MIT

Last publish

Collaborators

  • mizuki_r