diff options
| author | Misko Hevery | 2010-10-13 12:47:10 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2010-10-13 12:47:10 -0700 | 
| commit | 805753dba47f7ef5b34af9579c1d0486f5f4ea68 (patch) | |
| tree | 4ed514732ace492c20fcfa1aea02989fe8c15462 /regression | |
| parent | 3ab49538a414a36c97ed3735c2473eefcf7be073 (diff) | |
| download | angular.js-805753dba47f7ef5b34af9579c1d0486f5f4ea68.tar.bz2 | |
fixed issue where date copy creates an object instead of date
Diffstat (limited to 'regression')
| -rw-r--r-- | regression/resource_json_date.html | 30 | ||||
| -rw-r--r-- | regression/resource_json_date.json | 1 | 
2 files changed, 31 insertions, 0 deletions
| diff --git a/regression/resource_json_date.html b/regression/resource_json_date.html new file mode 100644 index 00000000..59300863 --- /dev/null +++ b/regression/resource_json_date.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html xmlns:ng="http://angularjs.org"> +<head> +  <script type="text/javascript" src="../src/angular-bootstrap.js" ng:autobind></script> +  </script> +  <script type="text/javascript"> +    angular.service('myService', function($resource){ +      this.myData = $resource('resource_json_date.json'); +    }, {$inject:['$resource'], $creation:'eager'}); + +    /* The Controller object */ +    MyController = function() { +      this.inlineData = angular.fromJson('{reportDate:"2010-10-13T17:37:00Z"}'); +      this.jsonData = this.myData.get(); +    }; + + + +  </script> +</head> +<body ng:controller="MyController" ng:init="$window.$root = this"> +  <h3>This data is loaded with angular.fromJson:</h3> +  {{ inlineData.reportDate | date }} +  <hr/> +  <h3>This data is loaded from a resource using a service:</h3> +  <p>Name: {{ jsonData.name }}</p> +  <p>Parsed date: {{ jsonData.reportDate }} (A date should be displayed here)</p> + +</body> +</html>
\ No newline at end of file diff --git a/regression/resource_json_date.json b/regression/resource_json_date.json new file mode 100644 index 00000000..78f70cb3 --- /dev/null +++ b/regression/resource_json_date.json @@ -0,0 +1 @@ +{reportDate:"2010-10-13T17:37:00Z", name:"camilo"}
\ No newline at end of file | 
