angular-date-interceptor

1.0.2 • Public • Published

angular-date-interceptor


An AngularJS interceptor to parse dates from server response.

Codeship Status for ins87/angular-date-interceptor

The problem

By default, if you want to bind a model (which comes from the server) to a date input, you will get Error: [ngModel:datefmt] Expected 2015-07-25T11:40:35.395Z to be a date. The problem is that the date is in ISO 8061 string format and it is not a date object. This interceptor convert dates into date objects.

Installation

You can choose your preferred method of installation:

Usage

Include angular-date-interceptor.js in your application.

<script src="components/angular-date-interceptor/dist/angular-date-interceptor.js"></script>

Add the module angularDateInterceptor as a dependency to your module:

angular.module('myApp', ['angularDateInterceptor']);

License

Released under the terms of the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i angular-date-interceptor

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

11.8 kB

Total Files

14

Last publish

Collaborators

  • ins