Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div class="home" ng-controller="homePageController">
    <input type="text" ng-model="shared.name">
  </div>
  <div class="about" ng-controller="aboutPageController">
    {{shared.name}}
  </div>
</body>
</html>
 
angular.module('myApp',[])
  .factory('sharedData',function(){
    return {
      name: 'Test'
    };
  })
  .controller('homePageController', function($scope, sharedData){
    $scope.shared = sharedData;
  })
  .controller('aboutPageController', function($scope, sharedData){
    $scope.shared = sharedData;
  });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers