Skip to content

Instantly share code, notes, and snippets.

@xilin
Created June 4, 2014 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xilin/6142c29af37031766c6a to your computer and use it in GitHub Desktop.
Save xilin/6142c29af37031766c6a to your computer and use it in GitHub Desktop.
angular.module("myApp",[])
.directive("myDirective", function () {
return {
restrict: "A",
scope: {
text: "@myText",
twoWayBind: "=myTwoWayBind",
oneWayBind: "&myOneWayBind"
}
};
}).controller("myController", function ($scope) {
$scope.foo = {name: "Umur"};
$scope.bar = "qwe";
});
<div ng-controller="myController">
<div my-directive
my-text="hello {{ bar }}"
my-two-way-bind="foo"
my-one-way-bind="bar">
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment