Directive:=

by vishwackh89

HTML

<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div ng-app="app">
  <h2>Directive:=</h2>
  <div ng-controller="appCtrl">
  <br/>
  Ctrl:
  <input type="text" ng-model="ctrlFlavor">
  <br/>
  Dir:
   <div drink flavor="ctrlFlavor"></div>
  </div>
</div>

JavaScript

var app = angular.module("app",[]);

app.controller("appCtrl",function($scope){
$scope.ctrlFlavor = "apple one";
});

app.directive("drink",function(){
  return{
     scope:{
      flavor:"="
     },
      template:'<input type="text" ng-model="flavor">'
  }
});