Ng-Model-Options-9

 

Example of Ng-Model-Options

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="myApp"> <div ng-controller="myController"> <br /> <div class="container"> <label> GILT: <input class="form-control" type="time" ng-model="GILTTime" ng-model-options="GILT" /> UTC: <input class="form-control" type="time" ng-model="UTCTime" ng-model-options="UTC" /> </label> <pre>GILT Time Zone: {{GILTTime}}</pre> <pre>UTC Time Zone: {{UTCTime}}</pre> </div> </div> <script> var app = angular.module("myApp", []); app.controller('myController', function ($scope, $timeout) { $scope.GILT = { timezone: 'GILT' }; $scope.UTC = { timezone: 'UTC' }; $scope.UTCTime = new Date(); }); </script> </body> </html>
Output