Created
June 4, 2014 08:52
-
-
Save xilin/6142c29af37031766c6a to your computer and use it in GitHub Desktop.
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
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"; | |
}); |
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
<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