Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="com.ngbook.demo">
<head>
<script src="//code.jquery.com/jquery.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <meta charset="utf-8">
  <title>JS Bin</title>
  <script src="http://greengerong.github.io/self/cdn/angular.js"></script>
</head>
<body >
  <div ng-controller="ParentCtrl">
    <div class="form-group">
    <h4>Parent Controller:</h4>
   <pre>{{ vm.greet | json}}</pre>
     <input type="text" ng-model="vm.greet" class="form-control"/>
    </div>
    <div ng-controller="ChildCtrl">
      <div class="form-group">
      <h4>Child controller:</h4>
      <pre>{{ vm.greet | json}}</pre>
      <input type="text" ng-model="vm.greet" class="form-control"/>
   </div>
    </div>
  </div>
</body>
</html>
 
 angular.module("com.ngbook.demo", [])
    .controller("ParentCtrl", ["$scope", function($scope){
  $scope.vm = {greet : "hello angular!"};
    
    }])
    .controller("ChildCtrl", angular.noop);
     
Output 300px

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

Dismiss x
public
Bin info
greengerongpro
0viewers