Created
January 22, 2015 16:33
-
-
Save pragyandas/454403e675c77c08648a to your computer and use it in GitHub Desktop.
// source http://jsbin.com/kabulu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app='myApp'> | |
<div ng-controller='firstController'> | |
<div>{{fullName}}</div> | |
<my-directive name='name' callback-fn="getFullName(FirstName)"></my-directive> | |
</div> | |
<script id="jsbin-javascript"> | |
var app=angular.module('myApp',[]); | |
app.controller('firstController',function($scope){ | |
$scope.name='Pragyan'; | |
$scope.getFullName=function(arg){ | |
alert(arg); | |
}; | |
}); | |
app.directive('myDirective',function(){ | |
return { | |
restrict:'EA', | |
scope:{ | |
name:'=', | |
someCtrlFn:'&callbackFn' | |
}, | |
template:"<button ng-click=someCtrlFn({FirstName:'Pragyan'})>Click</button>" | |
}; | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"><\/script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app='myApp'> | |
<div ng-controller='firstController'> | |
<div>{{fullName}}</div> | |
<my-directive name='name' callback-fn="getFullName(FirstName)"></my-directive> | |
</div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">var app=angular.module('myApp',[]); | |
app.controller('firstController',function($scope){ | |
$scope.name='Pragyan'; | |
$scope.getFullName=function(arg){ | |
alert(arg); | |
}; | |
}); | |
app.directive('myDirective',function(){ | |
return { | |
restrict:'EA', | |
scope:{ | |
name:'=', | |
someCtrlFn:'&callbackFn' | |
}, | |
template:"<button ng-click=someCtrlFn({FirstName:'Pragyan'})>Click</button>" | |
}; | |
});</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app=angular.module('myApp',[]); | |
app.controller('firstController',function($scope){ | |
$scope.name='Pragyan'; | |
$scope.getFullName=function(arg){ | |
alert(arg); | |
}; | |
}); | |
app.directive('myDirective',function(){ | |
return { | |
restrict:'EA', | |
scope:{ | |
name:'=', | |
someCtrlFn:'&callbackFn' | |
}, | |
template:"<button ng-click=someCtrlFn({FirstName:'Pragyan'})>Click</button>" | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment