Book Image

AngularJS Web application development Cookbook

By : Matthew Frisbie
Book Image

AngularJS Web application development Cookbook

By: Matthew Frisbie

Overview of this book

Packed with easy-to-follow recipes, this practical guide will show you how to unleash the full might of the AngularJS framework. Skip straight to practical solutions and quick, functional answers to your problems without hand-holding or slogging through the basics. Avoid antipatterns and pitfalls, and squeeze the maximum amount out of the most powerful parts of the framework, from creating promise-driven applications to building an extensible event bus. Throughout, take advantage of a clear problem-solving approach that offers code samples and explanations of components you should be using in your production applications.
Table of Contents (17 chapters)
AngularJS Web Application Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using HTML5 datetime input types


Formerly, AngularJS was limited to using antiquated input field types in forms. The 1.3 AngularJS release added the AngularJS field and model support for HTML5 date and time types, which will gracefully degrade when used on older browsers.

How to do it…

With AngularJS 1.3, your application is now able to bind to the date and time HTML5 input types while preserving their native data format.

The <input type="date"> type

The <input type="date"> date input type binds to a JavaScript Date object and extracts only the date from the Date object, ignoring the time component by letting it go unmodified (it will not be forced to midnight). The string value for the date October 31, 2014 would be 2014-10-31.

The <input type="datetime-local"> type

The <input type="datetime-local"> date input type binds to a JavaScript Date object and associates it with a time zone (by default, the browser time zone). The string value for 10:30 P.M. on October 31, 2014...