Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="test">
<head>
<script src="https://code.angularjs.org/snapshot/angular.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body my-dir>
</body>
</html>
 
angular.module('test', [])
  .directive('myDir', function() {
    return {
      restrict: 'AE',
      link: function( scope, elem, attr) {
        var
          x = scope.$eval('{"":"test"}'),
          y = JSON.parse('{"":"test"}');
          
        console.log( JSON.stringify( x ) );
        console.log( JSON.stringify( y ) );
      }
    };
  });
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers