Skip to content

Instantly share code, notes, and snippets.

@sheryarshirazi
Created October 30, 2017 14:20
Show Gist options
  • Save sheryarshirazi/0d2cb1d52e774df848a0fbe4e64622f8 to your computer and use it in GitHub Desktop.
Save sheryarshirazi/0d2cb1d52e774df848a0fbe4e64622f8 to your computer and use it in GitHub Desktop.
// directive JS
(function() {
'use strict';
angular
.module('app')
.directive('oneWayBind', oneWayBind);
oneWayBind.$inject = [];
function oneWayBind() {
return {
scope: {
owb: '='
},
template: "{{owb || 'N/A'}}"
};
}
})();
// Directive HTML
<p one-way-bind owb="::scopeValue"></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment